現行紀錄只記「被叫用」,沒有成敗也沒有結束碼。跑完整輪的技能與開場就 中止的技能,在紀錄裡長得一模一樣。 start 由技能用量 hook 順手發,不必改技能文件。end 只能由技能自己在收尾 步驟寫——hook 接在技能工具呼叫上,而實際工作發生在之後的模型輪次,它在 原理上看不到成敗。有 start 沒有配對的 end,就是那一輪中止了。 status 五選一,每支技能各自寫明什麼情況選哪一個。找不到回報腳本就安靜 跳過,回報失敗一律不改變技能自己的結論。
14 KiB
name, description
| name | description |
|---|---|
| skillset-update | Apply one change request across the whole jsc skill set — multiple skills in multiple domains in one pass. Sync every domain repo from the Gitea canonical marketplace while the decision tree asks the change details, apply the change per affected domain via parallel sub agents, re-check against the guidelines checklist until it passes, open a PR per affected repo via jsc-git pr, then deploy and verify per references/deploy-verify.md from a fresh CLI process, and append the change report to wiki SKILLSET_{HASH}. Use when a change spans multiple skills or domains; not for a single skill (use skill-update). |
skillset-update — apply one change across the skill set
Single source of guidelines: ../../references/guidelines.md.
Flow
-
Start
tools/sync-domains.shand the change-details decision tree in parallel — the sync touches no answer the tree needs, and the tree's answers change nothing the sync does, so waiting for one before the other only adds idle time.- Run
tools/sync-domains.shto sync every domain repo of the Gitea canonical marketplace. Exit 0 is the only code that means every repo is present and current; keep thedomain<TAB>pathrows. Exit 3 means some repos were not updated: reconcile every path named on stderr (commit or stash the dirty tree, or fix the failing pull) and rerun; when the user confirms a dirty tree is intentional local work, record that decision and continue on the local version — never read exit 3 as current. Exit 2 means a domain could not be cloned. Exit 1 means the root could not be derived,gitea.shwas not found, or the canonical marketplace was unreadable; when stderr says the root could not be derived, setJSC_PLUGINS_ROOTto the directory that holds the domain repos and rerun, because under a plugin install the script sits in the CLI's plugin cache and its built-in guess lands there instead of the domain workspace. Resolve 2 and 1 before continuing. - Ask for the change details via the
jsc-ask:askdecision tree: what rule or behavior changes, which skills and which domains are affected. Include three required checks before the affected-skill list is final: whether any deterministic input/output flow must move totools/, whether any detailed flow must run as a sub agent, and whether any wiki or Gitea flow must read inherited environment variables before asking the user. Every option states its impact scope (example: changing a shared flow step touches every skill that calls it). These three are a shaping guardrail asked before any file is touched; keep asking them even when a later step would catch the same problem.
Completion condition: the
domain<TAB>pathrows are in hand, and the affected-skill list plus the three checks are agreed with the user. - Run
-
Apply the change to every affected skill — the modification part MUST run as a sub agent, one sub agent per affected domain repo, and those sub agents run in parallel: each repo's files are independent. Every sub agent also updates its own repo's
references/behaviors.mdin the same pass: a changed behavior rewrites that skill's## {name}section, a new skill gets a section inserted in dictionary order, a removed skill loses its section. Keep all five rows filled — 觸發時機、關鍵步驟、外部呼叫、完成條件、可驗證跡象. Each repo's behavior list ships in that repo's own PR, so no cross-repo PR pair has to be merged in order. Then runtools/sync-skill-manifest.sh {domain-path}directly (no sub agent needed) for each affected domain repo to sync that domain README's 「Skills 目錄」 section and bump the version in all three manifests; these runs are independent per repo and may also go in parallel. Route each exit code: 0 — the README block and all three manifests are synced; 1 — the domain path,skills/,README.md, theJSC-SKILLSmarkers, aSKILL.md, a manifest, or a manifestversionfield is missing, so fix the named cause on stderr and rerun; 2 — usage error, the script takes exactly one argument; any other code — the script runs underset -e, so treat it as an environment fault and stop, never as a successful sync. Completion condition: every affected domain repo carries the change, its behavior-list update, the README sync, and the manifest bump. -
Check every item of the guidelines.md audit checklist for each touched skill — one sub agent per affected domain repo, run in parallel. Each sub agent runs
tools/check-behaviors.sh {domain-path}for the behavior-list item of its own repo instead of comparing by eye, and routes each exit code: 0 — that repo's list matches itsskills/and all five rows are filled; 1 — every mismatch is printed on stderr as{檔案}:{技能名}:{說明}, so fix each one and rerun; 2 — usage error, the tool takes exactly one argument; 3 — nothing was checked, becausereferences/behaviors.mdis missing,skills/is missing, or noSKILL.mdwas found, so create the missing file and rerun. Exit 3 is never a pass. On any failure, return to step 1.2: ask again and fix, until all items pass. Completion condition: every checklist item passes for every touched skill, andtools/check-behaviors.shexits 0 for every affected domain repo. -
Call
jsc-git:pronce per affected domain repo to open a Push Request. Completion condition: every affected repo has a PR URL, and all URLs are reported in one table with the format in../../references/pr-report.md. -
Deploy the batch change, verify it runs, then report:
-
Follow
../../references/deploy-verify.mdfrom section 1 to section 5, once per affected domain repo — the route judgements run in parallel. The batch takes the deploy route only when every affected repo'stools/deploy-route.shexits 0; a single exit 3 puts the whole batch on the worktree route, because the change reaches the CLIs only when the last repo merges, so name every outstanding release PR. The verification then runs in a fresh CLI process, never in the session that ran the deploy: that session raised the restart gate itself and still holds the old skill bodies. Verify every touched skill's row intools/list-skills.sh, every tool this change touched, and one minimal prompt per affected domain per checkable CLI — the per-CLI and per-domain prompts run in parallel. Completion condition: every completion condition indeploy-verify.mdsections 1 to 5 holds for every affected domain repo. -
Write the change report to the wiki — this part MUST run as a sub agent, one sub agent per affected domain repo, run in parallel. Each sub agent writes two pages in two repos, and they must not be mixed up.
-
Content page
SKILLSET_{HASH}. Resolve its repo withjsc-gitea/tools/gitea.sh wiki-repo SKILLSET, which readsJSC_WIKI_REPO_SKILLSETfirst, thenJSC_WIKI_REPO.{HASH}isgitea.sh hash-id "{owner}/{repo}"of that repo, used at the full 40 characters it prints. Write it throughjsc-gitea:wikifollowing../../templates/skillset-page.md: append a section for this change — date, 「批次更新」, the change request in one line, touched skills, changed files, PR URL, the step 5.1 route verdict and verification result per item — and keep every earlier section. -
Directory page
SKILLSET_CONTENTS. One shared page holds every domain's row, so each sub agent writes only its own. It lives in the CONTENTS repo, never in the SKILLSET one:wiki-contents.shresolves it itself withgitea.sh wiki-repo CONTENTS, whose chain isJSC_WIKI_REPO_CONTENTSthenJSC_WIKI_REPOand never falls back toJSC_WIKI_REPO_SKILLSET. Build one file holding the single row from../../templates/skillset-contents.md, its 異動頁 cell written as[SKILLSET_{HASH}]({url})with the absolute URL fromgitea.sh wiki-url {SKILLSET repo} SKILLSET_{HASH}. Every link on both pages takes that[{text}]({url})form; the double-bracket wiki-link form resolves only inside one wiki, so it is never used. Then run:jsc-gitea/tools/wiki-contents.sh upsert SKILLSET 2 "{owner}/{repo}" {row file} templates/skillset-contents.mdThe key column is
2, the 存取庫 column, holding that repo's{owner}/{repo}exactly as the row file writes it, so one domain keeps exactly one row and no sibling sub agent's row moves. Never hand-edit the directory page, and never overwrite it as a whole. Write the content page first and fetch the URL only after it exists. -
Check the links before writing. Hand every URL going onto the content page and into the directory row to
jsc-gitea/tools/link-check.sh, and write only when it exits 0. It verifies through the Gitea API, never a web status code: a private repo answers 404 to an unauthenticated web request, so a status-code check would call a live page dead. -
Exit codes. Route every one of them:
Call Exit Do gitea.sh wiki-repo2 The page type was misspelled. Fix the argument and rerun 3 No wiki repo is configured for that type. Name the variable ( JSC_WIKI_REPO_SKILLSETfor the content page,JSC_WIKI_REPO_CONTENTSfor the directory page) andJSC_WIKI_REPO, ask per thejsc-ask:askrules, then rerungitea.sh hash-id1 No SHA-1 helper on this machine. Stop and report that sha1sumorshasumhas to be installed, and never hand-compute the hash2 Empty input, so the {owner}/{repo}was never resolved. Fix that firstContent page read 0 Append into the sections already there 4 The page does not exist yet, so build it from templates/skillset-page.md7 or 8 Stop and write nothing: a page rebuilt on top of an unread read loses every section already on it gitea.sh wiki-url4 The content page is not there, so the write above did not succeed. Go back and write it, and add no directory row until the page exists 5 The API answered with no html_url. Stop and report it; never assemble the URL by hand from the host and the page namelink-check.sh0 Every link is reachable. Write the page 1 At least one link is dead. Write nothing, and report the DEADlines it printed2 No URL was passed, which is a defect here. Pass the links and rerun 3 GITEA_HOSTis unset. Set it and rerun; never skip the check instead7 Gitea authentication failed. Stop and report the key problem, and never read it as a dead link wiki-contents.sh upsert0 The row is in place. Report the updatedoraddedit printed1 The write failed. Report SKILLSET_CONTENTSas not written, together with the row content2 An argument was rejected. Fix it and rerun; nothing was written 3 No CONTENTS wiki repo is configured. Report JSC_WIKI_REPO_CONTENTSandJSC_WIKI_REPOas the two variables to set; the new section is onSKILLSET_{HASH}and stays there4 The directory page is absent and no template was passed. Rerun with templates/skillset-contents.mdas the fifth argument7 The token is invalid or lacks permission, so the other domains' rows are unknown. Stop, report the token problem, and create no page 8 Some other API failure. Stop, report that status, and create no page
On any failure, hand the page name and the unwritten entry back to the user and leave this step open; never close the flow on an unwritten report. Completion condition: every affected repo's
SKILLSET_{HASH}holds the new section plus all earlier sections, and every one of those repos has a row onSKILLSET_CONTENTSwritten by awiki-contents.sh upsertthat exited 0, linking its page by absolute URL. -
-
-
Report this run's outcome to the local event stream — the last step of every run, the ones that stop early included. One event for the whole batch, not one per domain. Run:
jsc-hooks/tools/report-status.sh skill-end jsc-meta:skillset-update {status} {exit code} [detail]Resolve
jsc-hooksfrom thedomain<TAB>pathrow step 1.1 printed for thehooksdomain, the same way this skill resolves every other cross-plugin script. When that script is not on this machine, skip this step in silence and close the run as normal. A reporting path that is absent must never fail the run it reports on, and this call's own exit code never changes what this skill reports.Pick
{status}from what the run actually did:status Use it when okevery affected repo carries the change and its behavior-list update, every checklist passes, every repo has a PR URL, deploy-verify.mdsections 1 to 5 hold for all of them, and every wiki write exited 0blockeda gate or a missing prerequisite stopped the run before any file changed — sync-domains.shnever reached exit 0, or the affected-skill list was never agreedfailedthe run broke mid-way — the step 3 checklist loop kept failing for some repo, or a wiki write failed again after its one retry degradedpart of the batch landed and part did not — some repos got their PR and others did not, or a content page was written while its SKILLSET_CONTENTSrow was not. Name the repos indetailabortedthe user stopped the run, or a prerequisite turned out not to hold and this skill stopped on its own {exit code}is this run's own result as a number:0forok, non-zero otherwise.detailis optional, one line, at most 200 characters.The matching
skill-startcomes free from the hook, which fires when the skill loads. The batch itself happens in the model turns after that, so no hook can see how the run ended — astartwith noendreads as an abort, which is why writing theendis this skill's own job.Completion condition: one
skill-endline for this run is appended to$JSC_HOME/usage/events.jsonl, or the script was absent and the final report says so.