feat(meta): 抽出技能目錄同步與引用查找為共用工具
什麼:新增 tools/sync-skill-manifest.sh(重建 domain README 的「Skills 目錄」區塊並將三份 plugin manifest 的版本一併 bump)與 tools/find-skill-refs.sh(掃描所有 jsc domain 存取庫,列出技能名稱或 /jsc-{domain}:{name} 指令形式的引用檔案),並更新 skill-check、skill-delete、skill-new、skill-update、skillset-update 五支 SKILL.md 改為呼叫這兩支工具。skill-delete 與 skill-update 的 frontmatter description 也一併收斂在此次改動內,配合本次流程調整精簡文字。
為何:五支技能先前各自以近乎相同的內嵌文字描述「同步 README、bump 版本」的機械流程,重複維護成本高且容易漂移;skill-delete 的引用盤點步驟先前只是一段沒有工具、也沒有標明子代理人的裸 grep 指示,稽核時難以驗證涵蓋範圍。
如何:把兩段機械流程各自抽成一支冪等 shell 工具,五支技能的對應步驟改為「子代理人只做內容判斷與修改,機械式同步與版本 bump 一律呼叫工具」;skill-delete 步驟 4 改呼叫 find-skill-refs.sh 取代裸 grep 說明。
負責範圍:jsc-meta 技能組自我管理,skill-check、skill-delete、skill-new、skill-update、skillset-update 五支技能共用的機械流程去重。
This commit is contained in:
@@ -12,6 +12,6 @@ Single source of guidelines: [`../../references/guidelines.md`](../../references
|
||||
1. Query the Gitea canonical marketplace for the authoritative domain list: run `jsc-gitea/tools/gitea.sh api GET /repos/plugins/jsc/raw/.claude-plugin/marketplace.json`. Clone any domain repo missing from the working directory (`gitea.sh clone-url plugins/{domain}`) and pull the rest. Completion condition: every domain repo exists locally and is current.
|
||||
2. Audit every skill of every domain against the guidelines.md audit checklist — this step MUST run as a sub agent, one sub agent per domain repo. Each sub agent reports its findings: skill, failed checklist item, evidence (file:line), proposed fix. Completion condition: every domain has an audit result.
|
||||
3. Present each failed item via the `jsc-ask:ask` decision tree (apply the proposed fix / skip / custom fix). Every option states its impact scope (example: skipping leaves the skill non-compliant until the next audit). Completion condition: every finding has a recorded decision.
|
||||
4. Apply the confirmed fixes — this step MUST run as a sub agent, one sub agent per affected domain repo: modify the files, sync that domain README's 「Skills 目錄」 section, and bump the version in all three manifests. Completion condition: every affected repo carries the fixes and the manifest bump.
|
||||
4. Apply the confirmed fixes — the fix-application part MUST run as a sub agent, one sub agent per affected domain repo: modify the files per the confirmed fix. Then run `tools/sync-skill-manifest.sh {domain-path}` directly (no sub agent needed) for each affected domain repo to refresh that domain README's 「Skills 目錄」 section and bump the version in all three manifests. Completion condition: every affected repo carries the fixes and the manifest bump.
|
||||
5. Re-check the guidelines.md audit checklist for every touched skill. On any failure, **return to step 3**: confirm and fix again, until all items pass. Completion condition: all checklist items pass.
|
||||
6. Call `jsc-git:pr` once per affected domain repo to open a Push Request. Completion condition: every affected repo has a PR URL.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: skill-delete
|
||||
description: Remove a skill from the jsc skill set safely. List skills starting from the Gitea canonical marketplace (cloning any missing domain repo), let the user pick, inventory every file referencing the skill via a sub agent, fix each affected file through decision-tree questions until guideline checks pass, then delete the skill, deep-verify each installed CLI's on-disk skill and hook storage is clean, and open a PR via jsc-git pr. Use only for removal; not for renaming (use skill-update).
|
||||
description: Remove a skill from the jsc skill set safely. List skills from the Gitea canonical marketplace (cloning any missing domain repo) and let the user pick, inventory every file referencing the skill via a sub agent, fix each affected file through decision-tree questions until guideline checks pass, then delete the skill, verify the removal is clean, and open a PR via jsc-git pr. Use only for removal; not for renaming (use skill-update).
|
||||
---
|
||||
|
||||
# skill-delete — delete a skill
|
||||
@@ -12,13 +12,11 @@ Single source of guidelines: [`../../references/guidelines.md`](../../references
|
||||
1. Query Gitea for the canonical skill set first: run `jsc-gitea/tools/gitea.sh api GET /repos/plugins/jsc/raw/.claude-plugin/marketplace.json` to get the authoritative domain list, then scan local `jsc-*/skills/*/SKILL.md` and present a "domain / name / description" list covering every domain in the marketplace. Completion condition: the list covers all marketplace domains.
|
||||
2. For any marketplace domain whose repo is missing from the working directory, clone it first (`gitea.sh clone-url plugins/{domain}`), then rescan. Completion condition: every domain repo exists locally.
|
||||
3. Let the user pick the skill to delete. Options state the impact scope: which skills reference it, and that its command stops working after deletion.
|
||||
4. Inventory every file related to the skill — this step MUST run as a sub agent:
|
||||
- `grep -r` for the skill name and `/jsc-{domain}:{name}` across all jsc-* repositories
|
||||
- References in other SKILL.md files, the domain README's 「Skills 目錄」 section, the two marketplace.json files in `plugins/jsc` plus their synced copies in every domain repo, `tools/`, and the `jsc-hooks` wiring
|
||||
4. Inventory every file related to the skill: run `tools/find-skill-refs.sh {domain} {name}` to list every file across all jsc-* repositories referencing the skill name or its `/jsc-{domain}:{name}` command form (covers other SKILL.md files, the domain README's 「Skills 目錄」 section, the two marketplace.json files in `plugins/jsc` plus their synced copies in every domain repo, `tools/`, and the `jsc-hooks` wiring). Completion condition: the tool's file list is captured for step 5.
|
||||
5. For each affected file:
|
||||
1. Decide whether the file needs a fix to keep its current behavior after the deletion. If no fix is needed, **skip the rest of this loop**.
|
||||
2. Ask for fix details via the `jsc-ask:ask` decision tree (call a replacement skill? move a deterministic input/output flow to `tools/`? run the detailed flow as a sub agent? drop the feature too?). If the fix touches wiki or Gitea access, confirm it reads inherited environment variables before asking the user. Every option states its impact scope.
|
||||
3. After fixing, check the guidelines.md audit checklist. On failure, return to step 5.2.
|
||||
6. Delete the skill directory `skills/{name}/`, then sync the domain README and bump the version in all three manifests.
|
||||
6. Delete the skill directory `skills/{name}/`, then run `tools/sync-skill-manifest.sh {domain-path}` directly (no sub agent needed) to sync the domain README and bump the version in all three manifests.
|
||||
7. Deep-delete verification — this step MUST run as a sub agent: after deleting via each CLI's native plugin commands, physically inspect every installed CLI's on-disk skill and hook storage. Detect CLIs via `jsc-cli/tools/detect-clis.sh`; check Claude's `~/.claude/plugins/cache/` and hook entries in settings, plus the equivalent locations for codex / copilot / antigravity / kiro. Confirm no file or hook wiring for the deleted skill remains. Completion condition: every location checked and clean; remove any leftover by hand and recheck.
|
||||
8. Call `jsc-git:pr` to open a Push Request.
|
||||
|
||||
@@ -21,6 +21,7 @@ Single source of guidelines: [`../../references/guidelines.md`](../../references
|
||||
3. Generate the skill per guidelines.md — this step MUST run as a sub agent:
|
||||
- `skills/{name}/SKILL.md`: entirely in English (description ≤ 5 sentences with trigger conditions; body in STE100-style English)
|
||||
- Rules enforceable by hooks go to `jsc-hooks` (never scattered in this domain); standard input/output flows go to `tools/`
|
||||
- Sync the domain README's 「Skills 目錄」 section and bump the version in all three manifests
|
||||
|
||||
Then run `tools/sync-skill-manifest.sh {domain-path}` directly (no sub agent needed) to sync the domain README's 「Skills 目錄」 section and bump the version in all three manifests.
|
||||
4. Self-check every item of the guidelines.md audit checklist; fix anything that fails.
|
||||
5. Call `jsc-git:pr` to open a Push Request.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
---
|
||||
name: skill-update
|
||||
description: Update an existing skill in the jsc skill set. List all skills starting from the Gitea canonical marketplace (plugins/jsc marketplace.json), cloning any missing domain repo, then let the user pick one, ask update details via decision tree, apply the change, re-check against the guidelines checklist until it passes, then open a PR via jsc-git pr. Use for modifying a skill; not for creating (skill-new) or removing (skill-delete).
|
||||
description: Update an existing skill in the jsc skill set. List all skills from the Gitea canonical marketplace (cloning any missing domain repo) and let the user pick one, ask update details via decision tree, apply the change, then re-check against the guidelines checklist until it passes and open a PR via jsc-git pr. Use for modifying a skill; not for creating (skill-new) or removing (skill-delete).
|
||||
---
|
||||
|
||||
# skill-update — update a skill
|
||||
@@ -13,6 +13,6 @@ Single source of guidelines: [`../../references/guidelines.md`](../../references
|
||||
2. For any marketplace domain whose repo is missing from the working directory, clone it first (`gitea.sh clone-url plugins/{domain}`), then rescan. Completion condition: every domain repo exists locally.
|
||||
3. Let the user pick the skill to update.
|
||||
4. Ask for update details via the `jsc-ask:ask` decision tree (change the goal? the trigger? the flow? move rules down to a hook or a tool?). Every option states its impact scope (example: renaming breaks the existing invocation command).
|
||||
5. Update the skill — this step MUST run as a sub agent: modify SKILL.md and related files, sync the domain README's 「Skills 目錄」 section, and bump the version in all three manifests.
|
||||
5. Update the skill — the modification part MUST run as a sub agent: modify SKILL.md and related files. Then run `tools/sync-skill-manifest.sh {domain-path}` directly (no sub agent needed) to sync the domain README's 「Skills 目錄」 section and bump the version in all three manifests.
|
||||
6. Check every item of the guidelines.md audit checklist. On any failure, **return to step 4**: ask again and fix, until all items pass.
|
||||
7. Call `jsc-git:pr` to open a Push Request.
|
||||
|
||||
@@ -11,6 +11,6 @@ Single source of guidelines: [`../../references/guidelines.md`](../../references
|
||||
|
||||
1. Ask for the change details via the `jsc-ask:ask` decision tree: what rule or behavior changes, which skills and which domains are affected. Include three required checks before the affected-skill list is final: whether any deterministic input/output flow must move to `tools/`, whether any detailed flow must run as a sub agent, and whether any wiki or Gitea flow must read inherited environment variables before asking the user. Every option states its impact scope (example: changing a shared flow step touches every skill that calls it). Completion condition: the affected-skill list and the three checks are agreed with the user.
|
||||
2. Query the Gitea canonical marketplace for the authoritative domain list: run `jsc-gitea/tools/gitea.sh api GET /repos/plugins/jsc/raw/.claude-plugin/marketplace.json`. Clone any domain repo missing from the working directory (`gitea.sh clone-url plugins/{domain}`) and pull the rest. Completion condition: every domain repo exists locally and is current.
|
||||
3. Apply the change to every affected skill — this step MUST run as a sub agent, one sub agent per affected domain repo: modify SKILL.md and related files and tools, sync that domain README's 「Skills 目錄」 section, and bump the version in all three manifests. Completion condition: every affected domain repo carries the change, the README sync, and the manifest bump.
|
||||
3. Apply the change to every affected skill — the modification part MUST run as a sub agent, one sub agent per affected domain repo: modify SKILL.md and related files and tools. Then run `tools/sync-skill-manifest.sh {domain-path}` directly (no sub agent needed) for each affected domain repo to sync that domain README's 「Skills 目錄」 section and bump the version in all three manifests. Completion condition: every affected domain repo carries the change, the README sync, and the manifest bump.
|
||||
4. Check every item of the guidelines.md audit checklist for each touched skill. On any failure, **return to step 1**: ask again and fix, until all items pass.
|
||||
5. Call `jsc-git:pr` once per affected domain repo to open a Push Request. Completion condition: every affected repo has a PR URL.
|
||||
|
||||
Reference in New Issue
Block a user