setup
Verify the discovery plugin's runtime prerequisites for this session, print the gate allow rules for the operator to paste so the acceptance-gate scripts stop prompting, and write the repository's docs/conventions/discovery.yaml after confirmation. Use when: 'set up discovery', 'configure the discovery plugin', 'is discovery configured', 'discovery setup', 'the research gates keep prompting', 'set explore_output for this repo', or a discovery skill reports a missing capability. Actions: check (read-only, default), apply (writes docs/conventions/discovery.yaml). Re-runnable.
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- description
- Verify the discovery plugin's runtime prerequisites for this session, print the gate allow rules for the operator to paste so the acceptance-gate scripts stop prompting, and write the repository's docs/conventions/discovery.yaml after confirmation. Use when: 'set up discovery', 'configure the discovery plugin', 'is discovery configured', 'discovery setup', 'the research gates keep prompting', 'set explore_output for this repo', or a discovery skill reports a missing capability. Actions: check (read-only, default), apply (writes docs/conventions/discovery.yaml). Re-runnable.
- argument-hint
- [check|apply] [<key>=<value> ...]
- user-invocable
- true
- disable-model-invocation
- true
02 资源文件 5
- 参考文档evals/evals.json5.5 KB
- 脚本scripts/parse-concern-value.sh5.0 KB
- 脚本scripts/setup-apply.mjs807 B
- 脚本scripts/setup-apply.test.sh17.4 KB
- 脚本scripts/yaml-subset.awk9.7 KB
03 SKILL.md 正文
Purpose
Report whether this session can run the discovery plugin's dispatch design, and print the permission
rules that stop the acceptance-gate scripts prompting on every run. Artifact placement needs no
configuration: the plugin's artifact protocol
(${CLAUDE_PLUGIN_ROOT}/reference/artifact-protocol.md)
fixes where EXPLORE.md, RESEARCH.md and INTENT.md land, in the memory slice
<memory_dir>/<slug>/, never committed.
The plugin owns one tracked consumer file, docs/conventions/discovery.yaml, the repository layer
of its settings (keys, values and layers:
${CLAUDE_PLUGIN_ROOT}/reference/config.md; schema:
${CLAUDE_PLUGIN_ROOT}/schemas/discovery.schema.json). check reports it; apply writes it,
plus, on the operator's yes to the convention-home offer, the instruction-file region and the
.gitignore line (apply step 5). The harness rows and the operator's ~/.claude/settings.json are reported only, never
written. Action routing: no argument or check runs the check; apply runs the check, then
writes. Re-running either reads the current state again.
check (read-only)
Report a PASS/INFO/WARN table. Do not write anything. No row is ever a FAIL or a blocker.
-
Dispatch capability.
/discovery:exploreand/discovery:researchdispatch a subagent by default, and that posture degrades rather than breaks on a session that cannot support all of it. Report these as PASS/INFO rows:- Harness version against the 2.1.219 floor (
claude --version). Below it, several behaviors the dispatch design relies on are false rather than merely absent: background became the default subagent execution mode in 2.1.198, and below 2.1.218 acontext: forkskill always blocked the invoking turn and the narrow background tool set did not apply to it. The dated record for background as the default is${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md, "Harness facts the dispatch design rests on". Report the observed version and, when it is under the floor, name which of those the session does not have. The skills still run, inline is always available, so this is INFO, not FAIL. CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH. Report the value, present or absent, and say what the running harness does with it rather than assuming. Read absent against the observed version, in four windows: below 2.1.172 nesting does not exist and the variable buys nothing; 2.1.172 to 2.1.216 absent means available at a fixed five; 2.1.217 to 2.1.218 absent means off, and setting the variable is the only way to turn nesting on; 2.1.219 and later absent means available at a configurable default of three, and the variable lowers the ceiling ("1"disables nesting) as readily as it raises one. For the current default and the variable's version history, see Let subagents spawn their own subagents and the variable's row in env vars. As of 2026-10-02; recheck when the default or the version history changes. Report absent as INFO in every window: nesting buys throughput, not coverage, without it a dispatched agent fans out sequentially, slower for the same result. The variable is still only one of two conditions: it cannot add a tool an agent definition left out. The shippeddiscovery:explorer/discovery:researcherdefinitions listAgentfor exactly this reason; a third-party agent that does not is unaffected by setting it. It is not a correctness prerequisite here, because the one control that needs a context which has not seen the work is the outcome-gate verifier, and the parent dispatches that as a sibling rather than the agent as a child. Note that a shell env var is read at session start, so a value exported now takes effect next session. Whether a settings-fileenvvalue reaches a running session is env vars: set variables in settings files's to state.- Fork availability. Report it as a control, not a gate. Report
CLAUDE_CODE_FORK_SUBAGENTwhen set; when unset, read the default for the observed version and session kind (interactive,claude -p, the SDK) from the pointer below and report that, never one remembered here. A default is not a runtime guarantee, so the only authoritative probe is still a live inheritance check (seediscipline:sweep-all's preflight); never claim forks are unconditionally available on every build. Name the command that starts a fork by hand as the pointer's fork section gives it.- Pointer: Turn fork mode off for the default and the versions it changed in; Fork the current conversation for the command that starts a fork by hand; the variable's row in env vars for what each value does.
- Harness version against the 2.1.219 floor (
-
Gate allow rules. The acceptance-gate scripts prompt on every run unless the operator's
~/.claude/settings.jsonallows them. Read itspermissions.allow(a missing file or key reads as no rules; read only, never write) and compare it with these twelve rules for this install root:Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-dispatch-artifact.sh" *) Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-coverage-complete.sh" *) Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-source-applicability.py" *) Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-restatement-labels.py" *) Bash("${CLAUDE_PLUGIN_ROOT}/scripts/check-author-kind.py" *) Bash(python3 "${CLAUDE_PLUGIN_ROOT}/scripts/check-claim-eligibility.py" *) Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-dispatch-artifact.sh *) Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-coverage-complete.sh *) Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-source-applicability.py *) Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-restatement-labels.py *) Bash(${CLAUDE_PLUGIN_ROOT}/scripts/check-author-kind.py *) Bash(python3 ${CLAUDE_PLUGIN_ROOT}/scripts/check-claim-eligibility.py *)Report one row, never FAIL: PASS when all twelve are present for this install root; INFO "stale" when gate rules name a different
…/scripts/check-*root (an earlier version's cache directory, which stops matching after an update), naming that root; INFO "absent" otherwise. On stale or absent, print the twelve rules resolved to this install root and ready to paste, each as a JSON string forpermissions.allow(the quoted forms escape their inner"). Applying them is the operator's job: this skill never writes user settings. The rules pin this version's cache directory on purpose, so a plugin update invalidates them andcheckreports them "stale" again; why a version wildcard is unsafe is in${CLAUDE_PLUGIN_ROOT}/reference/parent-contract.md("Operator setup"). -
Repository settings. Run
"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --checkfrom the project root and report each line it prints with its own INFO, PASS or WARN prefix. INFO whendocs/conventions/discovery.yamlis absent (every key comes fromuserConfigor its default); PASS with each key's value when the file validates; WARN when it does not (a value outside the key's list, a key set twice, an empty value or empty string, or a map or list where one string belongs), quoting the file, key and value. An invalid value never stops a discovery skill: the skill names it and drops that layer, so the row is a WARN.applyfixes a value outside the list or an empty value; the other shapes are fixed by hand, andapplyrefuses the file until then.
apply (writes docs/conventions/discovery.yaml, and the step 5 region and ignore line on a yes)
-
Run
checkand show its table. -
Resolve the values. With complete
<key>=<value>arguments, use them. Otherwise ask one key at a time, recommendation first, from the Keys table in${CLAUDE_PLUGIN_ROOT}/reference/config.md(explore_output:auto, the default, unless the team wants every run pinned tochange-preporexplain). Never invent a key the schema does not list. -
Write. One call with every value:
"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" explore_output=explainPass a key the operator accepts at the plugin default as
--default <key>instead of<key>=<value>, so a later change to that default reaches it;<key>=<value>records the team's choice, which the script never changes. The script also recordswritten_againstandprovenance:, so a file with no record, or one written against another plugin version, shows a diff even when no value changes.The script checks each value against the schema and validates the whole resulting document before it writes; an invalid value or key, or an existing file with a key set twice, an empty string, a map or a list, exits 1 with one line and writes nothing. It writes the file only at
<git toplevel>/docs/conventions/discovery.yaml. It resolves a symlinked root first, then refuses a root that is$HOMEor an ancestor of it, a symlinkeddocs,docs/conventionsor target, a hard-linked target, or adocs/conventionsthat resolves outside the repository, checked again right before the write, so the file never lands outsidedocs/conventions/. A missing file is created. A value already in place printsalready configuredand writes nothing. -
An existing file that would change exits 3 and prints a unified diff without writing. Show the operator that diff and ask whether to write it. Only on an explicit yes, re-run the same call with
--yes; on anything else, stop with the file unchanged. A request to "set it" is not a yes to a diff the operator has not seen. When the convention-home offer prints below the diff, ask about it too (the next step) before any re-run, since--yeswrites both. -
The convention-home offer. When the repository's
AGENTS.mdorCLAUDE.mdbinds no convention home, the script prints an offer: with the operator's confirmation it adds a convention-home pointer region to that instruction file (creatingAGENTS.mdwhen neither exists orCLAUDE.mdonly imports it) and the personal override ignore linedocs/conventions/**/*.local.*to.gitignore, the only filesapplywrites outsidedocs/conventions/. It prints the offer at the end of an exit 0 run and below the diff of an exit 3 run, so show the operator stdout on exit 0 too. Ask whether to add the region and the ignore line. Only on an explicit yes, re-run the same call with--yes, which also writes any diff shown with it. On a no, run"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" --declinealone: it records the decline in the instruction file, and the next run does not offer again. To write a shown diff without the region, run--declinefirst, then the same call with--yes. When the instruction file or.gitignoreis a symlink or hard link the script will not write through, it prints a one-line refusal in place of the offer, with the same exit code: show it, and do not re-run with--yes, which that refusal stops with exit 1. A refused instruction file refuses--declinetoo, so the operator fixes the link or adds the region by hand. -
Verify. Re-run
checkand report the value from its table, not from the write. Then the tracked-file pair:git check-ignore -v docs/conventions/discovery.yamlreports no match (a match means the team never receives the file: say so, and leave.gitignoreto the operator), andgit ls-files --error-unmatch docs/conventions/discovery.yamlexits 0. Non-zero right after a fresh write means "written but untracked: commit it to share with the team", never success.
Output
check: the table and, when the gate allow rules are stale or absent, the twelve resolved rules as
JSON strings ready to paste. apply: the table before and after, the diff when one was shown, the
written path, and whether the file is tracked.
Next
/discovery:explore
Gotchas
- Shell env vars are read at session start. A capability the check reports as missing stays
missing for the rest of this session even after it is exported in the shell; the recommendation
takes effect next session. Whether a variable set in a settings file's
envapplies now is env vars: set variables in settings files's to state. - The gate allow rules stop matching after a plugin update. They name this version's cache
directory, so the gates prompt again until the operator pastes the rules
checkprints;checkreports them "stale". - The repository file reaches the team only once committed.
applyleaves it uncommitted on purpose, and the tracked-file pair says so.
What this skill does NOT do
- Run an exploration, research, or intent-tracing pass. Those are the plugin's discovery skills
(
/discovery:explore,/discovery:research,/discovery:trace-intent). - Write machine-local state. The plugin directory and the plugin data directory
(
${CLAUDE_PLUGIN_DATA}, for caches and generated state only) stay untouched. - Write Claude Code user settings or
pluginConfigs.checkreads~/.claude/settings.jsonand prints the gate allow rules; the operator applies them. - Write any file other than
docs/conventions/discovery.yaml, except theapplystep 5 region and ignore line on the operator's explicit yes.
04 同仓库更多 Skills
track
Backlog reads through the bound tracker: search open and closed items, view one item with its comments and state history. Use when another skill searches or reads tracker items.
reviewer-media
Reviewer media for one pull request: decides whether it needs a narrated walkthrough, builds the storyboard from /review:explain-change's digest, has /explainer-video:produce render it and hands the manifest to /source-control:pull-request media. Use when asked for 'reviewer media', 'a walkthrough video for this PR', 'a produced video of this change', or when pull-request ready or monitor hands a PR over.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
route
Model and effort per agent role (orchestrator, worker, verifier, retrieval) for a multi-agent run, resolved through the bundled defaults and the user, team and personal override config layers into fenced JSON with single-agent and fan-out variants and the layer behind each value. Use when asked 'which model for the subagents', 'route the roles' or 'model routing', or before a skill passes a role's model on a spawn.
principles
Module-design vocabulary for architecture findings, and the checks built on it. Use when: 'what is a deep module', 'what is a seam', 'deep vs shallow module', 'what is the deletion test', 'leverage and locality', 'module design vocabulary', 'which word do we use for X in architecture findings'. Scanning a codebase for friction is /architecture:improve.
write
Structured five-field bug report (title, steps to reproduce, expected vs actual, justified severity, suggested fix location) from an informal description, read-only. Use when the user names a defect they observed, or asks for one written up ('report a bug', 'file a bug', 'write this up as a bug').