Claude Skill

lov-skill-optimizer

Audit and optimize one or more existing Agent Skills from a canonical source path, then bump semver, update README/SKILL.md/skill.yaml/CHANGELOG.md, and verify installed copies and catalog synchronization. Checks frontmatter, trigger quality, CLI hygiene, naming, portability, ver

LLM Mart · 0 points · 14 views 0 listing impressions 0 install-command copies
Download lovstudio-skills-skills_skill-optimizer-77d464c.zip · 26 KB
This skill couldn't be refreshed from GitHub on the last check — you're seeing the last imported snapshot.

Install

skills CLI npx skills add https://github.com/lovstudio/skills/tree/main/skills/skill-optimizer
Claude Code claude plugin marketplace add https://llmmart.ai/marketplace.json && claude plugin install lovstudio-skills@llmmart
Git git clone https://github.com/lovstudio/skills.git

The skills CLI installs just this skill, for any of its supported agents. Claude Code installs the whole lovstudio/skills collection as a plugin from our marketplace. Git is the plain clone.

README

Skill 精修师 · Skill Refiner

Version

自动审计并优化 Agent Skill:按当前对话优先修复问题,统一 README、SKILL.md、 skill.yaml 与 CHANGELOG 版本,然后核对规范源、安装副本和 catalog 的同步状态。 支持独立 Skill 目录、嵌套仓库和已安装副本,不把未发现的位置当成已同步。 付费 Skill 仓库会审计 src/SKILL.md,同步时只使用 public/ 加密分发载荷,避免把 明文规范误装到用户目录。

用户反馈先分三层:仅当前任务、单个 Skill 可复用、所有 Skill 全局可复用。全局规则只进入 用户级共享规范(例如生效中的 AGENTS.md),不会机械复制到每个 SKILL.md;如果之前放错 了领域 Skill,会迁移到共享层并保留真正的领域规则。任何可复用修改都会使修改前的终稿确认 失效,完成当前产物更新后停下等待下一步。

安装

npx skills add lovstudio/skills --skill lov-skill-optimizer -y -g

Requires: Python 3.8+(仅标准库);Git 用于源码提交/推送核验。

使用

# 审计一个独立 Skill
python3 scripts/lint_skill.py --path /absolute/path/to/skill --json

# 检查规范源、安装副本和 catalog
python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json

# 先比较安装副本,不写入
python3 scripts/sync_installation.py \
  --source /absolute/path/to/canonical-skill \
  --target /absolute/path/to/installed-skill --json

# 审阅后同步普通副本;符号链接只做校验
python3 scripts/sync_installation.py \
  --source /absolute/path/to/canonical-skill \
  --target /absolute/path/to/installed-skill --apply --json

# 统一版本并追加 CHANGELOG
python3 scripts/bump_version.py \
  --path /absolute/path/to/skill \
  --type minor \
  --message "add guarded synchronization audit"

# 审计一个 Skills 根目录
python3 scripts/lint_skill.py --all --root /absolute/path/to/skills --json

也可以使用 Skill 名称(foo、lov-foo、foo-skill);跨仓库或已安装副本优先 使用 --path,以确保修改落在规范源上。

处理顺序

  1. 读取当前对话中的具体问题,区分已认可基线、请求增量和被否决的修复尝试;
  2. 运行 lint,检查 frontmatter、触发语句、可移植性、版本漂移和脚本 CLI;
  3. 只修改规范源;
  4. 统一版本、追加 CHANGELOG;
  5. 重新 lint 并读取布局检查结果;
  6. 比较并同步已发现的安装副本和 catalog;
  7. 精确 staging、提交并推送,逐层报告失败状态。

同一请求中出现多个 Skill 时,按用户给出的顺序逐个处理,每个 Skill 单独 bump 版本并单独输出结果块。

输出状态

报告固定包含 source、distribution、catalog、distribution state、 catalog state 和 sync state。安装副本已同步但 catalog 未发现时,整体仍为 partial;发现 catalog 后还要比较匹配 Skill 的 digest;本地源码提交不等于 catalog 或线上页面已更新。

许可

MIT

Skill manifest

Skill 精修师 · Skill Refiner

This is a non-interactive maintenance workflow. It infers the target and prioritizes issues from the current conversation, then supplements them with a generic lint pass. When several Skills are named in one request, process them in the order named and emit a separate result block for each Skill.

Target and source resolution

