From 85cfa77ed1378e678125ca32cdbde90bfc2d862f Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:36:48 +0800 Subject: [PATCH 1/5] =?UTF-8?q?docs(guidelines):=20=E6=96=B0=E5=A2=9E=20LE?= =?UTF-8?q?ARN=20=E9=A0=81=E5=9E=8B=E8=88=87=20JSC=5FWIKI=5FREPO=5FLEARN?= =?UTF-8?q?=20=E7=92=B0=E5=A2=83=E8=AE=8A=E6=95=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:在 references/guidelines.md 的 wiki 頁命名總表新增 LEARN 頁型(LEARN_CONTENTS 教訓目錄、LEARN_{HASH} 技能教訓頁),並在環境變數表新增 JSC_WIKI_REPO_LEARN,未設定時退回 JSC_WIKI_REPO。 Why:jsc-log 新增 learn 技能,需要在準則中收錄對應的 wiki 頁型與環境變數,讓各技能對頁面命名與 wiki 存取庫解析有一致依據。 How:比照既有 LOG/ERROR 頁型格式,於環境變數表與頁命名總表各補一列,維持表格欄位與退回規則一致。 Who:jsc-log(learn 技能)為此頁型的擁有者。 Co-Authored-By: Claude Fable 5 --- references/guidelines.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/references/guidelines.md b/references/guidelines.md index 0bff4f5..bec649f 100644 --- a/references/guidelines.md +++ b/references/guidelines.md @@ -65,6 +65,7 @@ | `JSC_WIKI_REPO_MAINTAIN` | `MAINTAIN_CONTENTS`、`MAINTAIN_{HASH}` 所在的 `{owner}/{repo}` | 退回 `JSC_WIKI_REPO` | | `JSC_WIKI_REPO_REPO` | `REPO_CONTENTS`、`REPO_{HASH}` 所在的 `{owner}/{repo}` | 退回 `JSC_WIKI_REPO` | | `JSC_WIKI_REPO_LOG` | `LOG_CONTENTS`、`LOG_{HASH}` 所在的 `{owner}/{repo}` | 退回 `JSC_WIKI_REPO` | +| `JSC_WIKI_REPO_LEARN` | `LEARN_CONTENTS`、`LEARN_{HASH}` 所在的 `{owner}/{repo}` | 退回 `JSC_WIKI_REPO` | | `JSC_WIKI_REPO_ERROR` | `ERROR_CONTENTS`、`ERROR_{HASH}` 所在的 `{owner}/{repo}` | 退回 `JSC_WIKI_REPO` | | `JSC_WIKI_REPO` | 未逐類設定時的共用 wiki `{owner}/{repo}` | 詢問使用者 | | `JSC_HOME` | Hook 資料目錄 | 預設 `~/.jsc` | @@ -83,6 +84,7 @@ | `MAINTAIN` | `MAINTAIN_CONTENTS` | `MAINTAIN_{HASH}` | 維護目錄、維護頁 | jsc-sdlc | | `REPO` | `REPO_CONTENTS` | `REPO_{HASH}` | 盤點目錄、存取庫盤點頁 | jsc-sdlc | | `LOG` | `LOG_CONTENTS` | `LOG_{HASH}` | 日誌目錄、工作日誌頁 | jsc-log | +| `LEARN` | `LEARN_CONTENTS` | `LEARN_{HASH}` | 教訓目錄、技能教訓頁 | jsc-log | | `ERROR` | `ERROR_CONTENTS` | `ERROR_{HASH}` | 異常目錄、異常頁 | jsc-hooks | `{HASH}` 一律為 `{owner}/{repo}`(必要時加上主題字串)的 SHA-1 前 8 碼,大寫。 From 1fdfdaf15adf1d5407e624315a4b2ab29589e8f5 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 11:36:59 +0800 Subject: [PATCH 2/5] =?UTF-8?q?chore(manifest):=20=E7=89=88=E6=9C=AC?= =?UTF-8?q?=E8=99=9F=E6=8F=90=E5=8D=87=E8=87=B3=200.0.4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit What:將 plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 三份 manifest 的 version 由 0.0.3 提升至 0.0.4。 Why:guidelines.md 新增 LEARN 頁型與 JSC_WIKI_REPO_LEARN 屬於準則內容變更,需要發布新版本讓各 CLI 更新取得。 How:同步修改三份 manifest 的 version 欄位,保持三處版本號一致。 Who:jsc-meta 技能組(manifest 維護)。 Co-Authored-By: Claude Fable 5 --- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- plugin.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 5051549..6680c2e 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-meta", - "version": "0.0.3", + "version": "0.0.4", "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index acb9818..bacee77 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-meta", - "version": "0.0.3", + "version": "0.0.4", "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 9eb42fa..1420dc7 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-meta", - "version": "0.0.3", + "version": "0.0.4", "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills/" } From 720ec6194eff99d373be8577536a60a9da90ef38 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 14:49:06 +0800 Subject: [PATCH 3/5] =?UTF-8?q?fix(marketplace):=20=E5=90=8C=E6=AD=A5=20ma?= =?UTF-8?q?rketplace.json=20=E8=87=B3=E6=AC=8A=E5=A8=81=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=B8=A6=E4=BF=AE=E6=AD=A3=E6=A8=99=E9=BB=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 什麼:為 .agents/plugins/marketplace.json 與 .claude-plugin/marketplace.json 補齊每個 plugin 條目缺少的 description 與 marketplace 層級的 description、owner 欄位,並將 jsc-meta 條目描述中的斜線「新建/更新/刪除」改為頓號「新建、更新、刪除」以符合 STE100。 為何:兩份 marketplace.json 先前落後於 plugins/jsc 的權威版本,缺少說明文字會讓使用者在瀏覽 marketplace 時看不到各外掛用途,斜線清單也違反 STE100 純敘述、不用斜線列舉的規則。 如何:以 plugins/jsc 的 marketplace.json 為基準,逐一補上缺漏的 description 與 owner 欄位,並將受影響條目的標點改為頓號。 負責範圍:jsc-meta skill-check 例行合規稽核,marketplace 中繼資料同步項目。 --- .agents/plugins/marketplace.json | 34 ++++++++++++++++++++++---------- .claude-plugin/marketplace.json | 2 +- 2 files changed, 25 insertions(+), 11 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 12df680..a9b4e66 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,75 +1,89 @@ { "name": "jsc", + "description": "jsc 跨 AI 助理技能組的統一 marketplace(claude / codex / copilot / antigravity / kiro)。", + "owner": { + "name": "JSC" + }, "plugins": [ { "name": "jsc-ask", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/ask.git" - } + }, + "description": "決策樹問詢與問詢紀錄(QUESTION_* wiki 頁)" }, { "name": "jsc-cli", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/cli.git" - } + }, + "description": "CLI 偵測、模型能力標籤與技能庫批次部署" }, { "name": "jsc-git", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/git.git" - } + }, + "description": "Commit 分組認可與 Push Request 建立" }, { "name": "jsc-gitea", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/gitea.git" - } + }, + "description": "Gitea API 工具、Wiki 讀寫與存取庫批次同步" }, { "name": "jsc-hooks", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/hooks.git" - } + }, + "description": "跨 CLI hooks:STE100 語言強制、工時計時、技能用量記錄" }, { "name": "jsc-log", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/log.git" - } + }, + "description": "工作日誌(LOG_* wiki 頁)與技能使用統計" }, { "name": "jsc-meta", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/meta.git" - } + }, + "description": "技能組自我管理:新建、更新、刪除技能與技能準則" }, { "name": "jsc-pkg", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/pkg.git" - } + }, + "description": "套件批次更新(nodejs/python/dotnet),失敗還原" }, { "name": "jsc-review", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/review.git" - } + }, + "description": "程式碼審查:Refactoring 壞味道六組 + 註解規範 + 淺模組" }, { "name": "jsc-sdlc", "source": { "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/sdlc.git" - } + }, + "description": "開發生命週期:規劃/分析/實作/維護(wiki 追蹤)" } ] } diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 28bb223..a9b4e66 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -59,7 +59,7 @@ "source": "url", "url": "https://gitea.jsc.idv.tw/plugins/meta.git" }, - "description": "技能組自我管理:新建/更新/刪除技能與技能準則" + "description": "技能組自我管理:新建、更新、刪除技能與技能準則" }, { "name": "jsc-pkg", From 4454d62e822330e2ef46db267ff3dadac545d898 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 14:49:23 +0800 Subject: [PATCH 4/5] =?UTF-8?q?feat(meta):=20=E6=8A=BD=E5=87=BA=E6=8A=80?= =?UTF-8?q?=E8=83=BD=E7=9B=AE=E9=8C=84=E5=90=8C=E6=AD=A5=E8=88=87=E5=BC=95?= =?UTF-8?q?=E7=94=A8=E6=9F=A5=E6=89=BE=E7=82=BA=E5=85=B1=E7=94=A8=E5=B7=A5?= =?UTF-8?q?=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 什麼:新增 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 五支技能共用的機械流程去重。 --- skills/skill-check/SKILL.md | 2 +- skills/skill-delete/SKILL.md | 8 +- skills/skill-new/SKILL.md | 3 +- skills/skill-update/SKILL.md | 4 +- skills/skillset-update/SKILL.md | 2 +- tools/find-skill-refs.sh | 34 +++++++ tools/sync-skill-manifest.sh | 174 ++++++++++++++++++++++++++++++++ 7 files changed, 217 insertions(+), 10 deletions(-) create mode 100755 tools/find-skill-refs.sh create mode 100755 tools/sync-skill-manifest.sh diff --git a/skills/skill-check/SKILL.md b/skills/skill-check/SKILL.md index 1d2a50f..a1f3534 100644 --- a/skills/skill-check/SKILL.md +++ b/skills/skill-check/SKILL.md @@ -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. diff --git a/skills/skill-delete/SKILL.md b/skills/skill-delete/SKILL.md index ab6a344..ed83bfe 100644 --- a/skills/skill-delete/SKILL.md +++ b/skills/skill-delete/SKILL.md @@ -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. diff --git a/skills/skill-new/SKILL.md b/skills/skill-new/SKILL.md index 257acd8..d5b0a9e 100644 --- a/skills/skill-new/SKILL.md +++ b/skills/skill-new/SKILL.md @@ -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. diff --git a/skills/skill-update/SKILL.md b/skills/skill-update/SKILL.md index aa55de1..4767768 100644 --- a/skills/skill-update/SKILL.md +++ b/skills/skill-update/SKILL.md @@ -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. diff --git a/skills/skillset-update/SKILL.md b/skills/skillset-update/SKILL.md index 8113a9f..7076242 100644 --- a/skills/skillset-update/SKILL.md +++ b/skills/skillset-update/SKILL.md @@ -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. diff --git a/tools/find-skill-refs.sh b/tools/find-skill-refs.sh new file mode 100755 index 0000000..73b59cf --- /dev/null +++ b/tools/find-skill-refs.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh +# find-skill-refs.sh — 掃描一個技能在所有 jsc domain 存取庫裡的引用,供刪除技能前盤點用。 +# +# 用法: find-skill-refs.sh +# +# 掃描樣式: +# 1. 技能名稱字面 {skill-name} +# 2. 指令形式 /jsc-{domain}:{skill-name} +# 這兩個樣式已涵蓋其他 SKILL.md 的引用、domain README 的「Skills 目錄」小節、 +# plugins/jsc 兩份 marketplace.json 與其在各 domain 存取庫的同步副本、tools/ 腳本、 +# jsc-hooks 接線等位置——只要檔案裡出現技能名稱或指令形式就會被列出。 +# +# 掃描範圍: /root/plugins 底下所有 domain 存取庫,排除 .git 目錄。 +# 輸出: 命中檔案清單(去重、排序),一行一個路徑;exit 0 一律成功,即使沒有命中。 +set -eu + +usage() { + echo 'usage: find-skill-refs.sh ' >&2 + exit 2 +} + +[ "$#" -eq 2 ] || usage +DOMAIN=$1 +SKILL=$2 + +ROOT=/root/plugins +[ -d "$ROOT" ] || { echo "找不到 plugins 根目錄: $ROOT" >&2; exit 1; } + +PATTERN1="$SKILL" +PATTERN2="/jsc-${DOMAIN}:${SKILL}" + +grep -rlE --exclude-dir=.git -e "$PATTERN1" -e "$PATTERN2" "$ROOT" 2>/dev/null | sort -u + +exit 0 diff --git a/tools/sync-skill-manifest.sh b/tools/sync-skill-manifest.sh new file mode 100755 index 0000000..95f56f5 --- /dev/null +++ b/tools/sync-skill-manifest.sh @@ -0,0 +1,174 @@ +#!/usr/bin/env sh +# sync-skill-manifest.sh — 同步 domain 的 README「Skills 目錄」區塊,並把該 domain 所有 +# plugin manifest 的 version 各 bump 一個 patch。 +# +# 用法: sync-skill-manifest.sh +# +# README 區塊標記: ... +# 每個技能一個「### `{name}`」小節。若小節已存在就保留原文——人工撰寫的 STE100 繁中說明 +# 是唯一真實來源,本工具不覆寫既有文字;只新增缺少技能的小節(暫填 SKILL.md 的 description, +# 需要人工補譯成 STE100 繁中),並移除已刪除技能的小節。 +# +# manifest: 依序找出 domain 下存在的 plugin.json、.claude-plugin/plugin.json、 +# .codex-plugin/plugin.json,version 一律 bump 成同一個新值(以第一份找到的 manifest 版本為準, +# patch 位加一;major.minor 不變)。 +# +# 輸出: 變更摘要——README 新增/移除的技能小節、各 manifest 的舊版本 -> 新版本。 +set -eu + +usage() { + echo 'usage: sync-skill-manifest.sh ' >&2 + exit 2 +} + +[ "$#" -eq 1 ] || usage +DOMAIN=$1 +DOMAIN=${DOMAIN%/} + +[ -d "$DOMAIN" ] || { echo "找不到目錄: $DOMAIN" >&2; exit 1; } +[ -d "$DOMAIN/skills" ] || { echo "找不到 skills/: $DOMAIN/skills" >&2; exit 1; } + +README="$DOMAIN/README.md" +[ -f "$README" ] || { echo "找不到 README.md: $README" >&2; exit 1; } + +START='' +END='' + +grep -qF "$START" "$README" && grep -qF "$END" "$README" || { + echo "README.md 缺少 $START / $END 標記: $README" >&2 + exit 1 +} + +TAB="$(printf '\t')" +WORKDIR=$(mktemp -d) +trap 'rm -rf "$WORKDIR"' EXIT + +# ---- 1. 收集目前的技能清單 (namedescription),寫入檔案以避免 shell 變數處理多行字串 ---- +SKILLS_TSV="$WORKDIR/skills.tsv" +: > "$SKILLS_TSV" +for f in "$DOMAIN"/skills/*/SKILL.md; do + [ -f "$f" ] || continue + name=$(awk 'BEGIN{f=0} /^---$/{f++; next} f==1 && /^name:/{sub(/^name: */,""); print; exit}' "$f") + desc=$(awk 'BEGIN{f=0} /^---$/{f++; next} f==1 && /^description:/{sub(/^description: */,""); print; exit}' "$f") + [ -n "$name" ] || continue + printf '%s\t%s\n' "$name" "$desc" >> "$SKILLS_TSV" +done + +[ -s "$SKILLS_TSV" ] || { echo "找不到任何技能: $DOMAIN/skills/*/SKILL.md" >&2; exit 1; } + +NAMES_ONLY="$WORKDIR/names.txt" +cut -f1 "$SKILLS_TSV" > "$NAMES_ONLY" + +# ---- 2. 取出既有 README 區塊 ---- +OLD_BLOCK="$WORKDIR/old-block.md" +awk -v s="$START" -v e="$END" 'index($0,s){f=1;next} index($0,e){f=0} f' "$README" > "$OLD_BLOCK" + +OLD_NAMES="$WORKDIR/old-names.txt" +awk -F'`' '/^### `/{print $2}' "$OLD_BLOCK" > "$OLD_NAMES" + +# ---- 3. 逐技能組出新區塊內容 ---- +# 順序規則:保留 README 既有小節的原順序(人工排過的邏輯順序是唯一真實來源), +# 只在既有順序之後補上新增的技能;不因掃描順序(字母序)打亂既有排列。 +NEW_BLOCK="$WORKDIR/new-block.md" +: > "$NEW_BLOCK" +ADDED_FILE="$WORKDIR/added.txt" +: > "$ADDED_FILE" + +emit_skill() { + name="$1" + desc=$(awk -F"$TAB" -v n="$name" '$1==n{print $2; exit}' "$SKILLS_TSV") + BODY="$WORKDIR/body.md" + awk -v n="$name" ' + BEGIN{hdr="### `" n "`"; found=0} + $0==hdr {found=1; print; next} + found && /^### `/{exit} + found{print} + ' "$OLD_BLOCK" > "$BODY" + + if [ -s "$BODY" ]; then + cat "$BODY" >> "$NEW_BLOCK" + else + printf '### `%s`\n\n%s\n' "$name" "$desc" >> "$NEW_BLOCK" + echo "$name" >> "$ADDED_FILE" + fi + printf '\n' >> "$NEW_BLOCK" +} + +# 3a. 先照舊順序輸出仍存在的技能 +while read -r name; do + [ -n "$name" ] || continue + grep -qxF "$name" "$NAMES_ONLY" || continue + emit_skill "$name" +done < "$OLD_NAMES" + +# 3b. 再補上舊區塊沒有的新技能(依掃描順序) +while IFS="$TAB" read -r name desc; do + [ -n "$name" ] || continue + grep -qxF "$name" "$OLD_NAMES" && continue + emit_skill "$name" +done < "$SKILLS_TSV" + +# 擠掉連續空白行,只留單一空白行 +SQUEEZED="$WORKDIR/squeezed.md" +awk 'BEGIN{blank=0} /^[ \t]*$/{blank++; if(blank>1) next} !/^[ \t]*$/{blank=0} {print}' "$NEW_BLOCK" > "$SQUEEZED" + +REMOVED_FILE="$WORKDIR/removed.txt" +: > "$REMOVED_FILE" +while read -r n; do + [ -n "$n" ] || continue + if ! grep -qxF "$n" "$NAMES_ONLY"; then + echo "$n" >> "$REMOVED_FILE" + fi +done < "$OLD_NAMES" + +# ---- 4. 寫回 README(區塊前後各留一行空白,比照既有格式) ---- +NEW_README="$WORKDIR/README.md" +awk -v s="$START" -v e="$END" -v blockfile="$SQUEEZED" ' + index($0,s){ + print + print "" + while ((getline line < blockfile) > 0) print line + f=1 + next + } + index($0,e){f=0} + !f{print} +' "$README" > "$NEW_README" +mv "$NEW_README" "$README" + +# ---- 5. bump manifest version(三份一致) ---- +MANIFESTS="" +for m in "$DOMAIN/plugin.json" "$DOMAIN/.claude-plugin/plugin.json" "$DOMAIN/.codex-plugin/plugin.json"; do + [ -f "$m" ] && MANIFESTS="$MANIFESTS $m" +done +[ -n "$MANIFESTS" ] || { echo "找不到任何 plugin manifest: $DOMAIN" >&2; exit 1; } + +first="" +for m in $MANIFESTS; do first=$m; break; done +old=$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$first" | head -1) +[ -n "$old" ] || { echo "找不到 version 欄位: $first" >&2; exit 1; } + +major=$(printf '%s' "$old" | cut -d. -f1) +minor=$(printf '%s' "$old" | cut -d. -f2) +patch=$(printf '%s' "$old" | cut -d. -f3) +new="$major.$minor.$((patch + 1))" + +echo "== manifest version ==" +for m in $MANIFESTS; do + cur=$(sed -n 's/.*"version": *"\([^"]*\)".*/\1/p' "$m" | head -1) + sed -i.bak "s/\"version\": *\"$cur\"/\"version\": \"$new\"/" "$m" + rm -f "$m.bak" + printf '%s: %s -> %s\n' "$m" "$cur" "$new" +done + +echo "== README Skills 目錄 (${README}) ==" +if [ -s "$ADDED_FILE" ]; then + printf '新增小節:'; tr '\n' ' ' < "$ADDED_FILE"; printf '\n' +else + echo '新增小節: 無' +fi +if [ -s "$REMOVED_FILE" ]; then + printf '移除小節:'; tr '\n' ' ' < "$REMOVED_FILE"; printf '\n' +else + echo '移除小節: 無' +fi From ef974b4ef50e81cb1988f324938a055b66d7614f Mon Sep 17 00:00:00 2001 From: Jeffery Date: Mon, 24 Aug 2026 14:49:37 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix(meta):=20=E4=BF=AE=E6=AD=A3=E5=A4=96?= =?UTF-8?q?=E6=8E=9B=E6=8F=8F=E8=BF=B0=E6=A8=99=E9=BB=9E=E4=B8=A6=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E7=89=88=E6=9C=AC=E8=99=9F=E8=87=B3=200.0.5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 什麼:將 plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json 三份 manifest 中 jsc-meta 自身的 description 由斜線「新建/更新/刪除」改為頓號「新建、更新、刪除」,並將 version 由 0.0.4 一併提升至 0.0.5。 為何:斜線列舉違反 STE100 純敘述、不用斜線分隔清單的規則,描述文字修正後三份 manifest 需要對應 bump 版本以標示這次的合規性修正。 如何:三份 manifest 同步套用相同的標點修正與版本號更新,確保 claude、codex 兩種外掛載入路徑與根目錄 plugin.json 三者版本與描述一致。 負責範圍:jsc-meta 外掛自身的合規性修正與版本標示;skill-delete、skill-update 兩支 SKILL.md 的 description 精簡改動已隨其步驟修改一併納入 Group B 的提交。 --- .claude-plugin/plugin.json | 4 ++-- .codex-plugin/plugin.json | 4 ++-- plugin.json | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index 6680c2e..7f816a7 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "jsc-meta", - "version": "0.0.4", - "description": "技能組自我管理:新建/更新/刪除技能與技能準則", + "version": "0.0.5", + "description": "技能組自我管理:新建、更新、刪除技能與技能準則", "skills": "./skills", "author": { "name": "JSC" diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index bacee77..22b08e1 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-meta", - "version": "0.0.4", - "description": "技能組自我管理:新建/更新/刪除技能與技能準則", + "version": "0.0.5", + "description": "技能組自我管理:新建、更新、刪除技能與技能準則", "skills": "./skills" } diff --git a/plugin.json b/plugin.json index 1420dc7..1c7d743 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-meta", - "version": "0.0.4", - "description": "技能組自我管理:新建/更新/刪除技能與技能準則", + "version": "0.0.5", + "description": "技能組自我管理:新建、更新、刪除技能與技能準則", "skills": "./skills/" }