diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json deleted file mode 100644 index 2c2dafc..0000000 --- a/.agents/plugins/marketplace.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "template", - "plugins": [ - { - "name": "jsc-template", - "source": { - "source": "url", - "url": "https://gitea.jsc.idv.tw/plugins/template.git" - } - } - ] -} diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json deleted file mode 100644 index e3d2436..0000000 --- a/.claude-plugin/marketplace.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "template", - "description": "JSC 跨 AI 助理共用 skills 的 Claude Code marketplace。", - "owner": { - "name": "JSC" - }, - "plugins": [ - { - "name": "jsc-template", - "source": "./", - "description": "JSC 共用 skills(跨 AI 助理)" - } - ] -} diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index a5c2dd3..3125599 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,12 +1,17 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板(Claude Code / Codex / Antigravity / OpenCode)。所有 skills 以 SKILL.md 為共通標準,於 Claude Code 以 /jsc-template: 前綴呼叫。", + "name": "jsc-meta", + "version": "0.0.1", + "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills", "author": { "name": "JSC" }, - "homepage": "https://gitea.jsc.idv.tw/plugins/template", - "repository": "https://gitea.jsc.idv.tw/plugins/template.git", - "keywords": ["template", "skills", "cross-tool", "jsc"] + "homepage": "https://gitea.jsc.idv.tw/plugins/meta", + "repository": "https://gitea.jsc.idv.tw/plugins/meta.git", + "keywords": [ + "jsc", + "meta", + "skills", + "cross-tool" + ] } diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 71a3c32..ed5b519 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板。所有 skills 以 SKILL.md 為共通標準。", + "name": "jsc-meta", + "version": "0.0.1", + "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills" } diff --git a/AGENTS.md b/AGENTS.md index a86a1f1..9a3723c 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,15 +1,15 @@ -# jsc-template — 共用 Skills(跨 AI 助理) +# jsc-meta — 給 AI 助理的指引 -本 repo 是一組以 **Agent Skills(`SKILL.md`)** 標準撰寫的共用 skills,可同時被 Claude Code、Codex、Antigravity、OpenCode 使用。 +本 repo 是 jsc 技能組的 `meta` domain(技能組自我管理:新建/更新/刪除技能與技能準則),可同時被 Claude Code / Codex / Copilot / Antigravity / Kiro 使用。 -## 給 AI 助理的指引 +## 規則 -- 所有可用的 skills 位於本 repo 的 `skills//SKILL.md`。 -- 在處理任務前,先比對使用者需求與各 skill `SKILL.md` frontmatter 的 `description`,若相符請載入並依其步驟執行。 -- **呼叫慣例**:在 Claude Code 與 Antigravity 中,這些 skill 以 `/jsc-template:` 呼叫;Codex 以 `$`、OpenCode 由模型依描述自動觸發 — 兩者沒有 `/jsc-template:` 前綴,不需強制加。 -- 完整清單與每個 skill 的用途,請見 `README.md` 的「Skills 目錄」。 +1. 所有交談與輸出內容基於 STE100 使用繁體中文:短句、一句一指令、主動語態、術語一致、UTF-8 無亂碼。 +2. 技能位於 `skills/{name}/SKILL.md`;處理任務前先比對需求與各技能的 `description`,相符就載入並依其步驟執行。 +3. 技能準則的唯一來源:`plugins/meta` 存取庫的 `references/guidelines.md`。 +4. 所有 hook 只放在 `jsc-hooks`;gitea 操作一律經由 `jsc-gitea` 的 `tools/gitea.sh`;問使用者一律依 `jsc-ask:ask` 的決策樹規則。 +5. 主 agent 不需要處理細節的流程,一律建立 sub agent 處理。 -## 慣例 +## 呼叫慣例 -- 新增 skill 一律放在 `skills//`,且 `` 使用小寫與連字號。 -- `description` 要寫清楚觸發條件(何時用、何時不用),這是跨助理自動載入的唯一依據。 +Claude Code / Antigravity:`/jsc-meta:{name}`;Codex:`$name`;Copilot / Kiro / OpenCode:描述需求自動觸發。 diff --git a/README.md b/README.md index 6c6669e..7158c5b 100644 --- a/README.md +++ b/README.md @@ -1,228 +1,48 @@ -# jsc-template — 跨 AI 助理 Plugin 模板 +# jsc-meta — 技能組自我管理 -一個可同時被 **Claude Code、Codex、Antigravity、OpenCode、GitHub Copilot** 安裝的 plugin 模板。 -核心是以 [Agent Skills(`SKILL.md`)](https://agentskills.io) 標準撰寫的共用 skills(唯一真實來源放在 `skills/`), -搭配各助理各自的 plugin manifest,讓**同一個 repo** 可用各家**原生 plugin CLI** 安裝。 -在 Claude Code 與 Antigravity 中,skill 以 **`/jsc-template:` 前綴**呼叫(例如 `/jsc-template:hello`)。 +jsc 技能組的 meta domain:新建、更新、刪除技能的流程,以及**全技能組的準則單一來源** `references/guidelines.md`(命名、description 規則、hook / 工具 / sub agent 下放、語言、環境變數、wiki 頁命名總表、審核檢查清單)。 ---- +## 安裝 / 更新 / 移除 -## 前綴與呼叫方式 +Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/jsc.git),安裝 token 為 `jsc-meta@jsc`。每個指令一行: -| 助理 | 安裝方式 | 呼叫 | `/jsc-template:` 前綴 | +| CLI | 安裝 | 更新 | 移除 | | --- | --- | --- | --- | -| Claude Code | `claude plugin`(marketplace) | `/jsc-template:` 或自動觸發 | ✅ | -| Codex | `codex plugin`(marketplace) | `$` 或 `/skills` 選單 | ❌(用 `$name`) | -| Antigravity | `agy plugin install` | `/jsc-template:` 或自動觸發 | ✅ | -| OpenCode | skills 目錄(複製/clone) | 描述需求自動觸發 | ❌(依名稱) | -| GitHub Copilot CLI | `copilot plugin`(marketplace) | 自然語言或 plugin skills | ❌(無 `/jsc-template:` 前綴) | +| claude | `claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && claude plugin install jsc-meta@jsc` | `claude plugin marketplace update jsc && claude plugin update jsc-meta@jsc` | `claude plugin uninstall jsc-meta@jsc` | +| codex | `codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && codex plugin add jsc-meta@jsc` | `codex plugin marketplace upgrade jsc` | `codex plugin remove jsc-meta@jsc` | +| copilot | `copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && copilot plugin install jsc-meta@jsc` | `copilot plugin marketplace update jsc && copilot plugin update jsc-meta@jsc` | `copilot plugin uninstall jsc-meta@jsc` | +| antigravity | `git clone https://gitea.jsc.idv.tw/plugins/meta.git ~/plugins/meta && agy plugin install ~/plugins/meta` | `git -C ~/plugins/meta pull && agy plugin uninstall jsc-meta && agy plugin install ~/plugins/meta` | `agy plugin uninstall jsc-meta` | +| kiro | `kiro-cli plugin marketplace add https://gitea.jsc.idv.tw/plugins/jsc.git && kiro-cli plugin install jsc-meta@jsc` | `kiro-cli plugin marketplace update jsc && kiro-cli plugin update jsc-meta@jsc` | `kiro-cli plugin uninstall jsc-meta@jsc` | -> Codex 不支援自訂前綴(skill 以 `$name` 呼叫);OpenCode 由模型依描述自動呼叫;Copilot CLI 透過原生 plugin 安裝後以自然語言或 plugin skills 使用。三者皆**不強制**前綴。 - ---- - -## 目錄結構 - -同一個 repo 同時帶四種 manifest,彼此以路徑隔離、互不干擾;各助理都讀同一份 `skills/`。 - -``` -template/ -├── .claude-plugin/ -│ ├── plugin.json # Claude 外掛定義(name: "jsc-template") -│ └── marketplace.json # Claude marketplace(name: "template",source 指向本 repo) -├── .codex-plugin/ -│ └── plugin.json # Codex 外掛定義(name: "jsc-template",skills: "./skills") -├── .agents/plugins/ -│ └── marketplace.json # Codex marketplace(name: "template",url source 指向本 repo) -├── plugin.json # Antigravity 外掛定義(name: "jsc-template",skills: "./skills/") -├── skills/ # ★ 唯一真實來源:所有 skills -│ └── hello/SKILL.md -├── AGENTS.md # 跨助理共用指引 -└── README.md -``` - ---- - -## 安裝 / 更新 / 移除(各助理) - -> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/template.git` -> -> **Claude / Codex 從 git URL 安裝(會 clone 遠端),請先把本 repo `push` 到 gitea。** -> **Antigravity 的 `agy plugin install ` 目前只支援 github.com**;gitea 請改用「clone + 本地路徑」(見 Antigravity 節)。 -> 本機/離線:Claude 可用本地路徑加 marketplace;Antigravity 用本地路徑安裝。 - -> **⚠ 從 0.0.1 升上來的人請先移除再安裝。** 0.0.2 起 marketplace 名由 `jsc-plugins` 改為 `template` -> (舊名與 `jsc-persona` 的 marketplace 撞名)。各助理以 `@` 當安裝識別鍵, -> 改名後是兩筆獨立條目,**不能用 update 遷移**: -> -> ```bash -> claude plugin uninstall jsc-template@jsc-plugins -> claude plugin marketplace remove jsc-plugins # 若你沒有裝 jsc-persona 才移除,它也用這個名字 -> claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -> claude plugin install jsc-template@template -> ``` -> -> 移除後記得清掉 `~/.claude/settings.json` 裡 `enabledPlugins` 的舊鍵 `jsc-template@jsc-plugins`, -> 並重開工作階段。Codex/Copilot 同理(`remove`/`uninstall` 後重新 `add`+`install`)。 - -### Claude Code - -```bash -# 安裝 -claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -claude plugin install jsc-template@template - -# 更新 -claude plugin marketplace update template -claude plugin update jsc-template@template - -# 移除 -claude plugin uninstall jsc-template@template -claude plugin marketplace remove template -``` - -- 工作階段內 slash 版(等價):把 `claude plugin` 換成 `/plugin`。 -- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\template`(本地路徑)後再 install。 -- **呼叫**:`/jsc-template:`(例 `/jsc-template:hello`)。 - -### Codex - -```bash -# 安裝 -codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -codex plugin add jsc-template@template - -# 更新(重新抓取 marketplace 的 git 快照) -codex plugin marketplace upgrade template - -# 移除 -codex plugin remove jsc-template@template -codex plugin marketplace remove template -``` - -- 安裝 token `jsc-template@template` = plugin 名(`.codex-plugin/plugin.json` 的 `name`)@ marketplace 名(`.agents/plugins/marketplace.json` 的 `name`)。 -- 本 repo 的 Codex marketplace 以 `url` 來源指向自己,故 Codex **一律從 gitea 安裝**(需先 push);安裝後重啟 Codex。 -- **呼叫**:`$`(例 `$hello`),或用 `/skills` 選單。 - -### Antigravity(`agy`) - -> `agy plugin install ` 目前**只支援 github.com**;gitea 等自架 git 不支援 URL 安裝,請先 `git clone` 再用**本地路徑**安裝。 - -```bash -# 安裝:clone 後用本地路徑 -git clone https://gitea.jsc.idv.tw/plugins/template.git ~/plugins/template -agy plugin install ~/plugins/template - -# 更新(agy 無 update 子指令 → git pull 後重裝) -git -C ~/plugins/template pull -agy plugin uninstall jsc-template -agy plugin install ~/plugins/template - -# 移除 -agy plugin uninstall jsc-template -``` - -- 若把 skills 放到 GitHub,則可直接 `agy plugin install https://github.com//`。 -- 其他:`agy plugin list`、`agy plugin enable jsc-template` / `disable jsc-template`、`agy plugin validate `。安裝後重啟工作階段。 -- **呼叫**:`/jsc-template:`(例 `/jsc-template:hello`)或依描述自動觸發。 - -### OpenCode - -OpenCode 的「plugin」是 TypeScript/npm 套件,不適用於 skill 包;skills 改用**目錄安裝**。 -OpenCode 會讀 `~/.config/opencode/skills/`(也會讀 `~/.claude/skills/`、`~/.agents/skills/`)。 - -```bash -# 安裝 -git clone https://gitea.jsc.idv.tw/plugins/template.git ~/plugins/template -mkdir -p ~/.config/opencode/skills -cp -r ~/plugins/template/skills/* ~/.config/opencode/skills/ - -# 更新 -git -C ~/plugins/template pull -cp -r ~/plugins/template/skills/* ~/.config/opencode/skills/ - -# 移除 -rm -rf ~/.config/opencode/skills/hello -``` - -> **Windows PowerShell**:`cp -r A B` → `Copy-Item A B -Recurse -Force`、`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。 - -- **呼叫**:直接描述需求,模型會依 skill 描述自動透過 skill 工具呼叫。 - -### GitHub Copilot CLI - -Copilot CLI 支援與 Claude Code 類似的原生 plugin / marketplace 指令,可直接從 marketplace 安裝、更新與移除本 plugin。 - -```bash -# 安裝 -copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/template.git -copilot plugin install jsc-template@template - -# 更新 -copilot plugin marketplace update template -copilot plugin update jsc-template@template - -# 移除 -copilot plugin uninstall jsc-template@template -copilot plugin marketplace remove template -``` - -- 安裝 token `jsc-template@template` = plugin 名(plugin manifest 的 `name`)@ marketplace 名。 -- `copilot plugin marketplace add` 支援 GitHub `owner/repo`、git URL 與本地路徑;Gitea repo 可用上方 HTTPS URL。 -- **呼叫**:在 Copilot CLI 中用自然語言描述需求,例如 `copilot -i "跑 hello 確認 plugin 裝好了"`。 - ---- - -## 用 CLI 直接執行 skill(headless / 一次性) - -安裝好之後,不必進互動介面,一行指令就能叫某個 skill 跑完並印出結果: - -| 助理 | headless 指令 | 執行 `hello` skill | -| --- | --- | --- | -| Claude Code | `claude -p ""` | `claude -p "/jsc-template:hello"` | -| Codex | `codex exec ""` | `codex exec '$hello'` | -| Antigravity | `agy -p ""` | `agy -p "/jsc-template:hello"` | -| OpenCode | `opencode run ""` | `opencode run "用 hello skill 打個招呼"` | -| GitHub Copilot CLI | `copilot -p ""` | `copilot -p "用 hello skill 打個招呼"` | - -- Claude / Antigravity 支援 `/jsc-template:` 前綴,直接 `-p "/jsc-template:"` 即可。 -- Codex 以 `$` 觸發;在 shell 請用**單引號**避免 `$` 被展開:`codex exec '$hello'`。 -- OpenCode 與 Copilot 沒有前綴,用自然語言描述需求;Copilot CLI 會讀取已安裝 plugin 提供的 skills。 -- 帶引數就接在後面,例如 `claude -p "/jsc-template:hello 參數"`、`codex exec '$hello 參數'`。 - ---- +> antigravity 不支援 gitea URL 安裝,改用本地 clone 路徑。批次操作五個 CLI:使用 `/jsc-cli:deploy`。 ## Skills 目錄 -> 此區塊列出本 plugin 內含的所有 skills(名稱/描述/使用方法)。 -> 新增或修改 skill 後,請同步手動更新標記之間的內容。 +呼叫方式:Claude / Antigravity `/jsc-meta:{name}`;Codex `${name}`;Copilot / Kiro 描述需求自動觸發。 -### `hello` +### `skill-new` -範例 skill,用來驗證 jsc plugin 是否安裝成功,也是新增 skill 的範本。當使用者輸入 hello、想測試 plugin、或想看 skill 模板長什麼樣子時觸發;回覆一句問候並簡述此 plugin 的用途。 +新建技能:決策樹問細節(目標、觸發、輸入輸出、domain)→ 缺 domain 時依 template 結構建立新存取庫 → sub agent 依準則產生技能 → 審核清單自檢 → PR。 -- **Claude Code / Antigravity**:`/jsc-template:hello` -- **Codex**:`$hello`,或用 `/skills` 選單 -- **OpenCode / GitHub Copilot CLI**:描述需求自動觸發 +### `skill-update` + +更新技能:列出全部技能 → 使用者選擇 → 決策樹問更新細節 → 更新後依審核檢查清單逐項檢查,不符就回到詢問 → PR。 + +### `skill-delete` + +刪除技能:列出全部技能 → 使用者選擇 → sub agent 盤點關聯檔案 → 逐檔判斷是否需修正以維持功能(需要就決策樹問修正細節並依準則檢查)→ 刪除 → PR。 ---- +## 參考 -## 新增一個 skill +| 檔案 | 用途 | +| --- | --- | +| `references/guidelines.md` | 技能準則唯一來源,所有 domain 的 AGENTS.md 都指向這裡 | -1. 複製範本:`cp -r skills/hello skills/` -2. 編輯 `skills//SKILL.md` 的 frontmatter: - - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這就是 Claude Code / Antigravity 的 `/jsc-template:`**。 - - `description`:第三人稱,寫清楚「何時用、何時不用」與觸發關鍵字 — 這是各助理自動載入的唯一依據。 -3. 在內文寫下 skill 的具體步驟。 -4. 手動把這個 skill 補進上方「Skills 目錄」區塊。 -5. **bump 版本並 push**:各助理都以 git 內容/版本判斷更新,請把 `.claude-plugin/plugin.json`、`.codex-plugin/plugin.json`、`plugin.json` 三個 manifest 的 `version` 一起 bump,commit 後 push 到 gitea。 -6. 讓各助理更新: - - Claude:`claude plugin update jsc-template@template` - - Codex:`codex plugin marketplace upgrade template` - - Antigravity:`git -C ~/jsc-plugin pull && agy plugin uninstall jsc-template && agy plugin install ~/jsc-plugin` - - OpenCode:`git pull` 後重新複製 `skills/` - - Copilot:`copilot plugin marketplace update template && copilot plugin update jsc-template@template` +## 相關 domain + +- [`jsc-ask`](https://gitea.jsc.idv.tw/plugins/ask):決策樹問詢 +- [`jsc-git`](https://gitea.jsc.idv.tw/plugins/git):完成後的 Push Request diff --git a/plugin.json b/plugin.json index 4873395..755a73e 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { - "name": "jsc-template", - "version": "0.0.3", - "description": "JSC 跨 AI 助理共用 plugin 模板。所有 skills 以 SKILL.md 為共通標準;於 Antigravity 以 /jsc-template: 前綴呼叫。", + "name": "jsc-meta", + "version": "0.0.1", + "description": "技能組自我管理:新建/更新/刪除技能與技能準則", "skills": "./skills/" -} \ No newline at end of file +} diff --git a/references/guidelines.md b/references/guidelines.md new file mode 100644 index 0000000..5463754 --- /dev/null +++ b/references/guidelines.md @@ -0,0 +1,93 @@ +# JSC 技能準則 + +本文件是 jsc 技能組的唯一準則來源。`skill-new`、`skill-update`、`skill-delete` 與技能審核都必須依此檢查。 + +## 命名 + +1. Plugin 名稱:`jsc-{domain}`,domain 用一個簡短的英文代表詞(例:`ask`、`sdlc`、`gitea`)。 +2. Marketplace 統一為 `jsc`,唯一承載存取庫為 `https://gitea.jsc.idv.tw/plugins/jsc.git`;安裝 token 一律 `jsc-{domain}@jsc`。各 domain 存取庫**不放** marketplace 檔。 +3. Skill 名稱:小寫、數字、連字號(`-`),最長 64 字元。名稱即指令(`/jsc-{domain}:{name}`)。 +4. 每個 domain 是一個獨立存取庫 `https://gitea.jsc.idv.tw/plugins/{domain}.git`。新 domain 必須依 `https://gitea.jsc.idv.tw/plugins/template` 的結構建立新存取庫(三份 plugin manifest、`skills/`、`README.md`、`AGENTS.md`),並把 plugin 條目加入 `plugins/jsc` 的 `.claude-plugin/marketplace.json` 與 `.agents/plugins/marketplace.json`(URL 來源指向新存取庫)。 +5. Git 分支名**只允許 ASCII**(`a-z0-9` 與 `/`、`-`);中文需求或標題先翻譯成英文短語再 slug 化。 +6. Manifest 版本號從 `0.0.1` 開始,三份 manifest 同步 bump。 + +## Description 規則 + +1. frontmatter 的 `description` 為一行英文,不超過 5 句或 5 個步驟。 +2. 使用專有名詞、概念或指引詞(例:WBS、TDD、decision tree、STE100)取代解釋。 +3. 必須寫清楚觸發時機(何時用、何時不用),這是各 CLI 自動載入的唯一依據。 +4. 複雜流程透過**組合其他技能**實現,不在單一 description 裡塞流程。 + +## 強制力層級 + +1. 規則的實現優先順序:**hook > prompt**。凡是可以由 hook 強制的規則(語言、計時、統計),一律下放 hook,SKILL.md 只保留 hook 無法涵蓋的指引。 +2. 有標準輸入與輸出的流程一律下放到 `tools/` 腳本,SKILL.md 只描述何時呼叫與參數。 +3. 主 agent 不需要處理細節的流程,SKILL.md 必須明確要求建立 sub agent 處理(關鍵字:「必須以 sub agent 執行」)。 + +## Hook 規則 + +1. 所有 hook 專屬存放於 `jsc-hooks`,**不可散落在其他 domain**。 +2. Hook 腳本實作優先順序:**shell > nodejs > python**。 +3. Hook 必須適用於 claude / codex / copilot / antigravity / kiro 五種 CLI: + - 腳本同時支援 stdin JSON(Claude 格式)與環境變數輸入,缺欄位時安靜降級(exit 0)。 + - 各 CLI 的接線方式由 `jsc-hooks:hooks-install` 技能處理。 + +## 技能設計 + +1. 每個技能必須有單一明確目標,不可與既有技能重複;能複用就複用(呼叫其他技能或工具)。 +2. 需要操作 gitea 且輸入輸出明確的技能,一律透過 `jsc-gitea/tools/gitea.sh`(curl + `GITEA_TOKEN`)或 `tea` CLI,不可自行拼 API 呼叫。 +3. 需要問使用者的技能,一律透過 `jsc-ask:ask` 的決策樹規則:選項式提問、每個選項標明影響範圍、問到沒有疑慮為止、已有紀錄的答案不再問。 + +## 語言 + +1. 所有交談與輸出內容基於 STE100(簡化技術中文)使用繁體中文:短句、一句一指令、主動語態、術語一致、UTF-8 無亂碼。 +2. SKILL.md 的 `description` 為英文(見上),內文為繁體中文。 + +## 撰寫規範(SKILL.md 內文) + +1. 每個步驟以**可檢核的完成條件**結尾(例:「成功標上工作證才可以進入下一步」),不用模糊語(「理解後」「適當地」)。 +2. 用**正向敘述**寫目標行為;禁止句只留給無法正向表達的硬性護欄。 +3. 每個意義只有**單一真實來源**:環境可查的資訊(指令、設定、目錄結構)不要抄進技能,只寫環境查不到的慣例、原因與陷阱。 +4. **漸進揭露**:所有分支都需要的內容留在 SKILL.md;只有部分分支需要的參考資料下放 `references/`,以一行指引指過去。 +5. 善用**引導詞**(WBS、CPM、TDD、seam、STE100 等既有概念)取代整段解釋。 + +## 環境變數 + +| 變數 | 用途 | 未設定時 | +| --- | --- | --- | +| `GITEA_HOST` | Gitea 站台(例:`https://gitea.jsc.idv.tw`) | 詢問使用者 | +| `GITEA_TOKEN` | Gitea API token | 詢問使用者 | +| `JSC_WIKI_REPO_{TYPE}` | 各類型 wiki 頁所在的 `{owner}/{repo}`;TYPE = `QUESTION` / `PLAN` / `ANALYZE` / `MAINTAIN` / `REPO` / `LOG` | 退回 `JSC_WIKI_REPO` | +| `JSC_WIKI_REPO` | 未逐類設定時的共用 wiki `{owner}/{repo}` | 詢問使用者 | +| `JSC_HOME` | Hook 資料目錄 | 預設 `~/.jsc` | + +## Wiki 頁命名總表 + +| 頁面 | 用途 | 擁有者 | +| --- | --- | --- | +| `QUESTION_CONTENTS` | 問詢目錄(存取庫名稱 → 問詢紀錄) | jsc-ask | +| `QUESTION_{HASH}` | 單一存取庫的問詢紀錄 | jsc-ask | +| `PLAN_CONTENTS` | 計畫目錄 | jsc-sdlc | +| `PLAN_{yyyyMMdd}_{HHmmss}_{HASH}` | 計畫頁 | jsc-sdlc | +| `ANALYZE_CONTENTS` | 分析目錄 | jsc-sdlc | +| `ANALYZE_{yyyyMMdd}_{HHmmss}_{HASH}` | 分析頁 | jsc-sdlc | +| `MAINTAIN_CONTENTS` | 維護目錄 | jsc-sdlc | +| `REPO_CONTENTS` | 盤點目錄 | jsc-sdlc | +| `REPO_{HASH}` | 存取庫盤點頁(功能與端點 + commit sha) | jsc-sdlc | +| `LOG_CONTENTS` | 日誌目錄 | jsc-log | +| `LOG_{yyyyMM}_W{週數}` | 工作日誌(週數基於週五日期計算) | jsc-log | + +`{HASH}` 一律為 `{owner}/{repo}`(必要時加上主題字串)的 SHA-1 前 8 碼、大寫。 + +## 審核檢查清單 + +新增或更新技能後逐項檢查,任一不符就修正: + +- [ ] 名稱符合命名規則,且與既有技能目標不重複 +- [ ] description 為英文、≤ 5 句或 5 步驟、含觸發時機 +- [ ] 可 hook 的規則已下放 jsc-hooks;可工具化的流程已下放 tools/ +- [ ] 細節流程已標示「必須以 sub agent 執行」 +- [ ] gitea 操作透過 gitea.sh 或 tea +- [ ] 問詢透過 jsc-ask 決策樹規則 +- [ ] 內文為 STE100 繁體中文、UTF-8 無亂碼 +- [ ] 已同步更新該 domain 的 README「Skills 目錄」與三份 manifest 的 version diff --git a/skills/hello/SKILL.md b/skills/hello/SKILL.md deleted file mode 100644 index c5be22f..0000000 --- a/skills/hello/SKILL.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -name: hello -description: 範例 skill,用來驗證 jsc plugin 是否安裝成功,也是新增 skill 的範本。當使用者輸入 hello、想測試 plugin、或想看 skill 模板長什麼樣子時觸發;回覆一句問候並簡述此 plugin 的用途。 ---- - -# hello(範例 skill) - -這是 `jsc-template` plugin 的範例 skill。它有兩個用途: - -1. **驗證安裝** — 跨各家 AI 助理確認 skill 已被正確載入。 -2. **作為範本** — 複製這個資料夾即可新增一個新的 skill。 - -## 呼叫方式 - -| 助理 | 呼叫方式 | -| --- | --- | -| Claude Code | `/jsc-template:hello` | -| Antigravity | `/jsc-template:hello`,或描述需求自動觸發 | -| Codex | 在提示詞輸入 `$hello`,或用 `/skills` 選單 | -| OpenCode | 直接描述需求,模型會透過 skill 工具自動呼叫 | -| GitHub Copilot CLI | 直接描述需求,Copilot 會讀取已安裝 plugin 的 skills | - -## 行為 - -當這個 skill 被觸發時: - -1. 回覆「Hello from **jsc** 👋」。 -2. 用一句話說明 `jsc-template` 是一個跨 AI 助理的共用 skill 集合。 -3. 提示使用者可以在 README 的「Skills 目錄」查看所有可用的 skills。 - -## 如何以此為範本新增 skill - -1. 複製 `skills/hello/` 為 `skills//`。 -2. 修改 `SKILL.md` 的 frontmatter: - - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這個名稱會成為 Claude Code / Antigravity 的 `/jsc-template:` 指令**。 - - `description`:第三人稱,寫清楚「什麼時候該用、什麼時候不該用」與觸發關鍵字 — 各家助理靠這段文字決定是否自動載入。 -3. 在內文寫下 skill 的具體步驟。 -4. 手動把新 skill 補進 README 的「Skills 目錄」區塊。 diff --git a/skills/skill-delete/SKILL.md b/skills/skill-delete/SKILL.md new file mode 100644 index 0000000..7f68295 --- /dev/null +++ b/skills/skill-delete/SKILL.md @@ -0,0 +1,22 @@ +--- +name: skill-delete +description: Remove a skill from the jsc skill set safely. List skills, 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 and open a PR via jsc-git pr. Use only for removal; not for renaming (use skill-update). +--- + +# skill-delete — 刪除技能 + +準則單一來源:[`../../references/guidelines.md`](../../references/guidelines.md)。 + +## 流程 + +1. 列出技能組內含的所有技能:掃描 `jsc-*/skills/*/SKILL.md`。 +2. 讓使用者選擇要刪除的技能(選項標明影響範圍:被哪些技能引用、刪除後指令即失效)。 +3. 盤點與此技能關聯的所有檔案,此步驟**必須以 sub agent 執行**: + - `grep -r` 技能名稱與 `/jsc-{domain}:{name}` 於整個 monorepo + - 其他 SKILL.md 的引用、domain README「Skills 目錄」、該 repo 自身兩份 marketplace.json、`tools/`、`jsc-hooks` 接線 +4. 逐檔執行: + 1. 判斷刪除技能後,該檔是否需要修正才能維持既有功能;**不需要修正就跳過**剩下的流程。 + 2. 依 `jsc-ask:ask` 決策樹詢問修正細節(改為呼叫替代技能?內聯流程?一併移除功能?),每個選項標明影響範圍。 + 3. 修正後依 guidelines.md「審核檢查清單」檢查;不符合就回到步驟 4.2。 +5. 刪除技能目錄 `skills/{name}/`,同步 domain README 與三份 manifest 的 version bump。 +6. 呼叫 `jsc-git:pr` 建立 Push Request。 diff --git a/skills/skill-new/SKILL.md b/skills/skill-new/SKILL.md new file mode 100644 index 0000000..ee1bde0 --- /dev/null +++ b/skills/skill-new/SKILL.md @@ -0,0 +1,26 @@ +--- +name: skill-new +description: Create a new skill in the jsc skill set. Ask skill details via decision tree, generate the skill under the right jsc-{domain} per guidelines.md (create the domain from the template repo if missing), then open a PR via jsc-git pr. Use when the user wants to add a skill; not for editing an existing one (use skill-update). +--- + +# skill-new — 新建技能 + +準則單一來源:[`../../references/guidelines.md`](../../references/guidelines.md)。 + +## 流程 + +1. 依 `jsc-ask:ask` 決策樹詢問技能細節,直到沒有疑慮: + - 目標(單一、與既有技能不重複——先掃 `jsc-*/skills/*/SKILL.md` 列出相近技能供比對,選項需標明「複用既有」與「新建」的影響範圍) + - 觸發時機(何時用、何時不用、觸發關鍵字) + - 輸入與輸出(是否有標準輸入輸出可下放 `tools/`;是否需要 gitea 操作——需要就讓技能使用 `jsc-gitea/tools/gitea.sh` + token) + - 所屬 domain(列出現有 `jsc-*` 供選擇) +2. 若 domain 不存在: + 1. 為其想一個簡短的英文代表詞(一個單字為佳),與使用者確認。 + 2. 請使用者建立存取庫 `plugins/{domain}`,clone 後依 `https://gitea.jsc.idv.tw/plugins/template` 的結構建立內容:三份 plugin manifest(plugin 名 `jsc-{domain}`,版本從 `0.0.1` 開始)、`skills/`、README.md、AGENTS.md(不放 marketplace 檔)。 + 3. 把 plugin 條目(URL 來源指向新存取庫)加入 `plugins/jsc` 的 `.claude-plugin/marketplace.json` 與 `.agents/plugins/marketplace.json`。 +3. 依 guidelines.md 產生技能(此步驟**必須以 sub agent 執行**): + - `skills/{name}/SKILL.md`:英文 description(≤ 5 句、含觸發時機)、STE100 繁中內文 + - 可 hook 的規則放 `jsc-hooks`(不可散落本 domain);標準輸入輸出流程放 `tools/` + - 同步該 domain README 的「Skills 目錄」、三份 manifest 的 version bump +4. 依 guidelines.md「審核檢查清單」逐項自檢,不符就修正。 +5. 呼叫 `jsc-git:pr` 建立 Push Request。 diff --git a/skills/skill-update/SKILL.md b/skills/skill-update/SKILL.md new file mode 100644 index 0000000..0e87dde --- /dev/null +++ b/skills/skill-update/SKILL.md @@ -0,0 +1,17 @@ +--- +name: skill-update +description: Update an existing skill in the jsc skill set. List all skills, 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). +--- + +# skill-update — 更新技能 + +準則單一來源:[`../../references/guidelines.md`](../../references/guidelines.md)。 + +## 流程 + +1. 列出技能組內含的所有技能:掃描 `jsc-*/skills/*/SKILL.md`,以「domain / 名稱 / description」清單呈現。 +2. 讓使用者選擇要更新的技能。 +3. 依 `jsc-ask:ask` 決策樹詢問更新細節(改目標?改觸發時機?改流程?下放 hook 或工具?),每個選項標明影響範圍(例:改名會使既有呼叫指令失效)。 +4. 更新技能(此步驟**必須以 sub agent 執行**):修改 SKILL.md 與關聯檔案,同步 domain README「Skills 目錄」與三份 manifest 的 version bump。 +5. 依 guidelines.md「審核檢查清單」逐項檢查;**不符合就回到步驟 3** 重新詢問並修正,直到全部通過。 +6. 呼叫 `jsc-git:pr` 建立 Push Request。