Prefer an explicit canonical path whenever the Skill is outside a conventional skills repository:

python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json

For a name, accept foo, lov-foo, or foo-skill. Resolution may find a source checkout, an installed copy, or a catalog entry. Before editing:

  1. Resolve symlinks and record the actual path.
  2. Identify the Git root, branch, and dirty worktree state.
  3. Treat a source checkout as canonical. If the target is an installed copy, locate a matching source checkout; when no source exists, report that the supplied path itself is canonical instead of silently editing another copy.
  4. Record every discovered installation and catalog path. A copy is synced only when its content digest matches the source; a missing location is not_discovered, never complete. A symlink is synced only when it resolves to the canonical source.

Paid/encrypted repositories may keep the authored specification at src/SKILL.md and the installable payload under public/. Treat the repository root as canonical, lint and version the authored spec, and compare or sync only the public/ payload to installations. Never copy plaintext src/ content into an installed paid Skill.

Do not absorb pre-existing edits into a maintenance commit. If a target file is already dirty, review the overlap before editing it and stage only the exact files changed by this optimization.

Workflow (mandatory)

Step 0: Classify feedback scope

When the optimization is triggered by a user correction, classify it before choosing targets:

  • task-specific: applies only to the current artifact or one-off value. Do not edit a Skill.
  • skill-specific reusable: applies to future runs of one domain or platform. Optimize the relevant canonical Skill.
  • global reusable: changes how every Skill should handle feedback, authorization, sequencing, or handoff. Update the host's active user-level shared instruction artifact once (for example the applicable user-level AGENTS.md); do not paste the same policy into every domain SKILL.md.

If a global policy was previously placed in one domain Skill, move it to the shared layer and remove the domain duplicate while preserving any genuinely domain-specific rule learned in the same incident. A shared policy file may be outside the Skill repository; report its path and verification state explicitly instead of pretending it is part of the Skill package.

Any reusable correction invalidates prior terminal approval for the active task. Finish the policy/Skill optimization and validation first, then apply the correction to the current artifact, report the new state, and stop for the user's next instruction. Do not continue into publishing, submission, or another external write using a pre-correction “confirm”, “continue”, or “go ahead”.

Step 1: Extract targets and context

Normalize every explicitly named Skill and preserve the user's order. Strip the lov- prefix only for lookup; keep the public Skill identifier in reports. Collect the current-conversation fix list first: broken flags, trigger misses, wrong paths, confusing output, missing modules, compatibility requirements, or other concrete symptoms.

For every correction, distinguish four pieces of evidence: the observed defect, the latest user-approved baseline, the requested delta, and any remedy the user rejected. A rejected remedy is negative evidence, not a reusable best practice. Preserve the approved baseline outside the requested delta, and do not encode a failed over-correction into the target Skill.

Step 2: Baseline lint

For each target, run the linter against the resolved canonical path:

python3 scripts/lint_skill.py --path /absolute/path/to/skill --json

Prioritize findings in this order:

  1. Fixes explicitly mentioned in the conversation;
  2. error findings;
  3. warn findings;
  4. cheap, low-risk info findings.

The baseline must include version-source drift between README.md, SKILL.md frontmatter, and skill.yaml. Portability findings are high priority for a reusable Skill: move personal paths to flags, environment variables, or references/user-config.md, or mark a genuinely author-only dependency in compatibility.

Classify the Skill's normal output before editing. If it generates, edits, reviews, renders, packages, or publishes text visible to an end user or reader, top-level depends_on must contain lov-branding-consistency. This dependency gates authored presentation copy only; it must not rewrite quotations, transcripts, source data, legal text, identifiers, or code without permission.

Step 3: Apply focused fixes

Edit only the canonical source. Keep the Skill's public trigger surface, compatibility aliases, storage contracts, and user-facing semantics explicit. Use progressive disclosure when SKILL.md grows beyond roughly 500 lines. Add a script or reference file only when it resolves a concrete audit finding or conversation issue.

When the user has already approved an artifact and then requests a localized fix, optimize the domain Skill around a minimal-delta contract: lock accepted layout, copy, data, and behavior as invariants; change only the defective region; verify the whole artifact afterward. A broad redesign requires an explicit new request, not an inferred opportunity.

