/interlock:spec [what you want to build] [--no-explore] [--brief <path>] [--continue] [--force-checkpoint] [--tdd] [--no-tdd] [--strict] [--lean] [--lens <a,b>]from Interlock
Takes a rough intent through OpenSpec's structured planning pipeline: explore, proposal, design, tasks, and delta specs. Stops at a human review checkpoint before any code is written. Use when starting a new feature, refactor, or bug fix.
Ships in Interlock. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Turn an intent into a reviewed change that is ready to implement — and then stop.
This skill writes specifications. It does not write code. By default it does not run /interlock:ship either: the gap between this skill and that one is the deliberate human checkpoint, because a spec is the cheapest place to catch a wrong idea, so that is where a person looks. --continue is an opt-in that trades that read for speed on changes a machine can prove are narrow — if passed, Read ${CLAUDE_SKILL_DIR}/continuity.md. Without the flag, nothing here bridges the gap.
This skill composes stock OpenSpec rather than replacing it. Artifact scaffolding, ordering, templates and validation all come from the openspec CLI, which is the stable contract. What this adds is the discipline around it: evidence gates, explore handoff, invariant sweeps, a decision ledger, and a review before anyone writes code.
| Flag | Effect |
|---|---|
--no-explore | Skip the explore phase (intent is already sharp, or a brief exists) |
--brief <path> | Use this explore brief; skip brief matching |
--tdd | Force test-first task shape: tasks.md leads with a failing-test section, later sections make it green |
--no-tdd | Force standard implementation-first shape; no leading red section. Never relaxes a bug fix's repro-first task |
--continue | Advanced. After a clean artifact review, Read ${CLAUDE_SKILL_DIR}/continuity.md — ask interlock ready whether the checkpoint may be skipped, and ship if it says yes |
--continue --force-checkpoint | Opt back out mid-flight. Always stops at the checkpoint, whatever readiness would have said |
--strict | Pass to the artifact gate: one independent reviewer, routed by role, reads the artifacts in place of the session. The gate already reads at that depth for this skill; the flag makes it explicit |
--lean | Pass to the artifact gate: the session reads the artifacts itself and spawns nothing |
--lens <a,b> | Pass to the artifact gate: name the review lenses in place of the detected ones |
openspec --version
If it does not print a version, stop here: before asking for intent, before explore, before openspec new change, before any Write — every later step calls the CLI.
command not found (or the shell's equivalent): the CLI is missing. Say so in one line, then run interlock openspec provision, which installs the pinned OpenSpec into the plugin's own data directory, and probe openspec --version again. If provisioning exits non-zero, quote its first line and stop; a sandbox-refused write means one run of the same command outside the sandbox. The user's own route stays npm install --location=global @fission-ai/[email protected], or the project's own package manager if it pins openspec.interlock or interlock-graph that answers command not found means this session predates the plugin. Until a new session, run node "${CLAUDE_PLUGIN_ROOT}/cli/interlock" (or …/cli/interlock-graph) instead; those calls match no allow rule, so each asks for approval.interlock doctor's node row names the floor and the Node it found.Either way, point at interlock doctor for the full preflight. Do not install or upgrade anything yourself, except by running interlock openspec provision, and do not scaffold openspec/changes/<name>/ by hand — the CLI owns those formats. --no-explore and --brief do not skip this step.
Session suggestion. Unless another Interlock skill invoked this one, run interlock suggest spec once, now, and print every line it returns verbatim. If it exits non-zero, print SESSION SUGGESTION UNAVAILABLE: <first line of its output> and continue. It is advice and never a gate: do not change the model or the effort yourself, and do not wait for the person to.
If the request is not clear enough to name a change, ask — open-ended, no preset options:
"What change do you want to work on? Describe what you want to build or fix."
Derive a kebab-case name from the answer ("add user authentication" → add-user-auth). Do not proceed without understanding what the user wants.
bug-fix when the request matches fix, regression, broken, crash, 500, error, hang, leak, a stack trace, or an issue reference. feature otherwise.
If bug-fix, gate the proposal on evidence. Before creating any artifact, require both:
Do not run openspec new change until both exist. If the user pushes back: "A repro is required so the fix has a pass/fail signal — without it we're fixing a symptom."
A bug-fix tasks.md must:
${CLAUDE_PLUGIN_ROOT}/shared/INVARIANT-SWEEP.md and give each a task. Fixing one call site and leaving its siblings on the raw form is exactly how the original bug survives its own fix.Two shapes exist, and this picks the one §3 writes:
Resolve in this order:
--tdd or --no-tdd wins. Both passed → ask which one. Do not guess between two explicit instructions that contradict each other.${CLAUDE_PLUGIN_ROOT}/shared/INVARIANT-SWEEP.md sweeps. Plumbing, wiring, config, prose and scaffolding are not — those get standard. When a change is part core and part plumbing, judge the part the change is about, not the part with the most files.--no-tdd suppresses the leading red section for the rest of the fix and never relaxes the repro; --tdd on a bug fix adds nothing the repro rule did not already require.Announce the call in one line before creating any artifact — the shape, and the reason:
task shape: TDD (pure transform with a pass/fail core) — section 1 is failing tests.
The shape is transient. It is not written into openspec/changes/<name>/ as a field and no later skill reads it back. What survives the run is the shape of tasks.md itself, which is the only thing ship consumes.
Prefer a durable handoff over re-deriving discovery from chat. See ${CLAUDE_PLUGIN_ROOT}/shared/EXPLORE-BRIEF.md.
--brief <path> given → read that file, skip matching.ls -t .claude/handoff/explore-*.md 2>/dev/null | head -5## Meta topic, slug, or suggested_change_name overlaps the request (or the newest one if only a single recent brief exists and the topic is vague).## Pending Clarifications, ask only what genuinely blocks a correct proposal. Skip anything already covered by ## Assumptions Made that the user does not contest.suggested_change_name is set and the user gave no name, use it.No matching brief is fine — but if none exists and --no-explore was not passed, run /interlock:explore --autonomous now and require a decision-oriented brief: conclusions, a recommended direction, options with a winner, assumptions, pending clarifications, and only cited file:line spans. Do not ask for an inventory of every file touched. Use the brief it writes. A spec built on unexplored ground is the most expensive kind to get wrong.
Spec spawns nothing itself. The only workers on this path are explore's investigators and the artifact gate's reviewer, and each is routed by role: explore reads interlock routing explore-investigator and the gate reads interlock routing artifact-reviewer, and each passes what it prints. The cost policy is read from the CLI, never from this skill, so do not name a model or an effort level when you hand off to explore.
One change or an epic. Decide the width before writing. A request that spans many subsystems, or one whose brief reads "cover everything", does not converge at the artifact gate, because a reader of a change that size always finds more. Split it into an epic of briefs, each brief one change with its own gate, and say the split at the checkpoint. Section 4 then measures it: interlock validate reports the width once the delta specs exist, and a wide change stops there.
interlock drift --json
Never blocks, never branches. It exits 0 whatever it finds; read it and move on.
Two findings matter before exploring, because both mean openspec/specs/ describes something other than the code you are about to spec against:
unarchived — changes that finished but were never archived, so the living specs never received their deltas. Name them and the command (openspec archive <name>).stale.broken — a living spec cites a file that no longer exists. Evidence, not inference, and worth one line even when it looks unrelated: a spec pointing at a deleted file is the clearest sign the area you are about to spec has already moved.Then continue. Do not stop, do not ask, and do not archive on the user's behalf: archiving rewrites the living specs, which is a decision that belongs to whoever merged the change.
stale.aging is inferred from dates and rarely worth interrupting a spec run for — mention it only if it names a spec directly relevant to this change. Orphan detection needs a diff, which this skill does not have; ignore that field here.
openspec new change "<name>"
If a change with that name already exists, ask whether to continue it or start a new one.
openspec status --change "<name>" --json
Parse applyRequires (artifacts needed before implementation), artifacts (each with status and dependencies), and the path context — planningHome, changeRoot, artifactPaths, actionContext. Use those paths; never assume repo-relative locations.
Then loop, in dependency order, over every artifact that is ready:
openspec instructions <artifact-id> --change "<name>" --json | node "${CLAUDE_PLUGIN_ROOT}/skills/spec/scripts/compact-instructions.mjs"
Filter each ready artifact independently; do not dump the full instructions response or prefetch every artifact. The compact response carries instruction (schema guidance), template (the structure to fill), resolvedOutputPath, and non-empty context / rules.
resolvedOutputPath, using template as the structure.context and rules constrain you; they are not content. Never copy <context>, <rules> or <project_context> blocks into the artifact.openspec status --change "<name>" --json after each write; stop when every applyRequires artifact is done.tasks.md must include a task per consumer. Use interlock-graph consumers <symbol> for the structural pass, then grep for string-keyed readers. See ${CLAUDE_PLUGIN_ROOT}/shared/INVARIANT-SWEEP.md./advisor or edit advisorModel: whether it is on, and what it spends, is the user's choice. If the session does consult it, its advice is guidance, not evidence: where it conflicts with what the code or the artifacts show, write a ledger row instead of settling it in prose. A call that fails is said at the hand-off and never retried, and the spec continues. The tool being absent is not an error either; §6 says so.## MODIFIED requirement copies every #### Scenario: title its living spec holds, each scenario title verbatim. To drop or rename one, use ## REMOVED and add the requirement back under ## ADDED, because archive refuses a MODIFIED block that omits a living scenario.tasks.md is the wave plan. A numbered ## N. section is one wave. Follow these four rules when writing it:
1.x share a wave, 2.x share the next).dependsOn edge, not a new section. The classifier reads the task text and emits that edge; write the dependency into the task so it can. Incrementing the section to order one cross-file dependency serializes every task in the new section that is independent of it — the edge orders only the dependent task, so its independent siblings keep sharing a batch.These rules apply even when openspec instructions tasks injects no rules.tasks. Path collisions inside a section are the planner's problem (paths), and a cross-file dependency is an edge (dependsOn) — neither is a reason to increment the section number.
Never split a section to buy parallelism. The planner packs low-tier siblings in one section into a single lane run by one agent, and a small change may ship solo — the whole change implemented in order by one agent — so a section written wide does not become a spawn per checkbox. Write the sections the work actually has; how many agents run them is the planner's decision, made under caps interlock limits publishes.
The four rules above are about grouping and hold under either shape. The shape decided in §1a decides only where the tests sit inside that grouping.
## 1. is the failing-test wave. Title it Failing tests first, and have each later section that satisfies it say so: (make §1 green). Cover the transform boundary the invariant sweep found, not just the happy path.Rule 2 still binds inside the red wave: the failing suite is one checkbox, not one checkbox per TDD beat. A leading test section is a wave, not a licence to split. One checkbox per assertion serializes the change and buys nothing — the anti-split rule was never about disliking TDD, it was about the planner packing what you wrote.
The heading is the contract with ship, so write it exactly. /interlock:ship reads Failing tests first off the ## 1. heading and plans that section as a leading red wave: its tests run first instead of deferring to the trailing test wave, in solo mode too. A reworded heading is not a smaller signal, it is no signal — the change plans as an ordinary one, and nothing fails to tell you so except the plan preview, which will not say RED.
Two things follow from how ship treats that wave:
## 1. already runs before ## 2., so (make §1 green) as prose is enough, and an edge buys ordering the sections had already.One consequence worth stating at the checkpoint: because the red wave's check is skipped, a run cannot tell a genuinely failing suite from one that already passed. Tests that pass before the implementation exists are not pinning new behaviour — that is a review question, and §6 flags it as one.
Do not enumerate every existing test pin the change breaks. No one can list them all before the code exists, and a reviewer who asks for the complete list asks for something that cannot be written yet. Name the pins you know, by file and line, and state the bounded rule: an assertion that pins a meaning the delta specs change is updated in the task that changes that meaning, never during a remediation stage (the test guard denies test edits there), and the update names the assertion and the requirement it now pins. With that rule in tasks.md, an incomplete pin list is a warning at the artifact gate, not a blocker.
Once the loop has written tasks.md, and before the ledger audit in §3a, read the compound notes for the files the tasks name:
interlock note match "<name>" --json
Each entry in rows is a rule an earlier change learned about a file this change touches. For each, check that design.md and tasks.md honour its rule. Where they do not, revise the artifact, or write a ledger row (§3a) before acting on it. omitted counts matches past the cap, and unreadable counts table rows the CLI could not parse; say both at the hand-off when they are not 0. When the line exits non-zero, report its first output line and continue: notes are guidance and never a gate.
Write openspec/changes/<name>/decisions.md. The format, the two classes, and what makes a row invalid are the contract in ${CLAUDE_PLUGIN_ROOT}/shared/DECISION-LEDGER.md — read it and follow it; do not restate it here or invent a third class.
What this skill owes the ledger:
Pending Clarifications and Assumptions Made — ids, questions and classes as explore assigned them — as the first write to this file. Do not start a fresh ledger and do not renumber.agent_resolved is a claim, and interlock ledger audits all three parts of it. It requires a written resolution, evidence a reader can follow, and the row's id appearing in design.md. Each is checked: an empty resolution, an empty evidence cell, a hedge that asserts nothing (obvious, standard practice, see above — the whole cell, not a word inside a real citation), or an id design.md never mentions all make the row invalid, and an invalid row blocks exactly like needs_human. A missing design.md makes every reference unresolvable rather than resolving all of them.needs_human. A wrong agent_resolved ships an unreviewed product decision; a needless needs_human costs one question.Check the file rather than trusting that you wrote it well:
interlock ledger "<name>" --json
It exits non-zero when the ledger blocks — a needs_human row remains, a row is invalid, or the ledger is missing entirely. An absent decisions.md is a failure of the audit, not an empty result: "no rows" reads as "nothing needs a human", which is the one conclusion a file that was never written cannot support. The output distinguishes missing from present and empty from unparseable. In the JSON, blocking is the verdict; report the needs_human entries of rows by id and question and the entries of invalidRows by reason, and read missing or unparseable as why a ledger with no rows still blocks.
A blocking ledger with rows in it is not a failure of this skill: an honest blocking ledger is the correct output for a change that hit a real product question. It is only a failure if the questions never got written down.
openspec validate "<name>"
interlock validate "<name>" --json
openspec validate "<name>" checks this change's delta structure and every MODIFIED block against its living spec; a bare openspec validate names no target and checks nothing. interlock validate checks the flow's own preconditions — all three artifacts present and non-empty, tasks.md actually containing checkbox tasks — and exits non-zero when the change is not implementable. Fix anything it reports before continuing. In the JSON, ready is the verdict and problems is the list to fix; an output carrying error and candidates instead of ready means the name did not resolve.
Width. Read width.wide from the validate JSON.
width.wide true: print the CHANGE WIDE: line(s) from the validate output verbatim, run no /interlock:review-artifacts, write no interlock autonomy line, and stop at the checkpoint (section 6) with an epic of briefs: group the delta spec capabilities from the printed list into briefs, each brief one change with its own gate, naming only capabilities from that list.width absent (an older CLI): print CHANGE WIDTH: not reported by this CLI and continue to the gate.width.wide false: continue to the gate.Wording. Read wording from the validate JSON. Print each entry's message verbatim as a warning; a wording warning never stops the run. wording absent (an older CLI): print WORDING: not reported by this CLI and continue.
Run /interlock:review-artifacts <name> --caller spec against the change, passing --strict, --lean and --lens <a,b> through when they were passed to this skill. --caller spec is always passed: the CLI's caller table answers the gate's depth for this skill, and this skill names no depth of its own. The gate runs once per spec run, at the end: it is not a loop, and no second reviewer is spawned to re-read a change the first one blocked. A fresh exhaustive reader of a wide change always finds more, so re-gating the whole change does not converge; it costs a full review a round and the warnings keep arriving.
/interlock:review-artifacts <change> --since <findings file>, which judges the fix rather than the whole change again.GATE UNAVAILABLE: and no rerun verdict) gave no autonomyOutcome.blockers to read: write no interlock autonomy line, say at the checkpoint that the gate gave no verdict, and re-gate nothing.# blockers found
interlock autonomy record review-artifacts --blockers <n>
# clean
interlock autonomy clean review-artifacts explore spec
A clean gate credits explore and spec too; a blocker resets them. That is what stops this skill earning autonomy by emitting shallow specs — the downstream gate blames whoever produced the bad artifact.
<n> is autonomyOutcome.blockers from the gate's JSON, carried over from the review — never a count made in prose, including the review's own SUMMARY: line. Continuity takes the findings file itself, so keep its path.
This is where the default run ends. Close with:
CHANGE WIDE: line and the epic of briefs split replace the review: no gate ran.not available in this session, and the consults the session made, by its own account. The spec meter's advisor line is the record of that count.rows matched, with omitted and unreadable when not 0, or the note match line's first output line when it failedThen say plainly: review the spec, and run /interlock:ship when it looks right.
If the user passed --continue, Read ${CLAUDE_SKILL_DIR}/continuity.md and follow it. Do not print a spec GOAL MET line on that path — if readiness launches ship, finish() prints GOAL MET: interlock ship.
Without --continue, the run ended here. Before the card, ask the review policy whether its history now suggests a rule:
interlock review-policy suggest --summary
Print its output verbatim, and nothing when it prints nothing. On a non-zero exit print REVIEW POLICY SUGGEST UNAVAILABLE: <first line of its output> and continue; it never blocks the checkpoint.
Then print the checkpoint card:
interlock checkpoint "<change-name>"
It prints the card; a non-zero exit is reported in one line and does not stop the hand-off. An Unknown command answer means an older interlock is first on PATH: say so in that line and name interlock doctor, whose cli-version row shows which one.
The checkpoint waits for a human, so mark it for the spec meter:
interlock notify checkpoint "<change-name>"
It sends nothing: it prints one checkpoint: line and exits 0, so run it unconditionally and never branch on the result.
Then print this greppable line so a session /goal can stop instead of wandering into implementation:
GOAL MET: interlock spec stopped at the checkpoint.
Do not run ship. Do not offer to "just start on the first task". The checkpoint is the point. Do not call /goal from this skill — a /goal does not skip the checkpoint and does not start ship. Continuity's only opt-in skip is --continue plus interlock ready.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
openspec, planning, specification, change-management, feature-planning
npx claudepluginhub renzrollon/interlock --plugin interlock16 skills in this plugin
/bootstrapOnboard a brownfield project into OpenSpec — analyze the existing codebase with parallel explorer agents, write an initial architecture document, then generate one spec per discovered feature describing what is already built. Use when adopting spec-driven development on a repo that has code but no specs./commitCreate a single feature-level commit after a change is implemented. Reads the OpenSpec change artifacts to write a verb-phrase conventional-commit message with an outcome summary and optional issue reference. Commit only — never runs tests, typecheck, lint or build, and never pushes./dispatchRoute a request to the right interlock skill, after one batched pre-flight that loads git state, OpenSpec status, open tasks and graph presence in a single pass. Use when you are not sure which skill applies, or at the start of a session to orient before doing anything else.Other plugins' skills for the same job