依 todo.md 執行的規範治理專案:新增 spec-preflight 等 14 個共用規範(含 conventional-commit/pull-request/git-push/issue-read/todo-list/ask-user/ subagent/no-scratch-files/skill-invocation/script-path/action-scaffold/ node-src-layout/plugin-cli/model),擴充 spec-git-safety 與 spec-gitea(token 優先序、機密遮蔽、Wiki 頁名轉義規則);新增可執行 skill `models`(模型能力 查詢與標籤)與 `todo`(依指定模型產生/附加 todo.md);新增 plugin.meta.json 單一事實來源與 gen-plugin-files.mjs 樣板產生器,統一四個 repo 的 manifest/ README/AGENTS.md 並移除寫死的本機使用者路徑;新增 shared/scripts/lib 的 log/機密遮蔽三語言參考實作。 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
3.9 KiB
3.9 KiB
5 份 manifest 產生規則 — 給 gen-plugin-files.mjs 的權威參照
來源:目標 repo 根目錄的 plugin.meta.json。以下規則把 plugin.meta.json 的欄位映射成五份實體檔案。所有規則已在 gen-plugin-files.mjs 的 build*() 函式中實作;本檔只作為人工審核時的對照文件,不是產生器實際讀取的樣板(manifest 用字串組裝,不走 .tmpl 檔案)。
共通欄位
| meta 欄位 | 用途 |
|---|---|
name |
三份 plugin.json 的 name(jsc-<shortName>) |
shortName |
兩份 marketplace.json 的 name,以及安裝 token <plugin>@<marketplace> 的 <marketplace> 部分 |
version |
三份 plugin.json 的 version,逐字複製,產生器不改版號 |
descriptionCore |
三份 plugin.json description 的共同語意基底 |
assistants |
助理清單,順序即統一決議順序:Claude Code / Codex / Antigravity / OpenCode / GitHub Copilot CLI |
cliPrefix |
例如 /jsc-code: |
callPrefixAssistants.root / .claudePlugin |
root、.claude-plugin 的 description 結尾呼叫句要指名哪個助理 |
codexNote |
.codex-plugin description 的專屬補充資訊(可為空字串) |
codexNoteAnchor(可選) |
codexNote 要插入 descriptionCore 的哪個子字串之後;缺省則整句附加在 descriptionCore 尾端 |
skillsPath |
三份 plugin.json 的 skills 欄位,統一不帶尾斜線 ./skills |
author / homepage / repository / keywords |
原樣搬進 .claude-plugin/plugin.json;repository 也用於 .agents/plugins/marketplace.json 的 source.url |
marketplace.repoDescription |
.claude-plugin/marketplace.json 的頂層 description |
marketplace.pluginSummary |
.claude-plugin/marketplace.json 的 plugins[0].description |
root plugin.json(Antigravity)
description = strip trailing "。" of descriptionCore
+ ";於 " + callPrefixAssistants.root + " 以 " + cliPrefix + " 前綴呼叫。"
skills = skillsPath
.claude-plugin/plugin.json
- 在
descriptionCore的第一個「,」或「:」之前插入(<assistants.join(' / ')>)。 - 去掉尾端「。」,補上「;於
<callPrefixAssistants.claudePlugin>以<cliPrefix>前綴呼叫。」。
.codex-plugin/plugin.json
codexNote為空字串 →description = descriptionCore(不加助理清單、不加呼叫句,Codex 用$name不用前綴)。codexNote非空、有codexNoteAnchor→ 在descriptionCore中該子字串之後插入codexNote。codexNote非空、無codexNoteAnchor→description = descriptionCore + codexNote(附加在句尾)。
.claude-plugin/marketplace.json
{
"name": shortName,
"description": marketplace.repoDescription,
"owner": { "name": author.name },
"plugins": [
{ "name": name, "source": "./", "description": marketplace.pluginSummary }
]
}
.agents/plugins/marketplace.json(Codex)
{
"name": shortName,
"plugins": [
{ "name": name, "source": { "source": "url", "url": repository } }
]
}
已知例外/已裁決的差異(不要「修正」掉)
doc的codexNoteAnchor = "並追加到 Gitea wiki":codexNote「(自動 Stop hook 僅相容 hook 環境支援)」要插在這句之後、句尾之前,不是整句附加在最後。persona/code/shared的codexNote目前分別非空/空/空,依上表規則處理,不要假設四個 repo 都一樣。marketplace名稱一律等於shortName(jsc-persona@persona,不是jsc-persona@jsc-plugins)。shared/skills/spec-plugin-cli/SKILL.md目前文中寫「persona 例外,marketplace 名是jsc-plugins」是過期資訊(persona README 已明文停用jsc-plugins這個舊名),套用本規則產生器不採用該例外,此差異已回報人工覆核,是否修正spec-plugin-cli/SKILL.md由人工決定。