The linter checks both root SKILL.md repositories and paid/encrypted src/SKILL.md repositories:

  • Agent Skills-compatible frontmatter and trigger phrases;
  • README version badge and installation command;
  • metadata.version, README badge, and skill.yaml version consistency;
  • CLI use of argparse and obvious script hygiene;
  • TODO placeholders and oversized instruction bodies;
  • personal paths, fixed runtime paths, and missing user configuration;
  • source/install/catalog layout evidence.
  • missing lov-branding-consistency dependency for audience-visible text Skills.

Step 4: Bump semver and changelog

Use the path-aware version tool so all version surfaces move together:

python3 scripts/bump_version.py \
  --path /absolute/path/to/skill \
  --type minor \
  --message "add guarded project rename workflow" \
  --change "report source, installation, and catalog synchronization state"

Choose patch for bug, wording, frontmatter, or lint fixes; minor for a new flag, reference, module, or expanded workflow; major for a breaking CLI or removed behavior. Stay in 0.x unless the user explicitly requests otherwise. The tool updates README.md, the authored SKILL.md, paid-skill public wrappers, skill.yaml, and CHANGELOG.md and refuses to duplicate an existing changelog version.

Step 5: Re-lint and inspect layout

python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json

Do not report remaining lint warnings: none unless the final JSON was read. Do not report synchronization as complete unless every discovered distribution copy and required catalog check has been verified after the source change. Keep distribution_state, catalog_state, and the aggregate sync_state separate: an installed copy can be complete while an undiscovered catalog keeps the aggregate state partial. A discovered catalog is complete only when its matching Skill payload digest is synced.

Step 6: Synchronize discovered distributions

inspect_layout.py checks conventional and configured installation roots: AGENT_SKILLS_DIR, CLAUDE_SKILLS_DIR, CODEX_SKILLS_DIR, SKILLS_DIR, plus the host's agent-managed fallback roots. It also checks explicit --install-root and --catalog-root values plus the nearby unified lovstudio-skills catalog and legacy general/dev catalog names. Use an environment variable or explicit flag when the installation root is outside the conventional layout.

For a non-symlink installation copy, first run a read-only sync plan. Paid repositories automatically use their public/ payload:

python3 scripts/sync_installation.py \
  --source /absolute/path/to/canonical-skill \
  --target /absolute/path/to/installed-skill \
  --json

After reviewing missing, changed, and extra, apply the exact copy with:

python3 scripts/sync_installation.py \
  --source /absolute/path/to/canonical-skill \
  --target /absolute/path/to/installed-skill \
  --apply --json

Use --prune only when removing extra files from the installation copy is explicitly part of the task. Symlink installations are verified, not copied. For a catalog, use its own scripts only when they are actually present:

python3 scripts/sync-skills.py
python3 scripts/render-marketplace.py
python3 scripts/render-readme.py
python3 scripts/validate_deps.py

Run only the commands that exist in that catalog checkout. If no catalog is discovered, report not_discovered; if source and installation are updated but the catalog is stale or unavailable, report partial. Never invent a catalog path or claim a live-site update from a local source commit.

Step 7: Commit and push exact source changes

Inspect git diff --check, then stage the listed changed files explicitly:

git add -- SKILL.md README.md CHANGELOG.md skill.yaml scripts references
git diff --cached --name-only
git commit -m "fix(<skill-name>): <one-line summary>"
git push origin HEAD

Use feat for a minor feature and feat! for a breaking change. If the source checkout has no remote, commit on its current branch and report push: not_configured; do not imply that a remote release happened. If a catalog is a separate repository, commit and push it independently after its own validation.

Final report contract

Return one block per optimized target, with no trailing summary:

optimized: lov-<name>
version:   <old> → <new>
source:    <canonical path> (<clean|dirty>)
distribution:
  - <path>: <synced|drifted|not_discovered>
catalog:
  - <path>: <synced|partial|not_discovered>
fixes:
  - <bullet 1>
  - <bullet 2>
remaining lint warnings: <count>  (or "none")
sync state: <complete|partial|not_discovered>

The keys stay stable for machine parsing; the values and fix bullets follow the user's language. A failed or skipped push, installation sync, or catalog sync must appear in the relevant state rather than being omitted.

Runtime context

Read this Skill's skill.yaml when the host supplies skill-runtime/v1. Use only fields declared there. Profile data is for public identity facts and preferences are for output language/timezone; neither replaces the canonical source, installation, or catalog evidence collected by this workflow.

CLI reference

