setup
Validate the discipline plugin's configuration (the posture-batch override, do-your-research's fan-out verification depth, lever_scope and docs/conventions/discipline.yaml), explain how to change the personal options through Claude Code's plugin configuration prompt, and write the repository file after confirmation. Use when: 'set up discipline', 'configure discipline', 'discipline setup', 'is discipline configured', 'what's in my posture batch', 'what's my deep-research depth', 'set lever_scope for this repo', or the user wants to adjust which correctors the batch runs, how deeply the research fan-out verifies, or when a repeated change gets a lever. Actions: check (read-only, default), apply (writes docs/conventions/discipline.yaml only).
- License 许可
- MIT
- 最近更新
- 2026-11-15
- Stars
- ★ 30
- Forks
- 7
01 前言 Front Matter
- description
- Validate the discipline plugin's configuration (the posture-batch override, do-your-research's fan-out verification depth, lever_scope and docs/conventions/discipline.yaml), explain how to change the personal options through Claude Code's plugin configuration prompt, and write the repository file after confirmation. Use when: 'set up discipline', 'configure discipline', 'discipline setup', 'is discipline configured', 'what's in my posture batch', 'what's my deep-research depth', 'set lever_scope for this repo', or the user wants to adjust which correctors the batch runs, how deeply the research fan-out verifies, or when a repeated change gets a lever. Actions: check (read-only, default), apply (writes docs/conventions/discipline.yaml only).
- argument-hint
- [check|apply] [<key>=<value> ...]
- user-invocable
- true
- disable-model-invocation
- true
02 资源文件 4
- 脚本scripts/parse-concern-value.sh5.0 KB
- 脚本scripts/setup-apply.mjs1.0 KB
- 脚本scripts/setup-apply.test.sh25.0 KB
- 脚本scripts/yaml-subset.awk9.7 KB
03 SKILL.md 正文
Variables
Batch exclude: ${user_config.batch_exclude}
Batch promote: ${user_config.batch_promote}
Batch demote: ${user_config.batch_demote}
Deep-research verification depth: ${user_config.research_deep_verification}
Lever scope: ${user_config.lever_scope}
Purpose
Report discipline's effective configuration and write its one repository file. The
plugin's personal options are native userConfig: three sweep-all batch-override
options (batch_exclude / batch_promote / batch_demote), the verification-depth
default of do-your-research's fan-out tier (research_deep_verification) and
lever_scope. They are personal options, held in user settings, and this skill
reads only their rendered values (check step 1). How Claude Code collects and
stores them, and which settings files it reads them from, are read live
from plugin manifest reference: where values are stored.
The plugin owns one tracked consumer file, docs/conventions/discipline.yaml, the
repository layer of lever_scope (keys, values and layers:
${CLAUDE_PLUGIN_ROOT}/reference/config.md;
schema: ${CLAUDE_PLUGIN_ROOT}/schemas/discipline.schema.json). check reports it;
apply writes it and nothing else. Personal options are never written here: they
change through Claude Code's native flow (check step 8). Action routing: no argument
or check runs the check; apply runs the check, then writes. Re-running either reads
the current state again.
Official contract: https://code.claude.com/docs/en/plugins/manifest-reference#user-configuration.
check (read-only)
-
Read the five rendered
${user_config.…}values from the Variables block above (the threebatch_*override options,research_deep_verificationandlever_scope). Do not inspect or editsettings.json,settings.local.json, managed settings, orpluginConfigsdirectly. -
Empty or unexpanded is unset. Treat BOTH an empty value AND a surviving literal
${user_config.…}placeholder as unset (the key's own default applies); never read the literal token as a value. Substitution is documented at plugin manifest reference: reference a saved value, which does not say what an unset option renders. -
For each set batch option, split on commas and report the parsed corrector names, and the net effect:
batch_excludedrops those correctors from the batch,batch_promoteruns those situational correctors every session,batch_demotegates those core correctors on relevance. With all three unset, report that the batch runs the tiers exactly as the correctors declare them. -
Validate the batch names against what is installed. Glob the sibling corrector directories under this plugin's
skills/and, for each name in an override, report:- a name in
batch_excludeorbatch_demotethat matches no installed corrector: FAIL (typo or removed corrector); remediation: fix via the plugin configuration prompt; - the same name in
batch_excludeand inbatch_promote/batch_demote: contradictory; report it; batch_promoteis situational-only (readmetadata.discipline-batch): promote only situational names. A promote naming anever-tier orcorecorrector, or a name that matches no installed corrector, is a visible warning and is not promoted, never stays out of the batch, core stays core, unknown is ignored. Do not report these as successful promotes.- a
batch_demotenaming an already-situational corrector, a no-op; INFO.
- a name in
-
Report the deep-research verification depth.
research_deep_verificationsets the default depth ofdo-your-research's fan-out tier. Report the effective value:tiered(fan subagents out only over load-bearing items) orfull(subagent-verify every item). An unset value, a surviving literal placeholder, OR any unrecognized string (not exactlytieredorfull) all resolve to thetiereddefault. Report an unrecognized value as a WARN (typo; remediation: fix it via the plugin configuration prompt) that still falls back to tiered, never a hard failure. Note that an invocation argument todo-your-research(tieredorfull) overrides this default per invocation. -
Report
lever_scope. 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/discipline.yamlis absent, PASS with the value when the file validates, WARN for each problem when it does not (a value outside the key's list, a key set twice, an empty value or empty string, a map or list where one value belongs, a key outside the schema), quoting the file, key and value. A one-line refusal (an unsafe path, or a root that is$HOMEor above it) is a WARN with that line. Then report the effective value by the layers in${CLAUDE_PLUGIN_ROOT}/reference/config.md: the file's valid value wins; a file that sets the key to an invalid value resolvesdeterministic, never the user's value; with no key in the file, a user value ofdeterministicornon-trivialapplies, elsedeterministic. A user value outside the list is a WARN naming the option and the value. An invalid value never stops the lever check, which names it and drops that layer, so these rows are WARN, never FAIL;applyfixes the repository value. -
Full-batch prerequisite. INFO: the batch's mid-session pass dispatches fork subagents, so report whether fork mode is on in this kind of session. Read the defaults, the version floor and the override variable live from the section the Pointer below names, and report what it states.
- Pointer: when reporting whether fork mode is on, fetch https://code.claude.com/docs/en/sub-agents#turn-fork-mode-on-or-off live.
sweep-allpreflights this itself and degrades when the fan-out cannot inherit; that runbook owns the behavior; report the prerequisite here only so an unavailable fan-out reads as expected rather than as a misconfiguration, and do not restate what the degraded pass does. -
To change or clear any personal option, direct the user to Claude Code's native flow, interactively with
/plugin configure discipline@<marketplace>or by a headless route, as the marketplace's plugin-reconfiguration convention gives them in § The routes (it owns the verified-version record). Apply the scope and failure-signal caveats in its § Caveats every setup skill's short form carries. Read both sections and print what they give, the fallback route, its behavior on an already-installed plugin and the scope to pass included, rather than only naming them, and leave out the verified-version record. Never uninstall to reconfigure; that section links what an uninstall deletes. Claude Code owns persistence: this skill never writes user settings orpluginConfigs, and never hand-edits anypluginConfigskey.- Pointer: for the headless command's flags, how it reports a saved or refused value, and when a saved value applies, fetch plugin CLI reference § plugin configure live.
-
Tell the user to rerun
checkafter reconfiguration in a fresh session, and report the OBSERVED effective values from that fresh run, never an unobserved change. Substitution of the rendered${user_config.*}values is documented at plugin manifest reference: reference a saved value, which does not say when skill content is re-rendered.
apply (writes docs/conventions/discipline.yaml only)
-
Run
checkand show its report. -
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(lever_scope:deterministic, the default, unless the team wants judgment-bearing repeated changes made with a codemod tool too). Never invent a key the schema does not list, and never write a personal option here. -
Write. One call with every value:
"${CLAUDE_SKILL_DIR}/scripts/setup-apply.mjs" lever_scope=non-trivialPass 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 exits 1 and writes nothing. It writes only
<git toplevel>/docs/conventions/discipline.yaml, 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, checks the path again before each directory it creates and right before the write and the rename, and writes through a new temp file in the same directory. Every refusal is one line. 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 report, not from the write. Then the tracked-file pair:git check-ignore -v docs/conventions/discipline.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/discipline.yamlexits 0. Non-zero right after a fresh write means "written but untracked: commit it to share with the team", never success.
Next
/discipline:sweep-all to run the posture batch with the reported override, or
/discipline:script-the-deterministic-work to apply the lever rule.
Gotchas
applywrites one file. It never writes the plugin cache, Claude Code user settings, orpluginConfigs, per the uniform setup contract (docs/plugin-philosophy.md"Setup is explicit and repeatable" in the marketplace repository). Personal options change only through the native/plugin configure discipline@<marketplace>flow.- Unexpanded token is not a value. A surviving literal
${user_config.…}means unset (the key's default applies). Parsing it as a corrector name, a depth or a lever scope is the failure this check exists to prevent. - The repository file reaches the team only once committed.
applyleaves it uncommitted on purpose, and the tracked-file pair says so.
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').