# 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` | 兩份 `marketplace.json` 的 `name`,以及安裝 token `@` 的 `` 部分 | | `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` 1. 在 `descriptionCore` 的第一個「,」或「:」之前插入 `()`。 2. 去掉尾端「。」,補上「;於 `` 以 `` 前綴呼叫。」。 ## `.codex-plugin/plugin.json` - `codexNote` 為空字串 → `description = descriptionCore`(不加助理清單、不加呼叫句,Codex 用 `$name` 不用前綴)。 - `codexNote` 非空、有 `codexNoteAnchor` → 在 `descriptionCore` 中該子字串**之後**插入 `codexNote`。 - `codexNote` 非空、無 `codexNoteAnchor` → `description = descriptionCore + codexNote`(附加在句尾)。 ## `.claude-plugin/marketplace.json` ```json { "name": shortName, "description": marketplace.repoDescription, "owner": { "name": author.name }, "plugins": [ { "name": name, "source": "./", "description": marketplace.pluginSummary } ] } ``` ## `.agents/plugins/marketplace.json`(Codex) ```json { "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` 由人工決定。