From 17329a94d39bdd30608419add4abdc1612673173 Mon Sep 17 00:00:00 2001 From: Jeffery Date: Tue, 25 Aug 2026 16:56:22 +0800 Subject: [PATCH] =?UTF-8?q?feat(cli):=20=E6=96=B0=E5=A2=9E=20delegate=20?= =?UTF-8?q?=E5=AD=90=E4=BB=A3=E7=90=86=E6=8A=80=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .claude-plugin/plugin.json | 4 ++-- .codex-plugin/plugin.json | 4 ++-- README.md | 4 ++++ plugin.json | 4 ++-- skills/delegate/SKILL.md | 37 +++++++++++++++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 skills/delegate/SKILL.md diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json index bdfe30a..0d27e69 100644 --- a/.claude-plugin/plugin.json +++ b/.claude-plugin/plugin.json @@ -1,7 +1,7 @@ { "name": "jsc-cli", - "version": "0.0.8", - "description": "CLI 偵測、模型能力標籤與技能庫批次部署", + "version": "0.1.0", + "description": "CLI 偵測、模型能力標籤、子代理派工與技能庫批次部署", "skills": "./skills", "author": { "name": "JSC" diff --git a/.codex-plugin/plugin.json b/.codex-plugin/plugin.json index a364fdd..f58b51a 100644 --- a/.codex-plugin/plugin.json +++ b/.codex-plugin/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-cli", - "version": "0.0.8", - "description": "CLI 偵測、模型能力標籤與技能庫批次部署", + "version": "0.1.0", + "description": "CLI 偵測、模型能力標籤、子代理派工與技能庫批次部署", "skills": "./skills" } diff --git a/README.md b/README.md index 4445e9c..e5b4927 100644 --- a/README.md +++ b/README.md @@ -38,6 +38,10 @@ Marketplace 統一為 `jsc`(https://gitea.jsc.idv.tw/plugins/meta.git),安 用 `tools/list-models.sh` 讀出各已安裝 CLI 可使用的模型並加上能力標籤(`references/model-tags.md`),用 `tools/model-tags.sh sync` 把標籤表寫進 `$JSC_HOME/model-tags.tsv` 供 sdlc-gate 讀取,列出 SDLC 各階段的必要標籤(plan、analyze 需 `reasoning-max`;implement 需 `coding`;maintain 任意),並用 `tools/model-config.sh` 列出各階段的偏好模型鏈。`jsc-sdlc` 閘門一律以能力標籤判定,偏好鏈只用來建議切換目標。 +### `delegate` + +把單一明確任務交給另一個已安裝的 AI agent CLI 當作 subagent 執行。可指定目標 CLI,也可依任務需求用能力標籤篩選模型,或強制指定模型。每個目標分開派工,預設只讀,並回傳結構化結果供主 agent 驗證與彙整。此技能不負責模型盤點或 plugin 部署。 + ### `deploy` 技能庫批次安裝、更新、解除安裝:偵測 CLI → **先比對各 plugin 的本機與已發佈版本並列表,只要有任一個落後就把「更新」設為推薦選項** → 決策樹選模式 → 每個 CLI 一個 sub agent 呼叫 `tools/deploy.sh` 執行原生 plugin 指令(統一 marketplace `jsc`,token `jsc-{domain}@jsc`)。domain 名單動態取自 `plugins/meta` 的 marketplace.json,不硬編碼。 diff --git a/plugin.json b/plugin.json index ea1cba8..6029883 100644 --- a/plugin.json +++ b/plugin.json @@ -1,6 +1,6 @@ { "name": "jsc-cli", - "version": "0.0.8", - "description": "CLI 偵測、模型能力標籤與技能庫批次部署", + "version": "0.1.0", + "description": "CLI 偵測、模型能力標籤、子代理派工與技能庫批次部署", "skills": "./skills/" } diff --git a/skills/delegate/SKILL.md b/skills/delegate/SKILL.md new file mode 100644 index 0000000..068344e --- /dev/null +++ b/skills/delegate/SKILL.md @@ -0,0 +1,37 @@ +--- +name: delegate +description: Delegate a single bounded task to another installed AI agent CLI as a subagent, with an explicit target CLI, required capability tags, or a forced model. Use when another CLI should do the work and return structured results; not for model inventory, plugin deployment, or tasks that must stay in the current agent. +--- + +# delegate — hand a task to another CLI + +Use this skill when the work should move to another installed AI agent CLI instead of staying in the current agent. + +## Steps + +1. Split the request into one bounded goal. One goal means one subagent. +2. Detect the installed AI agent CLIs. Use only a target CLI that is actually present. +3. Choose the execution model. + - If the user names a CLI, keep only that CLI. + - If the user gives capability tags, keep only models that satisfy all tags. + - If the user forces a model, use that exact model and fail if it does not satisfy the tags. +4. Build the subagent prompt. + - Include the goal, the acceptance criteria, the target CLI, the model choice, and the minimum needed context. + - Include `/jsc-shared:spec-output`. + - State the write scope clearly. If no write scope is granted, say the subagent is read-only. +5. Spawn one subagent for the goal. Do not mix unrelated goals in the same subagent. +6. Verify the result before you report it. + - Check the exit status. + - Check that the return value is structured. + - Check that the result covers the acceptance criteria. + - Check that any writes stayed inside the allowed scope. +7. Report the verified result. + - State the CLI, the model, the capability tags, and the outcome. + - Separate success, failure, and anything that still needs user input. + +## Do not use this skill + +- Do not use it for model inventory. +- Do not use it for plugin deployment. +- Do not use it for tasks that must stay inside the current agent. +- Do not use it when the task is not bounded enough to hand off cleanly.