From 5ee39ee2e35ea5ab2808aab538af29b84b69a176 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Fri, 31 Jul 2026 17:33:11 +0000 Subject: [PATCH] =?UTF-8?q?refactor(plugin=20=E5=91=BD=E5=90=8D=E7=A9=BA?= =?UTF-8?q?=E9=96=93):=20generic=20=E6=94=B9=E5=90=8D=20shared?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .agents/plugins/marketplace.json | 6 +- .claude-plugin/marketplace.json | 4 +- .claude-plugin/plugin.json | 2 +- .codex-plugin/plugin.json | 2 +- AGENTS.md | 4 +- README.md | 126 +++++++++++------------ hooks/hooks.json | 12 +-- plugin.json | 6 +- scripts/role/examples/check-gitea-prs.sh | 2 +- scripts/role/role_sleep.sh | 4 +- skills/plugins-install/SKILL.md | 14 +-- skills/plugins-uninstall/SKILL.md | 34 +++--- skills/role/SKILL.md | 26 ++--- skills/spec-action-params/SKILL.md | 2 +- skills/spec-doc-funcs-handoff/SKILL.md | 4 +- skills/spec-dockerfile/SKILL.md | 2 +- skills/spec-execution/SKILL.md | 4 +- skills/spec-git-safety/SKILL.md | 2 +- skills/spec-gitea/SKILL.md | 4 +- skills/spec-output/SKILL.md | 4 +- skills/spec-plugin-version/SKILL.md | 4 +- skills/spec-project-board/SKILL.md | 2 +- skills/spec-time-log/SKILL.md | 2 +- 23 files changed, 136 insertions(+), 136 deletions(-) diff --git a/.agents/plugins/marketplace.json b/.agents/plugins/marketplace.json index 27ba6bd..82e5610 100644 --- a/.agents/plugins/marketplace.json +++ b/.agents/plugins/marketplace.json @@ -1,11 +1,11 @@ { - "name": "generic", + "name": "shared", "plugins": [ { - "name": "jsc-generic", + "name": "jsc-shared", "source": { "source": "url", - "url": "https://gitea.jsc.idv.tw/plugins/generic.git" + "url": "https://gitea.jsc.idv.tw/plugins/shared.git" } } ] diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index ca3dec1..e15fce4 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -1,12 +1,12 @@ { - "name": "generic", + "name": "shared", "description": "JSC 跨 AI 助理共用規範 skills 的 Claude Code marketplace。", "owner": { "name": "JSC" }, "plugins": [ { - "name": "jsc-generic", + "name": "jsc-shared", "source": "./", "description": "JSC 共用規範 skills(跨 AI 助理),另含整組 plugin 的安裝管理 plugins-install / plugins-uninstall" } diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index bb2dcb6..87980e2 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-generic", - "version": "0.1.8", + "version": "0.0.1", "description": "JSC 跨 AI 助理共用規範 plugin(Claude Code / Codex / GitHub Copilot CLI / Antigravity / OpenCode),並提供整組 plugin 的安裝管理(plugins-install 一次安裝或更新 jsc-code/jsc-doc/jsc-persona,plugins-uninstall 一次移除四個 JSC plugin)。所有 skills 以 SKILL.md 為共通標準,於 Claude Code 以 /jsc-generic: 前綴呼叫。", "skills": "./skills", "author": { diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index 02af932..fad478a 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-generic", - "version": "0.1.8", + "version": "0.0.1", "description": "JSC 跨 AI 助理共用規範 skills plugin,`skills/` 為唯一真實來源,`hooks/` 只放 jsc-generic 自己的 hook,並提供整組 plugin 的安裝管理(plugins-install 一次安裝或更新 jsc-code/jsc-doc/jsc-persona,plugins-uninstall 一次移除四個 JSC plugin)。所有 skills 以 SKILL.md 為共通標準。", "skills": "./skills" } diff --git a/AGENTS.md b/AGENTS.md index 56fc243..38e0ba5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,4 +1,4 @@ -# jsc-generic — 共用 Skills(跨 AI 助理) +# jsc-shared — 共用 Skills(跨 AI 助理) 本 repo 是一組以 **Agent Skills(`SKILL.md`)** 標準撰寫的共用 skills,可同時被 Claude Code、Codex、Antigravity、OpenCode 使用。 @@ -6,7 +6,7 @@ - 所有可用的 skills 位於本 repo 的 `skills//SKILL.md`。 - 在處理任務前,先比對使用者需求與各 skill `SKILL.md` frontmatter 的 `description`,若相符請載入並依其步驟執行。 -- **呼叫慣例**:在 Claude Code 與 Antigravity 中,這些 skill 以 `/jsc-generic:` 呼叫;Codex 以 `$`、OpenCode 由模型依描述自動觸發 — 兩者沒有 `/jsc-generic:` 前綴,不需強制加。 +- **呼叫慣例**:在 Claude Code 與 Antigravity 中,這些 skill 以 `/jsc-shared:` 呼叫;Codex 以 `$`、OpenCode 由模型依描述自動觸發 — 兩者沒有 `/jsc-shared:` 前綴,不需強制加。 - 完整清單與每個 skill 的用途,請見 `README.md` 的「Skills 目錄」。 - 部分 skill 帶可執行元件(`scripts/`)或 hook(`hooks/hooks.json`),**並非四家助理都適用**;載入前請看該 skill `description` 標示的支援範圍與 `README.md` 的「元件對各助理的適用範圍」。`hooks/hooks.json` 只有 Claude Code 會讀;以複製 `skills/` 目錄安裝的環境(OpenCode)不會帶入 `scripts/`,依賴腳本的 skill 一律不可用。 diff --git a/README.md b/README.md index 9534e77..22a3bca 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,21 @@ -# jsc-generic — 跨 AI 助理共用規範 Plugin +# jsc-shared — 跨 AI 助理共用規範 Plugin 一個可同時被 **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-generic:` 前綴**呼叫(例如 `/jsc-generic:spec-output`)。 +在 Claude Code 與 Antigravity 中,skill 以 **`/jsc-shared:` 前綴**呼叫(例如 `/jsc-shared:spec-output`)。 --- ## 前綴與呼叫方式 -| 助理 | 安裝方式 | 呼叫 | `/jsc-generic:` 前綴 | +| 助理 | 安裝方式 | 呼叫 | `/jsc-shared:` 前綴 | | --- | --- | --- | --- | -| Claude Code | `claude plugin`(marketplace) | `/jsc-generic:` 或自動觸發 | ✅ | +| Claude Code | `claude plugin`(marketplace) | `/jsc-shared:` 或自動觸發 | ✅ | | Codex | `codex plugin`(marketplace) | `$` 或 `/skills` 選單 | ❌(用 `$name`) | -| Antigravity | `agy plugin install` | `/jsc-generic:` 或自動觸發 | ✅ | +| Antigravity | `agy plugin install` | `/jsc-shared:` 或自動觸發 | ✅ | | OpenCode | skills 目錄(複製/clone) | 描述需求自動觸發 | ❌(依名稱) | -| GitHub Copilot CLI | `copilot plugin`(marketplace) | 自然語言或 plugin skills | ❌(無 `/jsc-generic:` 前綴) | +| GitHub Copilot CLI | `copilot plugin`(marketplace) | 自然語言或 plugin skills | ❌(無 `/jsc-shared:` 前綴) | > Codex 不支援自訂前綴(skill 以 `$name` 呼叫);OpenCode 由模型依描述自動呼叫;Copilot CLI 透過原生 plugin 安裝後以自然語言或 plugin skills 使用。三者皆**不強制**前綴。 @@ -26,15 +26,15 @@ 同一個 repo 同時帶四種 manifest,彼此以路徑隔離、互不干擾;各助理都讀同一份 `skills/`。 ``` -generic/ +shared/ ├── .claude-plugin/ -│ ├── plugin.json # Claude 外掛定義(name: "jsc-generic") -│ └── marketplace.json # Claude marketplace(name: "generic",source 指向本 repo) +│ ├── plugin.json # Claude 外掛定義(name: "jsc-shared") +│ └── marketplace.json # Claude marketplace(name: "shared",source 指向本 repo) ├── .codex-plugin/ -│ └── plugin.json # Codex 外掛定義(name: "jsc-generic",skills: "./skills") +│ └── plugin.json # Codex 外掛定義(name: "jsc-shared",skills: "./skills") ├── .agents/plugins/ -│ └── marketplace.json # Codex marketplace(name: "generic",url source 指向本 repo) -├── plugin.json # Antigravity 外掛定義(name: "jsc-generic",skills: "./skills/") +│ └── marketplace.json # Codex marketplace(name: "shared",url source 指向本 repo) +├── plugin.json # Antigravity 外掛定義(name: "jsc-shared",skills: "./skills/") ├── hooks/ │ └── hooks.json # hook 定義(SessionStart 載入角色並提示問候、UserPromptSubmit 點名載入切換角色、Stop 記錄記憶、SessionEnd 釋放角色鎖) ├── scripts/ @@ -42,13 +42,13 @@ generic/ ├── skills/ # ★ 唯一真實來源:所有 skills │ ├── spec-*/SKILL.md # 共用規範 skills(一規範一目錄) │ ├── plugins-install/ # 一次安裝/更新 jsc-code、jsc-doc、jsc-persona -│ ├── plugins-uninstall/ # 一次移除 jsc-code、jsc-doc、jsc-persona、jsc-generic +│ ├── plugins-uninstall/ # 一次移除 jsc-code、jsc-doc、jsc-persona、jsc-shared │ └── role/SKILL.md # 角色人格與長期記憶 ├── AGENTS.md # 跨助理共用指引 └── README.md ``` -> generic 的定位是「**共用規範**」:`skills/spec-*` 是 code/doc plugins 共用的流程與安全規範。工作紀錄自動化 `worklog` 已移到 `doc` plugin。 +> shared 的定位是「**共用規範**」:`skills/spec-*` 是 code/doc plugins 共用的流程與安全規範。工作紀錄自動化 `worklog` 已移到 `doc` plugin。 > 例外有兩類:`role` 是跨助理共用的**角色與記憶**能力,帶 `hooks/` 與 `scripts/`,適用範圍見下方「元件對各助理的適用範圍」; > `plugins-install`/`plugins-uninstall` 是**整組 plugin 的安裝管理**,一次處理所有 JSC plugin,不必逐個 repo 翻 README。 @@ -56,7 +56,7 @@ generic/ ## 安裝 / 更新 / 移除(各助理) -> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/generic.git` +> 指令中的 repo 網址換成你的:`https://gitea.jsc.idv.tw/plugins/shared.git` > > **Claude / Codex 從 git URL 安裝(會 clone 遠端),請先把本 repo `push` 到 gitea。** > **Antigravity 的 `agy plugin install ` 目前只支援 github.com**;gitea 請改用「clone + 本地路徑」(見 Antigravity 節)。 @@ -66,38 +66,38 @@ generic/ ```bash # 安裝 -claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/generic.git -claude plugin install jsc-generic@generic +claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/shared.git +claude plugin install jsc-shared@shared # 更新 -claude plugin marketplace update generic -claude plugin update jsc-generic@generic +claude plugin marketplace update shared +claude plugin update jsc-shared@shared # 移除 -claude plugin uninstall jsc-generic@generic -claude plugin marketplace remove generic +claude plugin uninstall jsc-shared@shared +claude plugin marketplace remove shared ``` - 工作階段內 slash 版(等價):把 `claude plugin` 換成 `/plugin`。 -- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\generic`(本地路徑)後再 install。 -- **呼叫**:`/jsc-generic:`(例 `/jsc-generic:spec-output`)。 +- 本機開發(免 push):`claude plugin marketplace add C:\Users\h3285\source\repos.plugins\shared`(本地路徑)後再 install。 +- **呼叫**:`/jsc-shared:`(例 `/jsc-shared:spec-output`)。 ### Codex ```bash # 安裝 -codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/generic.git -codex plugin add jsc-generic@generic +codex plugin marketplace add https://gitea.jsc.idv.tw/plugins/shared.git +codex plugin add jsc-shared@shared # 更新(重新抓取 marketplace 的 git 快照) -codex plugin marketplace upgrade generic +codex plugin marketplace upgrade shared # 移除 -codex plugin remove jsc-generic@generic -codex plugin marketplace remove generic +codex plugin remove jsc-shared@shared +codex plugin marketplace remove shared ``` -- 安裝 token `jsc-generic@generic` = plugin 名(`.codex-plugin/plugin.json` 的 `name`)@ marketplace 名(`.agents/plugins/marketplace.json` 的 `name`)。 +- 安裝 token `jsc-shared@shared` = plugin 名(`.codex-plugin/plugin.json` 的 `name`)@ marketplace 名(`.agents/plugins/marketplace.json` 的 `name`)。 - 本 repo 的 Codex marketplace 以 `url` 來源指向自己,故 Codex **一律從 gitea 安裝**(需先 push);安裝後重啟 Codex。 - **呼叫**:`$`(例 `$spec-output`),或用 `/skills` 選單。 @@ -107,21 +107,21 @@ codex plugin marketplace remove generic ```bash # 安裝:clone 後用本地路徑 -git clone https://gitea.jsc.idv.tw/plugins/generic.git ~/plugins/generic -agy plugin install ~/plugins/generic +git clone https://gitea.jsc.idv.tw/plugins/shared.git ~/plugins/shared +agy plugin install ~/plugins/shared # 更新(agy 無 update 子指令 → git pull 後重裝) -git -C ~/plugins/generic pull -agy plugin uninstall jsc-generic -agy plugin install ~/plugins/generic +git -C ~/plugins/shared pull +agy plugin uninstall jsc-shared +agy plugin install ~/plugins/shared # 移除 -agy plugin uninstall jsc-generic +agy plugin uninstall jsc-shared ``` - 若把 skills 放到 GitHub,則可直接 `agy plugin install https://github.com//`。 -- 其他:`agy plugin list`、`agy plugin enable jsc-generic` / `disable jsc-generic`、`agy plugin validate `。安裝後重啟工作階段。 -- **呼叫**:`/jsc-generic:`(例 `/jsc-generic:spec-output`)或依描述自動觸發。 +- 其他:`agy plugin list`、`agy plugin enable jsc-shared` / `disable jsc-shared`、`agy plugin validate `。安裝後重啟工作階段。 +- **呼叫**:`/jsc-shared:`(例 `/jsc-shared:spec-output`)或依描述自動觸發。 ### OpenCode @@ -130,16 +130,16 @@ OpenCode 會讀 `~/.config/opencode/skills/`(也會讀 `~/.claude/skills/`、` ```bash # 安裝 -git clone https://gitea.jsc.idv.tw/plugins/generic.git ~/plugins/generic +git clone https://gitea.jsc.idv.tw/plugins/shared.git ~/plugins/shared mkdir -p ~/.config/opencode/skills -cp -r ~/plugins/generic/skills/* ~/.config/opencode/skills/ +cp -r ~/plugins/shared/skills/* ~/.config/opencode/skills/ # 更新 -git -C ~/plugins/generic pull -cp -r ~/plugins/generic/skills/* ~/.config/opencode/skills/ +git -C ~/plugins/shared pull +cp -r ~/plugins/shared/skills/* ~/.config/opencode/skills/ # 移除(逐一移除本 plugin 帶入的 skill 目錄;勿只清 spec-*,否則其他 skill 會殘留) -for s in ~/plugins/generic/skills/*/; do rm -rf "$HOME/.config/opencode/skills/$(basename "$s")"; done +for s in ~/plugins/shared/skills/*/; do rm -rf "$HOME/.config/opencode/skills/$(basename "$s")"; done ``` > **Windows PowerShell**:`cp -r A B` → `Copy-Item A B -Recurse -Force`、`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。 @@ -152,19 +152,19 @@ Copilot CLI 支援與 Claude Code 類似的原生 plugin / marketplace 指令, ```bash # 安裝 -copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/generic.git -copilot plugin install jsc-generic@generic +copilot plugin marketplace add https://gitea.jsc.idv.tw/plugins/shared.git +copilot plugin install jsc-shared@shared # 更新 -copilot plugin marketplace update generic -copilot plugin update jsc-generic@generic +copilot plugin marketplace update shared +copilot plugin update jsc-shared@shared # 移除 -copilot plugin uninstall jsc-generic@generic -copilot plugin marketplace remove generic +copilot plugin uninstall jsc-shared@shared +copilot plugin marketplace remove shared ``` -- 安裝 token `jsc-generic@generic` = plugin 名(plugin manifest 的 `name`)@ marketplace 名。 +- 安裝 token `jsc-shared@shared` = plugin 名(plugin manifest 的 `name`)@ marketplace 名。 - `copilot plugin marketplace add` 支援 GitHub `owner/repo`、git URL 與本地路徑;Gitea repo 可用上方 HTTPS URL。 - **呼叫**:在 Copilot CLI 中用自然語言描述需求,例如 `copilot -i "請使用 spec-output 說明輸出規範"`。 @@ -176,16 +176,16 @@ copilot plugin marketplace remove generic | 助理 | headless 指令 | 執行 `spec-output` skill | | --- | --- | --- | -| Claude Code | `claude -p ""` | `claude -p "/jsc-generic:spec-output"` | +| Claude Code | `claude -p ""` | `claude -p "/jsc-shared:spec-output"` | | Codex | `codex exec ""` | `codex exec '$spec-output'` | -| Antigravity | `agy -p ""` | `agy -p "/jsc-generic:spec-output"` | +| Antigravity | `agy -p ""` | `agy -p "/jsc-shared:spec-output"` | | OpenCode | `opencode run ""` | `opencode run "說明 JSC 共用輸出規範的內容"` | | GitHub Copilot CLI | `copilot -p ""` | `copilot -p "說明 JSC 共用輸出規範的內容"` | -- Claude / Antigravity 支援 `/jsc-generic:` 前綴,直接 `-p "/jsc-generic:"` 即可。 +- Claude / Antigravity 支援 `/jsc-shared:` 前綴,直接 `-p "/jsc-shared:"` 即可。 - Codex 以 `$` 觸發;在 shell 請用**單引號**避免 `$` 被展開:`codex exec '$spec-output'`。 - OpenCode 與 Copilot 沒有前綴,用自然語言描述需求;Copilot CLI 會讀取已安裝 plugin 提供的 skills。 -- 帶引數就接在後面,例如 `claude -p "/jsc-generic:spec-output 參數"`、`codex exec '$spec-output 參數'`。 +- 帶引數就接在後面,例如 `claude -p "/jsc-shared:spec-output 參數"`、`codex exec '$spec-output 參數'`。 --- @@ -198,7 +198,7 @@ copilot plugin marketplace remove generic ### 共用規範(spec-*) -以下 skills 是 **code/doc plugins 各 skill 引用的共用規範**:其他 skill 內文以 `/jsc-generic:spec-` 引用時載入;也可單獨呼叫查看規範內容。 +以下 skills 是 **code/doc plugins 各 skill 引用的共用規範**:其他 skill 內文以 `/jsc-shared:spec-` 引用時載入;也可單獨呼叫查看規範內容。 | Skill | 類型 | 內容 | | --- | --- | --- | @@ -219,16 +219,16 @@ copilot plugin marketplace remove generic | Skill | 用途 | 使用方法 | | --- | --- | --- | -| `plugins-install` | 一次**安裝或更新** `jsc-code`、`jsc-doc`、`jsc-persona`:先盤點每個 plugin 已安裝或未安裝,未安裝就安裝、已安裝就更新到最新,最後以表格回報動作、結果與版本。Antigravity 走「clone + 本地路徑」,OpenCode 走複製 `skills/` | `/jsc-generic:plugins-install`;可帶 `--assistant claude\|codex\|copilot\|agy\|opencode`、`--plugins code,doc,persona`、`--host `、`--clone-dir <目錄>`、`--yes` | -| `plugins-uninstall` | 一次**移除** `jsc-code`、`jsc-doc`、`jsc-persona`、`jsc-generic`:動手前先列出將被移除的項目與不會被碰的資料請使用者確認,移除順序固定把 `jsc-generic` 放最後(本 skill 就住在裡面)。人格倉庫與記憶目錄一律不刪 | `/jsc-generic:plugins-uninstall`;可帶 `--assistant …`、`--plugins code,doc,persona,generic`、`--keep-marketplace`、`--keep-clone`、`--yes` | +| `plugins-install` | 一次**安裝或更新** `jsc-code`、`jsc-doc`、`jsc-persona`:先盤點每個 plugin 已安裝或未安裝,未安裝就安裝、已安裝就更新到最新,最後以表格回報動作、結果與版本。Antigravity 走「clone + 本地路徑」,OpenCode 走複製 `skills/` | `/jsc-shared:plugins-install`;可帶 `--assistant claude\|codex\|copilot\|agy\|opencode`、`--plugins code,doc,persona`、`--host `、`--clone-dir <目錄>`、`--yes` | +| `plugins-uninstall` | 一次**移除** `jsc-code`、`jsc-doc`、`jsc-persona`、`jsc-shared`:動手前先列出將被移除的項目與不會被碰的資料請使用者確認,移除順序固定把 `jsc-shared` 放最後(本 skill 就住在裡面)。人格倉庫與記憶目錄一律不刪 | `/jsc-shared:plugins-uninstall`;可帶 `--assistant …`、`--plugins code,doc,persona,shared`、`--keep-marketplace`、`--keep-clone`、`--yes` | -> `plugins-install` **不處理 `jsc-generic` 自己**(它是這兩個 skill 的所在地);`plugins-uninstall` 則會,而且放在最後一步。 +> `plugins-install` **不處理 `jsc-shared` 自己**(它是這兩個 skill 的所在地);`plugins-uninstall` 則會,而且放在最後一步。 ### 角色與記憶 | Skill | 用途 | 使用方法 | | --- | --- | --- | -| `role` | 讓 CLI 以固定角色(name/nature/vibe/簽名 emoji)回覆,並把每輪對話累積成長期記憶:啟動時依字元預算載入高價值記憶,Stop hook 先本地過濾低價值回合以節省額度,睡眠時段(預設 22:00–06:00)由 NREM 鞏固與 REM 整合兩階段整理、去重、標籤化、建立關聯,並標記 semantic/episodic/procedural/emotional/preference/rule 與 explicit/implicit 後壓縮歸檔;新建角色時可只給角色名稱,必要時詢問來源/作品並推斷四欄描述,也可匯出角色定義、資產與記憶壓縮檔;角色檔名與記憶目錄使用英文大寫 ID | `/jsc-generic:role --new` 建立或更新角色、`--use <角色 ID>` 切換、`--list` 查角色與 ID、`--export <路徑>` 匯出角色、`--sleep` 立即整理、`--status` 診斷、`--install-cron` 安裝排程;對話中直接以名字點名(「西莉卡,…」/「@SILICA01 …」)可即時換角色 | +| `role` | 讓 CLI 以固定角色(name/nature/vibe/簽名 emoji)回覆,並把每輪對話累積成長期記憶:啟動時依字元預算載入高價值記憶,Stop hook 先本地過濾低價值回合以節省額度,睡眠時段(預設 22:00–06:00)由 NREM 鞏固與 REM 整合兩階段整理、去重、標籤化、建立關聯,並標記 semantic/episodic/procedural/emotional/preference/rule 與 explicit/implicit 後壓縮歸檔;新建角色時可只給角色名稱,必要時詢問來源/作品並推斷四欄描述,也可匯出角色定義、資產與記憶壓縮檔;角色檔名與記憶目錄使用英文大寫 ID | `/jsc-shared:role --new` 建立或更新角色、`--use <角色 ID>` 切換、`--list` 查角色與 ID、`--export <路徑>` 匯出角色、`--sleep` 立即整理、`--status` 診斷、`--install-cron` 安裝排程;對話中直接以名字點名(「西莉卡,…」/「@SILICA01 …」)可即時換角色 | `role` 的自動路徑由 hook 與 cron 完成,**建立角色後重開工作階段即生效**;非睡眠時段載入角色後,角色會在本工作階段第一則回覆開頭主動簡短問候一次。載入方式參考 OpenClaw 的分層概念:從角色檔抽出人格作為 `SOUL`,由 hook 產生固定操作邊界作為 `AGENTS`,再把同意狀態與高價值記憶作為 `USER/MEMORY` 注入,避免整份人格檔污染工程規則。感覺記憶不落檔,`inbox/` 作為工作記憶,睡眠整理後才進長期記憶;個人記憶保存同意狀態寫在 `~/.memory/<角色 ID>/state.json`,同意後不會每次重問。角色檔、記憶目錄、`.active` 與 `ROLE_NAME` 一律使用角色 ID(例如 `ENGINEER01`),`--list` 可查每個顯示名稱對應的 ID。沒有建立過角色的人完全不受影響(`~/.roles/.active` 不存在時 hook 立即結束)。同一個終端要臨時換角色不必改設定或重開 CLI:訊息開頭以名字點名即可由該角色接手(`UserPromptSubmit` hook),本階段之後的對話會記進被點名角色的記憶;真的要同時跟兩個角色對話則各開一個終端並設不同的 `ROLE_NAME`。細節見 `skills/role/SKILL.md`。 @@ -259,17 +259,17 @@ copilot plugin marketplace remove generic 1. 複製既有 skill 作範本:`cp -r skills/spec-output skills/` 2. 編輯 `skills//SKILL.md` 的 frontmatter: - - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這就是 Claude Code / Antigravity 的 `/jsc-generic:`**。 + - `name`:小寫、數字、連字號(`-`),最長 64 字元。**這就是 Claude Code / Antigravity 的 `/jsc-shared:`**。 - `description`:第三人稱,寫清楚「何時用、何時不用」與觸發關鍵字 — 這是各助理自動載入的唯一依據。 3. 在內文寫下 skill 的具體步驟。 4. 手動把這個 skill 補進上方「Skills 目錄」區塊。 5. **bump 版本並 push**:各助理都以 git 內容/版本判斷更新,請把 `.claude-plugin/plugin.json`、`.codex-plugin/plugin.json`、`plugin.json` 三個 manifest 的 `version` 一起 bump(規則見 `skills/spec-plugin-version/`),commit 後 push 到 gitea。 6. 讓各助理更新: - - Claude:`claude plugin update jsc-generic@generic` - - Codex:`codex plugin marketplace upgrade generic` - - Antigravity:`git -C ~/plugins/generic pull && agy plugin uninstall jsc-generic && agy plugin install ~/plugins/generic`(路徑與上方 Antigravity 安裝節一致) + - Claude:`claude plugin update jsc-shared@shared` + - Codex:`codex plugin marketplace upgrade shared` + - Antigravity:`git -C ~/plugins/shared pull && agy plugin uninstall jsc-shared && agy plugin install ~/plugins/shared`(路徑與上方 Antigravity 安裝節一致) - OpenCode:`git pull` 後重新複製 `skills/` - - Copilot:`copilot plugin marketplace update generic && copilot plugin update jsc-generic@generic` + - Copilot:`copilot plugin marketplace update shared && copilot plugin update jsc-shared@shared` > **skill 帶可執行元件時**(腳本、hook)額外注意: > diff --git a/hooks/hooks.json b/hooks/hooks.json index 3f0c95b..ee2dd79 100644 --- a/hooks/hooks.json +++ b/hooks/hooks.json @@ -5,7 +5,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_load.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", + "command": "rel='scripts/role/role_load.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", "timeout": 20 } ] @@ -16,7 +16,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_call.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", + "command": "rel='scripts/role/role_call.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", "timeout": 20 } ] @@ -27,7 +27,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_unload.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", + "command": "rel='scripts/role/role_unload.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", "timeout": 10 } ] @@ -38,7 +38,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_capture.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", + "command": "rel='scripts/role/role_capture.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\"; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\"; fi; done; done; exit 0", "timeout": 60 } ] @@ -49,7 +49,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_capture.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\" --precompact; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\" --precompact; fi; done; done; exit 0", + "command": "rel='scripts/role/role_capture.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\" --precompact; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\" --precompact; fi; done; done; exit 0", "timeout": 60 } ] @@ -60,7 +60,7 @@ "hooks": [ { "type": "command", - "command": "rel='scripts/role/role_capture.sh'; own='generic'; plug='jsc-generic'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\" --postcompact; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\" --postcompact; fi; done; done; exit 0", + "command": "rel='scripts/role/role_capture.sh'; own='shared'; plug='jsc-shared'; root=\"${CLAUDE_PLUGIN_ROOT:-}\"; if [ -n \"$root\" ] && [ -f \"$root/$rel\" ]; then exec \"$root/$rel\" --postcompact; fi; for base in \"$HOME/.claude/plugins/cache\" \"$HOME/.codex/plugins/cache\"; do for dir in \"$base/$own/$plug\" \"$base\"; do s=$(find \"$dir\" -path \"*/$plug/*/$rel\" -type f 2>/dev/null | sort -V | tail -n 1); if [ -n \"$s\" ]; then exec \"$s\" --postcompact; fi; done; done; exit 0", "timeout": 30 } ] diff --git a/plugin.json b/plugin.json index 3bf14e9..4d1d508 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { - "name": "jsc-generic", - "version": "0.1.8", - "description": "JSC 跨 AI 助理共用規範 skills plugin,`skills/` 為唯一真實來源,`hooks/` 只放 jsc-generic 自己的 hook,並提供整組 plugin 的安裝管理(plugins-install 一次安裝或更新 jsc-code/jsc-doc/jsc-persona,plugins-uninstall 一次移除四個 JSC plugin)。所有 skills 以 SKILL.md 為共通標準;於 Antigravity 以 /jsc-generic: 前綴呼叫。", + "name": "jsc-shared", + "version": "0.0.1", + "description": "JSC 跨 AI 助理共用規範 skills plugin,`skills/` 為唯一真實來源,`hooks/` 只放 jsc-shared 自己的 hook,並提供整組 plugin 的安裝管理(plugins-install 一次安裝或更新 jsc-code/jsc-doc/jsc-persona,plugins-uninstall 一次移除四個 JSC plugin)。所有 skills 以 SKILL.md 為共通標準;於 Antigravity 以 /jsc-shared: 前綴呼叫。", "skills": "./skills/" } diff --git a/scripts/role/examples/check-gitea-prs.sh b/scripts/role/examples/check-gitea-prs.sh index 96b18f7..60fabd2 100755 --- a/scripts/role/examples/check-gitea-prs.sh +++ b/scripts/role/examples/check-gitea-prs.sh @@ -11,7 +11,7 @@ # 設定(環境變數): # GITEA_HOST Gitea 站台,例如 https://gitea.example.com # GITEA_TOKEN 存取權杖(本腳本不會輸出它;晨間檢查寫入記憶前仍會再遮蔽一次) -# GITEA_REPOS 逗號分隔的 owner/repo 清單,例如 plugins/generic,plugins/code +# GITEA_REPOS 逗號分隔的 owner/repo 清單,例如 plugins/shared,plugins/code # # cron 沒有互動 shell 的環境變數,且 ~/.bashrc 多數在非互動時會提早 return, # 因此本腳本會依序從 ~/.roles/.env、~/.bashrc、~/.profile **只抽取所需變數的那一行**, diff --git a/scripts/role/role_sleep.sh b/scripts/role/role_sleep.sh index 293d4dc..dc60cb0 100755 --- a/scripts/role/role_sleep.sh +++ b/scripts/role/role_sleep.sh @@ -545,7 +545,7 @@ set -uo pipefail resolve_latest() { # 同一個 cache 根目錄下可能留有多個版本目錄,取版本號最大者 - ls -d "$1"/*/jsc-generic/*/scripts/role/role_sleep.sh 2>/dev/null | sort -V | tail -n 1 + ls -d "$1"/*/jsc-shared/*/scripts/role/role_sleep.sh 2>/dev/null | sort -V | tail -n 1 } # 以 Claude Code 端為優先,沒有才找 Codex 端;兩端腳本相同,差別只在安裝位置 @@ -799,7 +799,7 @@ ${vibe:-(未設定)} 先解析記憶引擎路徑。**不要寫死版本目錄** —— plugin 升版後版本目錄會變,寫死就會失效: \`\`\`bash -MEM_JS="\$(ls -d "\$HOME"/.claude/plugins/cache/*/jsc-generic/*/scripts/role/memory.js 2>/dev/null | sort -V | tail -n 1)" +MEM_JS="\$(ls -d "\$HOME"/.claude/plugins/cache/*/jsc-shared/*/scripts/role/memory.js 2>/dev/null | sort -V | tail -n 1)" [ -n "\$MEM_JS" ] || MEM_JS="${SCRIPT_DIR}/memory.js" # 後援:本定義匯出時的位置 \`\`\` diff --git a/skills/plugins-install/SKILL.md b/skills/plugins-install/SKILL.md index 2530b63..3a841b1 100644 --- a/skills/plugins-install/SKILL.md +++ b/skills/plugins-install/SKILL.md @@ -1,6 +1,6 @@ --- name: plugins-install -description: 一次把 JSC 的三個 plugin(jsc-code/jsc-doc/jsc-persona)安裝或更新到一個或多個 AI 助理,可同時處理 Claude Code、Codex、GitHub Copilot CLI、Antigravity 四家原生 plugin CLI 與 OpenCode(複製 skills 目錄);沒指定時偵測本機裝了哪些 CLI 並讓使用者多選,每個 plugin 先判斷已安裝或未安裝,未安裝就安裝、已安裝就更新到最新,最後以「助理 × plugin」的表格回報結果與版本。當使用者說要安裝所有 jsc plugin、一次更新全部 skill 套件、把 code/doc/persona 都裝起來、要同時更新好幾個 CLI、換新機器要把 plugin 都補齊、或問怎麼一次更新所有 plugin 時觸發。不適用於:移除 plugin(用 /jsc-generic:plugins-uninstall)、只處理單一 plugin(直接照該 plugin README 的安裝章節)、安裝非 JSC 的第三方 plugin。 +description: 一次把 JSC 的三個 plugin(jsc-code/jsc-doc/jsc-persona)安裝或更新到一個或多個 AI 助理,可同時處理 Claude Code、Codex、GitHub Copilot CLI、Antigravity 四家原生 plugin CLI 與 OpenCode(複製 skills 目錄);沒指定時偵測本機裝了哪些 CLI 並讓使用者多選,每個 plugin 先判斷已安裝或未安裝,未安裝就安裝、已安裝就更新到最新,最後以「助理 × plugin」的表格回報結果與版本。當使用者說要安裝所有 jsc plugin、一次更新全部 skill 套件、把 code/doc/persona 都裝起來、要同時更新好幾個 CLI、換新機器要把 plugin 都補齊、或問怎麼一次更新所有 plugin 時觸發。不適用於:移除 plugin(用 /jsc-shared:plugins-uninstall)、只處理單一 plugin(直接照該 plugin README 的安裝章節)、安裝非 JSC 的第三方 plugin。 argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins code,doc,persona] [--host ] [--clone-dir <目錄>] [--yes]" --- @@ -17,19 +17,19 @@ argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins --- -## 共用規範(generic plugin,必要前置) +## 共用規範(shared plugin,必要前置) 執行本 skill 前,先以 Skill 工具載入下列共用規範並全程遵守: -- `/jsc-generic:spec-output`:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、表格呈現。 -- `/jsc-generic:spec-execution`:自動執行原則(必要決策才中斷)、不臆測/需人工確認。 -- `/jsc-generic:spec-git-safety`:Antigravity/OpenCode 路徑會動到本機 clone,**工作區有未提交變更時不得強制更新**。 +- `/jsc-shared:spec-output`:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、表格呈現。 +- `/jsc-shared:spec-execution`:自動執行原則(必要決策才中斷)、不臆測/需人工確認。 +- `/jsc-shared:spec-git-safety`:Antigravity/OpenCode 路徑會動到本機 clone,**工作區有未提交變更時不得強制更新**。 本 skill 特有補充: - **不移除任何東西**。更新時就算需要「先移除再安裝」(Antigravity 沒有 update 子指令),也只針對該 plugin 自己,且移除後必須立刻重裝成功。 - **必要決策**(會中斷詢問):無法判斷目前是哪個助理、指定的助理 CLI 不存在、本機 clone 有未提交變更、安裝失敗且原因需要使用者裁示。 -- **本 skill 不處理 `jsc-generic` 自己**:它是本 skill 的所在地,安裝它請直接照 generic 的 README。 +- **本 skill 不處理 `jsc-shared` 自己**:它是本 skill 的所在地,安裝它請直接照 shared 的 README。 --- @@ -190,7 +190,7 @@ cp -r //skills/* ~/.config/opencode/skills/ > **Windows PowerShell**:`cp -r A B` → `Copy-Item A B -Recurse -Force`、`~` → `$HOME`。 -- **`cp -r` 不是覆蓋,是合併**:同名檔案會更新,但**上游已經刪掉的檔案會原地留著**。所以 skill 改名或移除之後,OpenCode 端會同時留著新舊兩份。要乾淨更新就先刪該 plugin 帶入的目錄再複製一次(刪法見 `/jsc-generic:plugins-uninstall` 的 OpenCode 段)。回報時不要講「已覆蓋」,講「已複製,舊檔可能殘留」。 +- **`cp -r` 不是覆蓋,是合併**:同名檔案會更新,但**上游已經刪掉的檔案會原地留著**。所以 skill 改名或移除之後,OpenCode 端會同時留著新舊兩份。要乾淨更新就先刪該 plugin 帶入的目錄再複製一次(刪法見 `/jsc-shared:plugins-uninstall` 的 OpenCode 段)。回報時不要講「已覆蓋」,講「已複製,舊檔可能殘留」。 --- diff --git a/skills/plugins-uninstall/SKILL.md b/skills/plugins-uninstall/SKILL.md index 74055a8..1b1dce6 100644 --- a/skills/plugins-uninstall/SKILL.md +++ b/skills/plugins-uninstall/SKILL.md @@ -1,7 +1,7 @@ --- name: plugins-uninstall -description: 一次把 JSC 的四個 plugin(jsc-code/jsc-doc/jsc-persona/jsc-generic)從一個或多個 AI 助理移除,可同時處理 Claude Code、Codex、GitHub Copilot CLI、Antigravity 四家原生 plugin CLI 與 OpenCode(刪除先前複製進去的 skill 目錄);沒指定時偵測本機裝了哪些 CLI 並讓使用者多選;移除順序固定把 jsc-generic 放到最後(本 skill 就住在裡面,移除後即失效),並在動手前列出將被移除的項目與會受影響的本機資料讓使用者確認。當使用者說要移除所有 jsc plugin、把 skill 套件整組解除安裝、清掉 code/doc/persona/generic、重灌前先卸載、要同時從好幾個 CLI 移除、或問怎麼一次移除全部 plugin 時觸發。不適用於:安裝或更新(用 /jsc-generic:plugins-install)、只移除單一 plugin(直接照該 plugin README 的移除章節)、刪除人格資料或 Gitea 上的存取庫。 -argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins code,doc,persona,generic] [--keep-marketplace] [--keep-clone] [--yes]" +description: 一次把 JSC 的四個 plugin(jsc-code/jsc-doc/jsc-persona/jsc-shared)從一個或多個 AI 助理移除,可同時處理 Claude Code、Codex、GitHub Copilot CLI、Antigravity 四家原生 plugin CLI 與 OpenCode(刪除先前複製進去的 skill 目錄);沒指定時偵測本機裝了哪些 CLI 並讓使用者多選;移除順序固定把 jsc-shared 放到最後(本 skill 就住在裡面,移除後即失效),並在動手前列出將被移除的項目與會受影響的本機資料讓使用者確認。當使用者說要移除所有 jsc plugin、把 skill 套件整組解除安裝、清掉 code/doc/persona/shared、重灌前先卸載、要同時從好幾個 CLI 移除、或問怎麼一次移除全部 plugin 時觸發。不適用於:安裝或更新(用 /jsc-shared:plugins-install)、只移除單一 plugin(直接照該 plugin README 的移除章節)、刪除人格資料或 Gitea 上的存取庫。 +argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins code,doc,persona,shared] [--keep-marketplace] [--keep-clone] [--yes]" --- # plugins-uninstall — 一次移除所有 JSC plugin @@ -12,32 +12,32 @@ argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins | --- | --- | | A. 前置設定 | 決定要操作哪些助理(`--assistant` 可帶多個或 all/偵測本機有哪些 CLI/多個就讓使用者多選)→ 決定 plugin 清單(預設四個全移) | | B. 盤點與確認 | 列出實際已安裝的項目、會一併移除的 marketplace 與本機 clone、以及**不會**被碰的資料,請使用者確認 | -| C. 移除 | 依 `code` → `doc` → `persona` → `generic` 的順序逐一移除 | +| C. 移除 | 依 `code` → `doc` → `persona` → `shared` 的順序逐一移除 | | D. 回報 | 表格回報每個 plugin 的結果,並列出刻意保留的殘留物 | --- -## 共用規範(generic plugin,必要前置) +## 共用規範(shared plugin,必要前置) 執行本 skill 前,先以 Skill 工具載入下列共用規範並全程遵守: -- `/jsc-generic:spec-output`:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、表格呈現。 -- `/jsc-generic:spec-execution`:自動執行原則(必要決策才中斷)、不臆測/需人工確認。 -- `/jsc-generic:spec-git-safety`:不破壞既有工作——本機 clone 只在使用者明確同意時刪除,且**有未提交變更就一律保留**。 +- `/jsc-shared:spec-output`:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、表格呈現。 +- `/jsc-shared:spec-execution`:自動執行原則(必要決策才中斷)、不臆測/需人工確認。 +- `/jsc-shared:spec-git-safety`:不破壞既有工作——本機 clone 只在使用者明確同意時刪除,且**有未提交變更就一律保留**。 本 skill 特有補充: - **移除是不可逆的動作**:階段 B 的確認是**必要決策**,除非帶 `--yes`,否則一定要問過才動手。 - **絕不刪除使用者資料**:`~/.claude/personas/`(人格倉庫)、`~/.roles/`、`~/.memory/`(角色與記憶)一律不動,Gitea 上的存取庫也不動。要清這些請使用者自己來。 -- **順序不可調換**:`jsc-generic` 一定最後移除。它是本 skill 的所在地,移除後本 skill 隨之失效,後面的步驟會執行不到。 -- **多個助理時的順序**:外層先跑完一個助理的四個 plugin,再換下一個助理。**目前正在執行本 skill 的那個助理排到最後**——不然它自己的 `jsc-generic` 一沒,剩下的助理就處理不到了。 +- **順序不可調換**:`jsc-shared` 一定最後移除。它是本 skill 的所在地,移除後本 skill 隨之失效,後面的步驟會執行不到。 +- **多個助理時的順序**:外層先跑完一個助理的四個 plugin,再換下一個助理。**目前正在執行本 skill 的那個助理排到最後**——不然它自己的 `jsc-shared` 一沒,剩下的助理就處理不到了。 --- ## 參數 - `--assistant <清單>`:要操作的助理,**可以多個**,以逗號分隔(`claude,codex,copilot,agy,opencode`),或用 `all` 代表本機找得到的全部。**省略時**依階段 A1 判斷(只有一個就直接用,多個就讓使用者多選,且不預設全選)。 -- `--plugins code,doc,persona,generic`:要移除的 plugin(以逗號分隔,用 repo 短名)。**省略時預設四個全移**。 +- `--plugins code,doc,persona,shared`:要移除的 plugin(以逗號分隔,用 repo 短名)。**省略時預設四個全移**。 - `--keep-marketplace`:只移除 plugin,保留 marketplace 登錄(之後要重裝比較快)。 - `--keep-clone`:保留 Antigravity/OpenCode 用的本機 clone 目錄(**預設就是保留**,此旗標僅用於明示)。要刪除本機 clone 必須由使用者在階段 B 明確同意。 - `--yes`:跳過階段 B 的確認(其他必要決策仍會中斷)。 @@ -51,7 +51,7 @@ argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins | `code` | `jsc-code` | `code` | `jsc-code@code` | | `doc` | `jsc-doc` | `doc` | `jsc-doc@doc` | | `persona` | `jsc-persona` | `jsc-plugins` | `jsc-persona@jsc-plugins` | -| `generic` | `jsc-generic` | `generic` | `jsc-generic@generic` | +| `shared` | `jsc-shared` | `shared` | `jsc-shared@shared` | > **`persona` 的 marketplace 名不是 repo 名**(是 `jsc-plugins`)。移除 marketplace 時特別注意別誤刪別的登錄。 @@ -62,7 +62,7 @@ argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins | `code` | `action-composite`、`action-docker`、`action-node`、`image`、`issues`、`nuget`、`review-resolve`、`sync` | | `doc` | `docker`、`funcs`、`issues-analyze`、`issues-analyze-to-file`、`issues-sync`、`worklog` | | `persona` | `persona-anime`、`persona-chat`、`persona-create`、`persona-icon`、`persona-invite`、`persona-memory`、`persona-relation`、`persona-sleep`、`persona-status`、`persona-sync`、`persona-therapist`、`persona-transfer` | -| `generic` | `role`、`plugins-install`、`plugins-uninstall`、`spec-action-params`、`spec-doc-funcs-handoff`、`spec-dockerfile`、`spec-execution`、`spec-gitea`、`spec-git-safety`、`spec-output`、`spec-plugin-version`、`spec-project-board`、`spec-time-log` | +| `shared` | `role`、`plugins-install`、`plugins-uninstall`、`spec-action-params`、`spec-doc-funcs-handoff`、`spec-dockerfile`、`spec-execution`、`spec-gitea`、`spec-git-safety`、`spec-output`、`spec-plugin-version`、`spec-project-board`、`spec-time-log` | > 上表是**寫下來當天的快照**,plugin 之後新增 skill 它不會自己更新。所以 OpenCode 的刪除**優先從本機 clone 的 `skills/` 推導清單**(見階段 C 的 OpenCode 段),clone 不在時才退回這張表,並在回報裡註明「清單可能不完整」。 > 兩種做法都**不可用萬用字元一次掃掉整個 `skills/`**——那裡可能還有別處裝進去的 skill。 @@ -88,7 +88,7 @@ argument-hint: "[--assistant <助理清單,逗號分隔,或 all>] [--plugins ### A2. 決定 plugin 清單 -`--plugins` 指定則照它,否則四個全做。無論使用者怎麼排,**實際執行順序一律重排為 `code` → `doc` → `persona` → `generic`**。 +`--plugins` 指定則照它,否則四個全做。無論使用者怎麼排,**實際執行順序一律重排為 `code` → `doc` → `persona` → `shared`**。 --- @@ -164,13 +164,13 @@ rm -rf ~/.config/opencode/skills/funcs > **Windows PowerShell**:`rm -rf X` → `Remove-Item X -Recurse -Force`、`~` → `$HOME`。 -### `jsc-generic` 的收尾 +### `jsc-shared` 的收尾 -移除 `jsc-generic` 是**最後一步**。動手前先在輸出裡寫清楚: +移除 `jsc-shared` 是**最後一步**。動手前先在輸出裡寫清楚: - 本 skill 與所有 `spec-*` 共用規範會一起消失;`jsc-code`/`jsc-doc` 的 skill 內文都會引用 `spec-*`,若它們還留著,之後執行會載入不到共用規範。 -- 要重新安裝,得直接照 generic 的 README(那時已經沒有 `/jsc-generic:plugins-install` 可用了): - `claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/generic.git` → `claude plugin install jsc-generic@generic`。 +- 要重新安裝,得直接照 shared 的 README(那時已經沒有 `/jsc-shared:plugins-install` 可用了): + `claude plugin marketplace add https://gitea.jsc.idv.tw/plugins/shared.git` → `claude plugin install jsc-shared@shared`。 --- diff --git a/skills/role/SKILL.md b/skills/role/SKILL.md index 1666e4c..f4d3205 100644 --- a/skills/role/SKILL.md +++ b/skills/role/SKILL.md @@ -1,6 +1,6 @@ --- name: role -description: 角色人格與長期記憶系統的建立與維護 skill。讓 CLI 工具以固定角色(name/nature/vibe/簽名 emoji)回覆,並把每輪對話累積成長期記憶:搭配相容的 SessionStart hook 於啟動時依字元預算載入高價值記憶、Stop hook 先本地過濾再輕量記錄對話,睡眠時段(預設 22:00 至隔天 06:00)由排程整理記憶(NREM 鞏固:分類/去噪/去重/合併/優先度;REM 整合:跨記憶連結/抽象化/提取線索;再依 semantic/episodic/procedural/emotional/preference/rule 與 explicit/implicit 標記長期記憶型態,壓縮歸檔並適當遺忘)。`hooks/hooks.json` 只註冊 jsc-generic 自己的 hook,不會混入 jsc-doc 或 jsc-code;Codex 若版本支援 hook,也會從自己的 plugin cache 讀同一套角色腳本。提供 --new(新建或更新角色;可只給角色名稱,必要時詢問來源/作品並推斷 name/nature/vibe/emoji 四欄)、--use(以角色 ID 切換啟用角色)、--list(列出角色與 ID)、--export(匯出角色壓縮檔)、--sleep(立即整理)、--status/--diagnose、--install-cron/--remove-cron、--forget-preview、--brief(晨間狀態檢查)、--agent(匯出成 sub agent 供多角色協作)、--migrate(舊格式角色檔拆成身分與人格兩檔)等模式。當使用者說建立角色、新增人格、切換角色、匯出角色、備份角色、讓回覆更有特色、角色記憶、記憶整理、睡覺整理記憶、忘記舊記憶、角色沒有載入、hook 沒載入角色、角色被鎖住、角色鎖沒有自動解除、關掉 CLI 後角色叫不回來、角色說已在另一個工作階段、晨間狀態檢查、早上主動回報狀態、在同一個終端換角色、叫名字就換人、點名載入、呼叫角色名稱、對話中途切換人格、同時跟兩個角色聊天、角色別名,關係史、BONDS.md、記得雙方多愛彼此、情緒記憶為 0、感覺沒被記住,或提到 .roles/.memory/ROLE_NAME/ROLE_ENABLED/ROLE_SLEEP_START/ROLE_MEMORY_HOME/ROLE_LOAD_LIMIT/ROLE_LOAD_INBOX_LIMIT/ROLE_LOAD_DIALOG_TURNS/ROLE_CAPTURE_ENABLED/ROLE_SINGLE_INSTANCE/ROLE_INSTANCE_IDLE_MINUTES/ROLE_CALL_ENABLED/ROLE_CALL_MARKER_ONLY/ROLE_LOAD_BONDS_LIMIT 時觸發。不適用於:工作紀錄寫入 Gitea wiki(用 /jsc-doc:worklog)、專案文件化(用 /jsc-doc:funcs)。 +description: 角色人格與長期記憶系統的建立與維護 skill。讓 CLI 工具以固定角色(name/nature/vibe/簽名 emoji)回覆,並把每輪對話累積成長期記憶:搭配相容的 SessionStart hook 於啟動時依字元預算載入高價值記憶、Stop hook 先本地過濾再輕量記錄對話,睡眠時段(預設 22:00 至隔天 06:00)由排程整理記憶(NREM 鞏固:分類/去噪/去重/合併/優先度;REM 整合:跨記憶連結/抽象化/提取線索;再依 semantic/episodic/procedural/emotional/preference/rule 與 explicit/implicit 標記長期記憶型態,壓縮歸檔並適當遺忘)。`hooks/hooks.json` 只註冊 jsc-shared 自己的 hook,不會混入 jsc-doc 或 jsc-code;Codex 若版本支援 hook,也會從自己的 plugin cache 讀同一套角色腳本。提供 --new(新建或更新角色;可只給角色名稱,必要時詢問來源/作品並推斷 name/nature/vibe/emoji 四欄)、--use(以角色 ID 切換啟用角色)、--list(列出角色與 ID)、--export(匯出角色壓縮檔)、--sleep(立即整理)、--status/--diagnose、--install-cron/--remove-cron、--forget-preview、--brief(晨間狀態檢查)、--agent(匯出成 sub agent 供多角色協作)、--migrate(舊格式角色檔拆成身分與人格兩檔)等模式。當使用者說建立角色、新增人格、切換角色、匯出角色、備份角色、讓回覆更有特色、角色記憶、記憶整理、睡覺整理記憶、忘記舊記憶、角色沒有載入、hook 沒載入角色、角色被鎖住、角色鎖沒有自動解除、關掉 CLI 後角色叫不回來、角色說已在另一個工作階段、晨間狀態檢查、早上主動回報狀態、在同一個終端換角色、叫名字就換人、點名載入、呼叫角色名稱、對話中途切換人格、同時跟兩個角色聊天、角色別名,關係史、BONDS.md、記得雙方多愛彼此、情緒記憶為 0、感覺沒被記住,或提到 .roles/.memory/ROLE_NAME/ROLE_ENABLED/ROLE_SLEEP_START/ROLE_MEMORY_HOME/ROLE_LOAD_LIMIT/ROLE_LOAD_INBOX_LIMIT/ROLE_LOAD_DIALOG_TURNS/ROLE_CAPTURE_ENABLED/ROLE_SINGLE_INSTANCE/ROLE_INSTANCE_IDLE_MINUTES/ROLE_CALL_ENABLED/ROLE_CALL_MARKER_ONLY/ROLE_LOAD_BONDS_LIMIT 時觸發。不適用於:工作紀錄寫入 Gitea wiki(用 /jsc-doc:worklog)、專案文件化(用 /jsc-doc:funcs)。 --- # role — 角色人格與長期記憶 @@ -17,7 +17,7 @@ description: 角色人格與長期記憶系統的建立與維護 skill。讓 CLI | `hooks/hooks.json` 的 `PostCompact` hook | harness 自動 | 壓縮**後**把 harness 產生的摘要存成一則 `daily` 記憶,作為該段落的濃縮備份 | | `hooks/hooks.json` 的 `SessionEnd` hook | harness 自動 | 工作階段結束時釋放**本階段名下所有**角色單一載入鎖(點名換過人時可能不只一個),並清掉階段角色狀態;鎖不屬於自己時不動作 | | cron 排程(本 skill 安裝) | 系統排程 | 睡眠時段每小時檢查一次:**有 AI 在運行就不睡**;另可依 CLI 閒置時間自動小睡整理 | -| 本 skill `/jsc-generic:role` | 使用者/助理手動 | `--new`/`--use`/`--list`/`--export`/`--agent`/`--migrate`/`--sleep`/`--brief`/`--status`/`--install-cron`/`--forget-preview` | +| 本 skill `/jsc-shared:role` | 使用者/助理手動 | `--new`/`--use`/`--list`/`--export`/`--agent`/`--migrate`/`--sleep`/`--brief`/`--status`/`--install-cron`/`--forget-preview` | | `scripts/role/role_load.sh` | SessionStart hook | 角色與記憶載入;參考 OpenClaw 的 SOUL/AGENTS/USER/MEMORY 分層,把人格、操作邊界、使用者記憶分開注入,並提供第一則回覆問候提示(單一實作,避免漂移) | | `scripts/role/role_call.sh` | UserPromptSubmit hook | 點名比對與即時角色切換;睡眠時段、目標角色被別的階段佔用、點的是目前已在的角色時都不切換 | | `scripts/role/role_context.sh` | role_load/role_call 共用 | 人格+操作規則+記憶+同伴清單+近期對話的注入內容組裝(單一實作,兩種載入方式不會漂移) | @@ -41,13 +41,13 @@ description: 角色人格與長期記憶系統的建立與維護 skill。讓 CLI | `--new`/`--use`/`--sleep` 等模式 | ✅ | ⚠️ 需 plugin 目錄保留 `scripts/` | ⚠️ 同左 | ❌ 只複製 `skills/`,無腳本 | ⚠️ 同左 | | 濃縮/整理 CLI | `claude -p` | `codex exec` | `agy -p` | `opencode run` | `copilot -p` | -- **`hooks/hooks.json` 只有 Claude Code 一定會讀**;Codex 會從 `~/.codex/plugins/cache/generic/jsc-generic` 找腳本。其他助理若提供等效 hook,`transcript.js` 需補對應解析器。 +- **`hooks/hooks.json` 只有 Claude Code 一定會讀**;Codex 會從 `~/.codex/plugins/cache/shared/jsc-shared` 找腳本。其他助理若提供等效 hook,`transcript.js` 需補對應解析器。 - 不支援 hook 的助理仍可用:cron 排程與手動模式照常運作,只是角色不會自動載入。 -- **每個 plugin 只註冊自己擁有的 hook**:`jsc-code`/`jsc-doc`/`jsc-generic` 的 plugin 名稱各自獨立,Claude Code 以 plugin 名稱為鍵註冊 hooks,因此三者互不覆蓋、也不需要同步。各 repo 的 `hooks/hooks.json` 只負責自己擁有的腳本: +- **每個 plugin 只註冊自己擁有的 hook**:`jsc-code`/`jsc-doc`/`jsc-shared` 的 plugin 名稱各自獨立,Claude Code 以 plugin 名稱為鍵註冊 hooks,因此三者互不覆蓋、也不需要同步。各 repo 的 `hooks/hooks.json` 只負責自己擁有的腳本: | plugin | hooks.json 內容 | 擁有的腳本 | | --- | --- | --- | - | `jsc-generic` | `SessionStart`(role_load)+ `UserPromptSubmit`(role_call)+ `Stop`/`PreCompact`/`PostCompact`(role_capture)+ `SessionEnd`(role_unload) | `scripts/role/` | + | `jsc-shared` | `SessionStart`(role_load)+ `UserPromptSubmit`(role_call)+ `Stop`/`PreCompact`/`PostCompact`(role_capture)+ `SessionEnd`(role_unload) | `scripts/role/` | | `jsc-doc` | `Stop`(worklog) | `scripts/worklog/` | | `jsc-code` | 無 `hooks/hooks.json` | 無 hook 腳本 | @@ -74,11 +74,11 @@ ROLE_DIR="/../../scripts/role" # 其他助理 ## 共用規範(必要前置) -執行本 skill 前,先以 Skill 工具載入下列共用規範並全程遵守;**任一載入不到時先詢問使用者是否安裝 generic plugin(`https://gitea.jsc.idv.tw/plugins/generic.git`),不安裝則中斷**: +執行本 skill 前,先以 Skill 工具載入下列共用規範並全程遵守;**任一載入不到時先詢問使用者是否安裝 shared plugin(`https://gitea.jsc.idv.tw/plugins/shared.git`),不安裝則中斷**: -- `/jsc-generic:spec-output`:繁體中文(台灣用語)、UTF-8 無 BOM、表格與 Mermaid 優先。 -- `/jsc-generic:spec-execution`:自動執行原則(必要決策才中斷)、不臆測。 -- `/jsc-generic:spec-time-log`:時間戳固定 Asia/Taipei `yyyy/MM/dd HH:mm:ss`;訊息格式 `[時間][階段][等級]: 訊息`、一行一則。 +- `/jsc-shared:spec-output`:繁體中文(台灣用語)、UTF-8 無 BOM、表格與 Mermaid 優先。 +- `/jsc-shared:spec-execution`:自動執行原則(必要決策才中斷)、不臆測。 +- `/jsc-shared:spec-time-log`:時間戳固定 Asia/Taipei `yyyy/MM/dd HH:mm:ss`;訊息格式 `[時間][階段][等級]: 訊息`、一行一則。 本 skill 特有補充: @@ -137,7 +137,7 @@ ROLE_DIR="/../../scripts/role" # 其他助理 | `ROLE_SCOPE` | | 冒號分隔的路徑前綴,僅這些路徑下的 session 載入/記錄 | 全部 session | | `ROLE_ERRLOG` | | 錯誤訊息額外寫入的檔案路徑 | 只走 stderr | -> 角色切換用 `/jsc-generic:role --use <角色 ID>`(寫 `.active`)即可,一般不需要設 `ROLE_NAME`;`ROLE_NAME` 適合「單一專案固定用某角色」時寫進該環境,也是**同時跟多個角色對話**的做法(每個終端一個 `ROLE_NAME`)。角色 ID 是英文大寫語意前綴加數字索引,例如 `ENGINEER01`、`MUSE02`。對話進行中要臨時換人則用下一節的點名載入。若很在意額度,優先調低 `ROLE_LOAD_LIMIT` 或設 `ROLE_CAPTURE_ENABLED=0`。 +> 角色切換用 `/jsc-shared:role --use <角色 ID>`(寫 `.active`)即可,一般不需要設 `ROLE_NAME`;`ROLE_NAME` 適合「單一專案固定用某角色」時寫進該環境,也是**同時跟多個角色對話**的做法(每個終端一個 `ROLE_NAME`)。角色 ID 是英文大寫語意前綴加數字索引,例如 `ENGINEER01`、`MUSE02`。對話進行中要臨時換人則用下一節的點名載入。若很在意額度,優先調低 `ROLE_LOAD_LIMIT` 或設 `ROLE_CAPTURE_ENABLED=0`。 --- @@ -481,7 +481,7 @@ crontab 條目指向的是 `~/.roles/bin/role_sleep_launcher.sh`,這支啟動 解析順序為 Claude Code 端 → Codex 端,各自取版本號最大者(`sort -V`),都找不到才退回安裝當下的路徑: ```bash -ls -d "$HOME"/.claude/plugins/cache/*/jsc-generic/*/scripts/role/role_sleep.sh | sort -V | tail -n 1 +ls -d "$HOME"/.claude/plugins/cache/*/jsc-shared/*/scripts/role/role_sleep.sh | sort -V | tail -n 1 ``` 舊版安裝的排程仍是寫死路徑,`--status` 的「排程指向」欄位會標示出來,重跑一次 `--install-cron` 即可轉換。 @@ -576,7 +576,7 @@ updated: `~/.roles/.active` 只放一行角色 ID,代表目前啟用的角色。 -## 共用行為(所有角色一致,由 /jsc-generic:role 維護,請勿手動修改) +## 共用行為(所有角色一致,由 /jsc-shared:role 維護,請勿手動修改) 以下規則**不寫入角色檔** —— 由 `role_context.sh` 直接注入 context(實際生效處,SessionStart 載入與點名載入共用同一份)。 本節是它的唯一文件來源,修改注入內容時必須同步更新這裡。 @@ -901,7 +901,7 @@ Stop hook 會在本輪對話明確包含個人記憶保存同意或拒絕時, | 助理 | 呼叫 | | --- | --- | -| Claude Code / Antigravity | `/jsc-generic:role --new`、`/jsc-generic:role --use ENGINEER01`、`/jsc-generic:role --list`、`/jsc-generic:role --sleep`、`/jsc-generic:role --status` | +| Claude Code / Antigravity | `/jsc-shared:role --new`、`/jsc-shared:role --use ENGINEER01`、`/jsc-shared:role --list`、`/jsc-shared:role --sleep`、`/jsc-shared:role --status` | | Codex | `$role --status`,或用 `/skills` 選單;匯出可用 `$role --export /path/to/exports/` | | OpenCode / GitHub Copilot | 需完整 plugin 目錄保留 `scripts/`;OpenCode 以複製 `skills/` 安裝時不可用 | diff --git a/skills/spec-action-params/SKILL.md b/skills/spec-action-params/SKILL.md index 797d1bc..65c0467 100644 --- a/skills/spec-action-params/SKILL.md +++ b/skills/spec-action-params/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-action-params -description: JSC plugins 共用「Gitea/GitHub action 參數來源優先序」:開發 action 需要新參數時,先取 gitea/github context(composite)或 runner 注入的 GITHUB_*/GITEA_* 執行期環境變數(docker),取不到才經使用者同意新增 inputs;secrets/vars 在 action 內一律視為不可用,需要時宣告為 input 由呼叫端 workflow 傳入。當其他 skill 內文引用 spec-action-params 或 /jsc-generic:spec-action-params、或開發 composite/docker action 需要決定參數來源時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「Gitea/GitHub action 參數來源優先序」:開發 action 需要新參數時,先取 gitea/github context(composite)或 runner 注入的 GITHUB_*/GITEA_* 執行期環境變數(docker),取不到才經使用者同意新增 inputs;secrets/vars 在 action 內一律視為不可用,需要時宣告為 input 由呼叫端 workflow 傳入。當其他 skill 內文引用 spec-action-params 或 /jsc-shared:spec-action-params、或開發 composite/docker action 需要決定參數來源時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-action-params — 共用 action 參數來源優先序 diff --git a/skills/spec-doc-funcs-handoff/SKILL.md b/skills/spec-doc-funcs-handoff/SKILL.md index eca4baa..826589c 100644 --- a/skills/spec-doc-funcs-handoff/SKILL.md +++ b/skills/spec-doc-funcs-handoff/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-doc-funcs-handoff -description: JSC plugins 共用「串接 funcs 文件化流程」規範:code 類 skill(action 標準化、Dockerfile 整理)完成主要工作後,對整個目標專案完整執行 /jsc-doc:funcs(前置可用性檢查、完整流程步驟、由使用者裁示實作方式、完成後統一時間戳)。當其他 skill 內文引用 spec-doc-funcs-handoff 或 /jsc-generic:spec-doc-funcs-handoff、或某 skill 的最後階段要完整執行 funcs 補文件並重建 README 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「串接 funcs 文件化流程」規範:code 類 skill(action 標準化、Dockerfile 整理)完成主要工作後,對整個目標專案完整執行 /jsc-doc:funcs(前置可用性檢查、完整流程步驟、由使用者裁示實作方式、完成後統一時間戳)。當其他 skill 內文引用 spec-doc-funcs-handoff 或 /jsc-shared:spec-doc-funcs-handoff、或某 skill 的最後階段要完整執行 funcs 補文件並重建 README 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-doc-funcs-handoff — 共用「串接 funcs」流程 @@ -14,6 +14,6 @@ code 類 skill 完成主要工作(action 標準化、容器化、Dockerfile - funcs 會把 `action.yml`/`Dockerfile`/`entrypoint.sh`/`docker-compose*` 等視為指令檔/CI/部署設定檔處理:補齊「用途+更新日期同一註解區塊」與逐行註解;`steps` 引用的腳本(`*.sh`/`*.ps1` 等)逐行註解;專案內各 function 補文件註解。 - funcs 的「如何實作」詢問(全部一起/逐個/其他)由使用者於該流程內裁示,呼叫端 skill **不代為決定**。 - 完成後依 funcs 規範重建根目錄 `README.md`(含台灣時區更新時間、專案列表、功能列表、使用範例)。 -- **統一時間戳**:funcs 全部完成後,以完成當下的 Asia/Taipei 時間(`yyyy/MM/dd HH:mm:ss`)回頭同步呼叫端 skill 產生的各處時間戳(橫幅 step/`entrypoint.sh`/標頭註解區塊/README),**確保各處一致**(格式見 `/jsc-generic:spec-time-log`)。 +- **統一時間戳**:funcs 全部完成後,以完成當下的 Asia/Taipei 時間(`yyyy/MM/dd HH:mm:ss`)回頭同步呼叫端 skill 產生的各處時間戳(橫幅 step/`entrypoint.sh`/標頭註解區塊/README),**確保各處一致**(格式見 `/jsc-shared:spec-time-log`)。 > 銜接方式:在呼叫端 skill 環境中以 `/jsc-doc:funcs`(或 Skill 工具)啟動 funcs 流程;若該流程需參數,沿用呼叫端 skill 的目標專案根目錄。 diff --git a/skills/spec-dockerfile/SKILL.md b/skills/spec-dockerfile/SKILL.md index a6a83ed..a689855 100644 --- a/skills/spec-dockerfile/SKILL.md +++ b/skills/spec-dockerfile/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-dockerfile -description: JSC plugins 共用「Dockerfile 六步流程」:參數處理 → 安裝套件 → 複製檔案 → 執行程序 → 縮小映像檔 → 設定入口,以多階段建置縮小最終映像、ARG 集中檔首、相依描述先 COPY 以利 layer 快取、COPY --from 逐項明列、.dockerignore、對外契約不變與自我檢查。當其他 skill 內文引用 spec-dockerfile 或 /jsc-generic:spec-dockerfile、或需要產生/重整 Dockerfile 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「Dockerfile 六步流程」:參數處理 → 安裝套件 → 複製檔案 → 執行程序 → 縮小映像檔 → 設定入口,以多階段建置縮小最終映像、ARG 集中檔首、相依描述先 COPY 以利 layer 快取、COPY --from 逐項明列、.dockerignore、對外契約不變與自我檢查。當其他 skill 內文引用 spec-dockerfile 或 /jsc-shared:spec-dockerfile、或需要產生/重整 Dockerfile 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-dockerfile — 共用 Dockerfile 六步流程 diff --git a/skills/spec-execution/SKILL.md b/skills/spec-execution/SKILL.md index d52ce77..5e68125 100644 --- a/skills/spec-execution/SKILL.md +++ b/skills/spec-execution/SKILL.md @@ -1,11 +1,11 @@ --- name: spec-execution -description: JSC plugins 共用「執行原則」:自動執行原則(簡短計畫後直接執行到完成、只在必要決策中斷)、不臆測/需人工確認、不擴及無關檔案(排除 node_modules/.git/.docs/bin/obj/第三方依賴)。當其他 skill 內文引用 spec-execution 或 /jsc-generic:spec-execution、或執行任何 JSC skill 需要共用執行原則時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「執行原則」:自動執行原則(簡短計畫後直接執行到完成、只在必要決策中斷)、不臆測/需人工確認、不擴及無關檔案(排除 node_modules/.git/.docs/bin/obj/第三方依賴)。當其他 skill 內文引用 spec-execution 或 /jsc-shared:spec-execution、或執行任何 JSC skill 需要共用執行原則時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-execution — 共用執行原則 -所有 JSC skills(code/doc/generic)的執行行為,一律遵守以下原則。 +所有 JSC skills(code/doc/shared)的執行行為,一律遵守以下原則。 ## 自動執行原則 diff --git a/skills/spec-git-safety/SKILL.md b/skills/spec-git-safety/SKILL.md index 7191c59..7835cbd 100644 --- a/skills/spec-git-safety/SKILL.md +++ b/skills/spec-git-safety/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-git-safety -description: JSC plugins 共用「Git 安全操作規範」:不破壞既有工作(未提交變更先提醒、絕不 reset --hard/checkout -f/clean)、git mv 保留歷史、develop → master 後備分支選擇、pull --ff-only、保守解衝突。當其他 skill 內文引用 spec-git-safety 或 /jsc-generic:spec-git-safety、或執行任何會操作 git 工作區/分支的 JSC skill 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「Git 安全操作規範」:不破壞既有工作(未提交變更先提醒、絕不 reset --hard/checkout -f/clean)、git mv 保留歷史、develop → master 後備分支選擇、pull --ff-only、保守解衝突。當其他 skill 內文引用 spec-git-safety 或 /jsc-shared:spec-git-safety、或執行任何會操作 git 工作區/分支的 JSC skill 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-git-safety — 共用 Git 安全操作規範 diff --git a/skills/spec-gitea/SKILL.md b/skills/spec-gitea/SKILL.md index e23f828..46f04a2 100644 --- a/skills/spec-gitea/SKILL.md +++ b/skills/spec-gitea/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-gitea -description: JSC plugins 共用「Gitea 工具規範」:tea 或 Gitea REST API + GITEA_TOKEN 的工具選擇與可用性檢查、token 機密保護(不 echo、遮蔽、不落地)、不依賴 jq、API 呼叫慣例(分頁完整讀取、UTF-8 JSON body、實際換行)、gitea 主機決定順序。當其他 skill 內文引用 spec-gitea 或 /jsc-generic:spec-gitea、或執行任何需存取 Gitea 的 JSC skill 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「Gitea 工具規範」:tea 或 Gitea REST API + GITEA_TOKEN 的工具選擇與可用性檢查、token 機密保護(不 echo、遮蔽、不落地)、不依賴 jq、API 呼叫慣例(分頁完整讀取、UTF-8 JSON body、實際換行)、gitea 主機決定順序。當其他 skill 內文引用 spec-gitea 或 /jsc-shared:spec-gitea、或執行任何需存取 Gitea 的 JSC skill 時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-gitea — 共用 Gitea 工具規範 @@ -49,7 +49,7 @@ description: JSC plugins 共用「Gitea 工具規範」:tea 或 Gitea REST API - API base:`https:///api/v1`(repo 層:`https:///api/v1/repos//`)。 - 標頭:`Authorization: token $GITEA_TOKEN`。 - **分頁必須完整讀取**:持續累加 `page` 直到回傳筆數 `< limit`(或回空陣列)為止,不可只取第一頁。 -- 寫入(議題描述/留言/PR body)以 **UTF-8 JSON 檔**帶入(如 `--data @body.json`);換行必須是**實際換行**,不可讓內容顯示字面 `\n`(編碼細節見 `/jsc-generic:spec-output`)。 +- 寫入(議題描述/留言/PR body)以 **UTF-8 JSON 檔**帶入(如 `--data @body.json`);換行必須是**實際換行**,不可讓內容顯示字面 `\n`(編碼細節見 `/jsc-shared:spec-output`)。 - API 失敗(401/403/網路錯誤)→ 回報錯誤(**遮蔽 token**)並停止;401/403 多半是 token 失效或權限不足。 - 版本相依端點(project/column/dependency 等)先以 GET 探測(404/501 視為不支援),**不得對未確認存在的端點做寫入**。 diff --git a/skills/spec-output/SKILL.md b/skills/spec-output/SKILL.md index 3a4d250..1320afc 100644 --- a/skills/spec-output/SKILL.md +++ b/skills/spec-output/SKILL.md @@ -1,11 +1,11 @@ --- name: spec-output -description: JSC plugins 共用「輸出規範」:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、優先以 Markdown 表格與 Mermaid 圖呈現。當其他 skill 內文引用 spec-output 或 /jsc-generic:spec-output、或執行任何 JSC skill 需要語言/編碼/呈現規範時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「輸出規範」:繁體中文(台灣用語)、UTF-8(不含 BOM)無亂碼、優先以 Markdown 表格與 Mermaid 圖呈現。當其他 skill 內文引用 spec-output 或 /jsc-shared:spec-output、或執行任何 JSC skill 需要語言/編碼/呈現規範時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-output — 共用輸出規範 -所有 JSC skills(code/doc/generic)面向使用者的輸出與寫入檔案,一律遵守以下規範。 +所有 JSC skills(code/doc/shared)面向使用者的輸出與寫入檔案,一律遵守以下規範。 ## 語言 diff --git a/skills/spec-plugin-version/SKILL.md b/skills/spec-plugin-version/SKILL.md index 68c53c8..5341b74 100644 --- a/skills/spec-plugin-version/SKILL.md +++ b/skills/spec-plugin-version/SKILL.md @@ -1,11 +1,11 @@ --- name: spec-plugin-version -description: JSC plugins 共用「plugin 版號規則」:三個 manifest(plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json)同步 bump 且版本一致、bump 前對照發佈分支(master)現行版本確保單調遞增、同一 PR 只以 master 版本計算一次最終升版、新 plugin 首發 0.0.1、plugin 更名(name 欄位改變)視為新 plugin 並把版號重置為 0.0.1、一般變更 patch +1 且 master patch 到 9 後才進位 minor(0.0.9 → 0.1.0)、commit 訊息用 chore(plugin 版本)。當其他 skill 內文引用 spec-plugin-version 或 /jsc-generic:spec-plugin-version、或要調整任一 JSC plugin(jsc-code/jsc-doc/jsc-generic)的版本號時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「plugin 版號規則」:三個 manifest(plugin.json、.claude-plugin/plugin.json、.codex-plugin/plugin.json)同步 bump 且版本一致、bump 前對照發佈分支(master)現行版本確保單調遞增、同一 PR 只以 master 版本計算一次最終升版、新 plugin 首發 0.0.1、plugin 更名(name 欄位改變)視為新 plugin 並把版號重置為 0.0.1、一般變更 patch +1 且 master patch 到 9 後才進位 minor(0.0.9 → 0.1.0)、commit 訊息用 chore(plugin 版本)。當其他 skill 內文引用 spec-plugin-version 或 /jsc-shared:spec-plugin-version、或要調整任一 JSC plugin(jsc-code/jsc-doc/jsc-shared)的版本號時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-plugin-version — 共用 plugin 版號規則 -調整任一 JSC plugin(`jsc-code`/`jsc-doc`/`jsc-generic` 等)的版本號時,一律遵守以下規則。 +調整任一 JSC plugin(`jsc-code`/`jsc-doc`/`jsc-shared` 等)的版本號時,一律遵守以下規則。 ## 三個 manifest 同步 bump diff --git a/skills/spec-project-board/SKILL.md b/skills/spec-project-board/SKILL.md index a66adb1..f1415ce 100644 --- a/skills/spec-project-board/SKILL.md +++ b/skills/spec-project-board/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-project-board -description: JSC plugins 共用「Gitea 專案看板進度欄位規範」:欄位語意對應(分析中/待處理/進行中/待測試/已完成,以看板實際欄位名稱為準)、依需求與 TODO 勾稽結果建議欄位、先 GET 探測 project/column API(404/501 視為不支援、不對未確認端點寫入)、不往回移、不支援時改列建議清單請人工拖曳、不得新建欄位。當其他 skill 內文引用 spec-project-board 或 /jsc-generic:spec-project-board、或需要調整 Gitea 議題所在看板欄位時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「Gitea 專案看板進度欄位規範」:欄位語意對應(分析中/待處理/進行中/待測試/已完成,以看板實際欄位名稱為準)、依需求與 TODO 勾稽結果建議欄位、先 GET 探測 project/column API(404/501 視為不支援、不對未確認端點寫入)、不往回移、不支援時改列建議清單請人工拖曳、不得新建欄位。當其他 skill 內文引用 spec-project-board 或 /jsc-shared:spec-project-board、或需要調整 Gitea 議題所在看板欄位時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-project-board — 共用 Gitea 看板進度欄位規範 diff --git a/skills/spec-time-log/SKILL.md b/skills/spec-time-log/SKILL.md index d78410b..f1fa8be 100644 --- a/skills/spec-time-log/SKILL.md +++ b/skills/spec-time-log/SKILL.md @@ -1,6 +1,6 @@ --- name: spec-time-log -description: JSC plugins 共用「時間戳與輸出訊息格式規範」:更新時間一律台灣時區(Asia/Taipei)固定 yyyy/MM/dd HH:mm:ss、寫成檔內固定字串、流程完成後統一同步各處時間戳;輸出訊息統一為 [yyyy/MM/dd HH:mm:ss][階段][等級]: 訊息(等級 INF/WRN/ERR/TRC/DBG)、一行一則。當其他 skill 內文引用 spec-time-log 或 /jsc-generic:spec-time-log、或需要產生更新時間/統一 log 格式時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 +description: JSC plugins 共用「時間戳與輸出訊息格式規範」:更新時間一律台灣時區(Asia/Taipei)固定 yyyy/MM/dd HH:mm:ss、寫成檔內固定字串、流程完成後統一同步各處時間戳;輸出訊息統一為 [yyyy/MM/dd HH:mm:ss][階段][等級]: 訊息(等級 INF/WRN/ERR/TRC/DBG)、一行一則。當其他 skill 內文引用 spec-time-log 或 /jsc-shared:spec-time-log、或需要產生更新時間/統一 log 格式時載入此 skill。單獨被使用者呼叫時,直接說明本規範內容。 --- # spec-time-log — 共用時間戳與訊息格式規範