python3 scripts/lint_skill.py --path PATH [--json]
python3 scripts/lint_skill.py --all --root PATH [--json]
python3 scripts/bump_version.py --path PATH --type patch|minor|major -m MESSAGE
python3 scripts/inspect_layout.py --path PATH [--install-root PATH] [--catalog-root PATH] [--json]
python3 scripts/sync_installation.py --source PATH --target PATH [--apply] [--prune] [--json]

All bundled tools use Python's standard library only.

通用反馈闭环

用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:

  1. 先判断意见是 task-specific(仅本次)还是 reusable(可跨任务复用)。
  2. task-specific 只修改当前任务,不改 Skill。
  3. reusable 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
  4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
  5. reusable 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
Files (skills)
  • scripts
    • bump_version.py 11.4 KB
      Loading…
    • inspect_layout.py 9.2 KB
      Loading…
    • lint_skill.py 29.7 KB
      Loading…
    • sync_installation.py 5.8 KB
      Loading…
  • CHANGELOG.md 3.5 KB
    Loading…
  • README.md 3.1 KB
    # Skill 精修师 · Skill Refiner
    
    ![Version](https://img.shields.io/badge/version-0.11.1-CC785C)
    
    自动审计并优化 Agent Skill:按当前对话优先修复问题,统一 README、SKILL.md、
    `skill.yaml` 与 CHANGELOG 版本,然后核对规范源、安装副本和 catalog 的同步状态。
    支持独立 Skill 目录、嵌套仓库和已安装副本,不把未发现的位置当成已同步。
    付费 Skill 仓库会审计 `src/SKILL.md`,同步时只使用 `public/` 加密分发载荷,避免把
    明文规范误装到用户目录。
    
    用户反馈先分三层:仅当前任务、单个 Skill 可复用、所有 Skill 全局可复用。全局规则只进入
    用户级共享规范(例如生效中的 `AGENTS.md`),不会机械复制到每个 `SKILL.md`;如果之前放错
    了领域 Skill,会迁移到共享层并保留真正的领域规则。任何可复用修改都会使修改前的终稿确认
    失效,完成当前产物更新后停下等待下一步。
    
    ## 安装
    
    ```bash
    npx skills add lovstudio/skills --skill lov-skill-optimizer -y -g
    ```
    
    Requires: Python 3.8+(仅标准库);Git 用于源码提交/推送核验。
    
    ## 使用
    
    ```bash
    # 审计一个独立 Skill
    python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
    
    # 检查规范源、安装副本和 catalog
    python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json
    
    # 先比较安装副本,不写入
    python3 scripts/sync_installation.py \
      --source /absolute/path/to/canonical-skill \
      --target /absolute/path/to/installed-skill --json
    
    # 审阅后同步普通副本;符号链接只做校验
    python3 scripts/sync_installation.py \
      --source /absolute/path/to/canonical-skill \
      --target /absolute/path/to/installed-skill --apply --json
    
    # 统一版本并追加 CHANGELOG
    python3 scripts/bump_version.py \
      --path /absolute/path/to/skill \
      --type minor \
      --message "add guarded synchronization audit"
    
    # 审计一个 Skills 根目录
    python3 scripts/lint_skill.py --all --root /absolute/path/to/skills --json
    ```
    
    也可以使用 Skill 名称(`foo`、`lov-foo`、`foo-skill`);跨仓库或已安装副本优先
    使用 `--path`,以确保修改落在规范源上。
    
    ## 处理顺序
    
    1. 读取当前对话中的具体问题,区分已认可基线、请求增量和被否决的修复尝试;
    2. 运行 lint,检查 frontmatter、触发语句、可移植性、版本漂移和脚本 CLI;
    3. 只修改规范源;
    4. 统一版本、追加 CHANGELOG;
    5. 重新 lint 并读取布局检查结果;
    6. 比较并同步已发现的安装副本和 catalog;
    7. 精确 staging、提交并推送,逐层报告失败状态。
    
    同一请求中出现多个 Skill 时,按用户给出的顺序逐个处理,每个 Skill 单独 bump
    版本并单独输出结果块。
    
    ## 输出状态
    
    报告固定包含 `source`、`distribution`、`catalog`、`distribution state`、
    `catalog state` 和 `sync state`。安装副本已同步但 catalog 未发现时,整体仍为
    `partial`;发现 catalog 后还要比较匹配 Skill 的 digest;本地源码提交不等于
    catalog 或线上页面已更新。
    
    ## 许可
    
    MIT
    
  • SKILL.md 13.3 KB
    ---
    name: lov-skill-optimizer
    category: Meta Skills
    tagline: "Audit an Agent Skill, apply focused fixes, bump semver, and verify every distribution layer."
    description: >
      Audit and optimize one or more existing Agent Skills from a canonical source
      path, then bump semver, update README/SKILL.md/skill.yaml/CHANGELOG.md, and
      verify installed copies and catalog synchronization. Checks frontmatter,
      trigger quality, CLI hygiene, naming, portability, version drift, dirty
      worktrees, shared Skill feedback policy, and compatibility contracts. Use when the user asks to optimize,
      refine, audit, polish, or update a Skill, or mentions "优化 skill", "skill
      审计", "刷一遍 skill", "skill-optimizer", or "update skill changelog".
    license: MIT
    compatibility: >
      Requires Python 3.8+ (stdlib only). Git is optional for linting and required
      for source commit/push verification. Catalog synchronization is discovered
      from explicit paths, environment variables, or nearby checkouts; unavailable
      locations are reported rather than assumed.
    depends_on:
      - lov-branding-consistency
    metadata:
      author: lovstudio
      version: "0.11.1"
      tags: meta skill-maintenance versioning changelog lint portability sync
    ---
    
    # Skill 精修师 · Skill Refiner
    
    This is a non-interactive maintenance workflow. It infers the target and
    prioritizes issues from the current conversation, then supplements them with a
    generic lint pass. When several Skills are named in one request, process them
    in the order named and emit a separate result block for each Skill.
    
    ## Target and source resolution
    
    Prefer an explicit canonical path whenever the Skill is outside a conventional
    skills repository:
    
    ```bash
    python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
    python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json
    ```
    
    For a name, accept `foo`, `lov-foo`, or `foo-skill`. Resolution may find a
    source checkout, an installed copy, or a catalog entry. Before editing:
    
    1. Resolve symlinks and record the actual path.
    2. Identify the Git root, branch, and dirty worktree state.
    3. Treat a source checkout as canonical. If the target is an installed copy,
       locate a matching source checkout; when no source exists, report that the
       supplied path itself is canonical instead of silently editing another copy.
    4. Record every discovered installation and catalog path. A copy is `synced`
       only when its content digest matches the source; a missing location is
       `not_discovered`, never `complete`. A symlink is `synced` only when it
       resolves to the canonical source.
    
    Paid/encrypted repositories may keep the authored specification at
    `src/SKILL.md` and the installable payload under `public/`. Treat the repository
    root as canonical, lint and version the authored spec, and compare or sync only
    the `public/` payload to installations. Never copy plaintext `src/` content into
    an installed paid Skill.
    
    Do not absorb pre-existing edits into a maintenance commit. If a target file is
    already dirty, review the overlap before editing it and stage only the exact
    files changed by this optimization.
    
    ## Workflow (mandatory)
    
    ### Step 0: Classify feedback scope
    
    When the optimization is triggered by a user correction, classify it before choosing targets:
    
    - `task-specific`: applies only to the current artifact or one-off value. Do not edit a Skill.
    - `skill-specific reusable`: applies to future runs of one domain or platform. Optimize the relevant
      canonical Skill.
    - `global reusable`: changes how every Skill should handle feedback, authorization, sequencing, or
      handoff. Update the host's active user-level shared instruction artifact once (for example the
      applicable user-level `AGENTS.md`); do **not** paste the same policy into every domain `SKILL.md`.
    
    If a global policy was previously placed in one domain Skill, move it to the shared layer and remove the
    domain duplicate while preserving any genuinely domain-specific rule learned in the same incident. A
    shared policy file may be outside the Skill repository; report its path and verification state explicitly
    instead of pretending it is part of the Skill package.
    
    Any `reusable` correction invalidates prior terminal approval for the active task. Finish the policy/Skill
    optimization and validation first, then apply the correction to the current artifact, report the new state,
    and stop for the user's next instruction. Do not continue into publishing, submission, or another external
    write using a pre-correction “confirm”, “continue”, or “go ahead”.
    
    ### Step 1: Extract targets and context
    
    Normalize every explicitly named Skill and preserve the user's order. Strip the
    `lov-` prefix only for lookup; keep the public Skill identifier in reports.
    Collect the current-conversation fix list first: broken flags, trigger misses,
    wrong paths, confusing output, missing modules, compatibility requirements, or
    other concrete symptoms.
    
    For every correction, distinguish four pieces of evidence: the observed
    defect, the latest user-approved baseline, the requested delta, and any remedy
    the user rejected. A rejected remedy is negative evidence, not a reusable best
    practice. Preserve the approved baseline outside the requested delta, and do
    not encode a failed over-correction into the target Skill.
    
    ### Step 2: Baseline lint
    
    For each target, run the linter against the resolved canonical path:
    
    ```bash
    python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
    ```
    
    Prioritize findings in this order:
    
    1. Fixes explicitly mentioned in the conversation;
    2. `error` findings;
    3. `warn` findings;
    4. cheap, low-risk `info` findings.
    
    The baseline must include version-source drift between README.md, SKILL.md
    frontmatter, and skill.yaml. Portability findings are high priority for a
    reusable Skill: move personal paths to flags, environment variables, or
    `references/user-config.md`, or mark a genuinely author-only dependency in
    `compatibility`.
    
    Classify the Skill's normal output before editing. If it generates, edits,
    reviews, renders, packages, or publishes text visible to an end user or reader,
    top-level `depends_on` must contain `lov-branding-consistency`. This dependency
    gates authored presentation copy only; it must not rewrite quotations,
    transcripts, source data, legal text, identifiers, or code without permission.
    
    ### Step 3: Apply focused fixes
    
    Edit only the canonical source. Keep the Skill's public trigger surface,
    compatibility aliases, storage contracts, and user-facing semantics explicit.
    Use progressive disclosure when SKILL.md grows beyond roughly 500 lines. Add a
    script or reference file only when it resolves a concrete audit finding or
    conversation issue.
    
    When the user has already approved an artifact and then requests a localized
    fix, optimize the domain Skill around a minimal-delta contract: lock accepted
    layout, copy, data, and behavior as invariants; change only the defective
    region; verify the whole artifact afterward. A broad redesign requires an
    explicit new request, not an inferred opportunity.
    
    The linter checks both root `SKILL.md` repositories and paid/encrypted
    `src/SKILL.md` repositories:
    
    - Agent Skills-compatible frontmatter and trigger phrases;
    - README version badge and installation command;
    - `metadata.version`, README badge, and `skill.yaml` version consistency;
    - CLI use of argparse and obvious script hygiene;
    - TODO placeholders and oversized instruction bodies;
    - personal paths, fixed runtime paths, and missing user configuration;
    - source/install/catalog layout evidence.
    - missing `lov-branding-consistency` dependency for audience-visible text Skills.
    
    ### Step 4: Bump semver and changelog
    
    Use the path-aware version tool so all version surfaces move together:
    
    ```bash
    python3 scripts/bump_version.py \
      --path /absolute/path/to/skill \
      --type minor \
      --message "add guarded project rename workflow" \
      --change "report source, installation, and catalog synchronization state"
    ```
    
    Choose `patch` for bug, wording, frontmatter, or lint fixes; `minor` for a new
    flag, reference, module, or expanded workflow; `major` for a breaking CLI or
    removed behavior. Stay in `0.x` unless the user explicitly requests otherwise.
    The tool updates README.md, the authored SKILL.md, paid-skill public wrappers,
    skill.yaml, and CHANGELOG.md and refuses to duplicate an existing changelog
    version.
    
    ### Step 5: Re-lint and inspect layout
    
    ```bash
    python3 scripts/lint_skill.py --path /absolute/path/to/skill --json
    python3 scripts/inspect_layout.py --path /absolute/path/to/skill --json
    ```
    
    Do not report `remaining lint warnings: none` unless the final JSON was read.
    Do not report synchronization as complete unless every discovered distribution
    copy and required catalog check has been verified after the source change. Keep
    `distribution_state`, `catalog_state`, and the aggregate `sync_state` separate:
    an installed copy can be `complete` while an undiscovered catalog keeps the
    aggregate state `partial`. A discovered catalog is `complete` only when its
    matching Skill payload digest is `synced`.
    
    ### Step 6: Synchronize discovered distributions
    
    `inspect_layout.py` checks conventional and configured installation roots:
    `AGENT_SKILLS_DIR`, `CLAUDE_SKILLS_DIR`, `CODEX_SKILLS_DIR`, `SKILLS_DIR`,
    plus the host's agent-managed fallback roots. It also checks explicit
    `--install-root` and `--catalog-root` values plus the nearby unified
    `lovstudio-skills` catalog and legacy general/dev catalog names. Use an
    environment variable or explicit flag when the installation root is outside
    the conventional layout.
    
    For a non-symlink installation copy, first run a read-only sync plan. Paid
    repositories automatically use their `public/` payload:
    
    ```bash
    python3 scripts/sync_installation.py \
      --source /absolute/path/to/canonical-skill \
      --target /absolute/path/to/installed-skill \
      --json
    ```
    
    After reviewing `missing`, `changed`, and `extra`, apply the exact copy with:
    
    ```bash
    python3 scripts/sync_installation.py \
      --source /absolute/path/to/canonical-skill \
      --target /absolute/path/to/installed-skill \
      --apply --json
    ```
    
    Use `--prune` only when removing extra files from the installation copy is
    explicitly part of the task. Symlink installations are verified, not copied.
    For a catalog, use its own scripts only when they are actually present:
    
    ```bash
    python3 scripts/sync-skills.py
    python3 scripts/render-marketplace.py
    python3 scripts/render-readme.py
    python3 scripts/validate_deps.py
    ```
    
    Run only the commands that exist in that catalog checkout. If no catalog is
    discovered, report `not_discovered`; if source and installation are updated but
    the catalog is stale or unavailable, report `partial`. Never invent a catalog
    path or claim a live-site update from a local source commit.
    
    ### Step 7: Commit and push exact source changes
    
    Inspect `git diff --check`, then stage the listed changed files explicitly:
    
    ```bash
    git add -- SKILL.md README.md CHANGELOG.md skill.yaml scripts references
    git diff --cached --name-only
    git commit -m "fix(<skill-name>): <one-line summary>"
    git push origin HEAD
    ```
    
    Use `feat` for a minor feature and `feat!` for a breaking change. If the source
    checkout has no remote, commit on its current branch and report `push:
    not_configured`; do not imply that a remote release happened. If a catalog is a
    separate repository, commit and push it independently after its own validation.
    
    ## Final report contract
    
    Return one block per optimized target, with no trailing summary:
    
    ```
    optimized: lov-<name>
    version:   <old> → <new>
    source:    <canonical path> (<clean|dirty>)
    distribution:
      - <path>: <synced|drifted|not_discovered>
    catalog:
      - <path>: <synced|partial|not_discovered>
    fixes:
      - <bullet 1>
      - <bullet 2>
    remaining lint warnings: <count>  (or "none")
    sync state: <complete|partial|not_discovered>
    ```
    
    The keys stay stable for machine parsing; the values and fix bullets follow the
    user's language. A failed or skipped push, installation sync, or catalog sync
    must appear in the relevant state rather than being omitted.
    
    ## Runtime context
    
    Read this Skill's `skill.yaml` when the host supplies `skill-runtime/v1`.
    Use only fields declared there. Profile data is for public identity facts and
    preferences are for output language/timezone; neither replaces the canonical
    source, installation, or catalog evidence collected by this workflow.
    
    ## CLI reference
    
    ```bash
    python3 scripts/lint_skill.py --path PATH [--json]
    python3 scripts/lint_skill.py --all --root PATH [--json]
    python3 scripts/bump_version.py --path PATH --type patch|minor|major -m MESSAGE
    python3 scripts/inspect_layout.py --path PATH [--install-root PATH] [--catalog-root PATH] [--json]
    python3 scripts/sync_installation.py --source PATH --target PATH [--apply] [--prune] [--json]
    ```
    
    All bundled tools use Python's standard library only.
    
    ## 通用反馈闭环
    
    用户在 Skill 驱动任务中提出修改意见时,继续当前产物前必须执行:
    
    1. 先判断意见是 `task-specific`(仅本次)还是 `reusable`(可跨任务复用)。
    2. `task-specific` 只修改当前任务,不改 Skill。
    3. `reusable` 先确定作用域:领域规则先更新对应 canonical Skill;适用于所有 Skill 的规则先更新共享规范。
    4. 完成规则更新、版本、lint 与分发核验后,再把修改应用到当前任务。
    5. `reusable` 修改会使此前的“确认”“继续”“发吧”失效;完成当前产物修改和回读后必须停下,等待用户下一步指示,不自动进入发布、提交或其他外部写入。
    
  • skill.yaml 846 B
    Loading…

Comments (0)

Sign in to join the conversation.

No comments yet.

Reviews (0)

No reviews yet.