Plan Interview
Produce one ambiguity-free implementation plan by interviewing the user
one question at a time. The crucial goal is a plan with no ambiguity
across three lenses:
- Business requirements — what problem, measurable success, who, why not
simpler.
- Backward compatibility — every consumer, stored record, in-flight
message, and deployed client affected, enumerated from the actual code.
- Technical — behaviour, edge cases, data model, contracts, testing,
rollout.
The model discovers and interrogates — it reads the codebase first,
confronts the user with findings, and pushes back with alternatives. It does
not prepare a plan from the user's words alone. A plan built only from
what the user said is the failure mode this skill exists to prevent.
The single output is one plan markdown file written to disk — authored by
the write-plan skill from the spec this interview assembles, then verified
by this skill's Audit Pass. It must be complete enough that a fresh reader can
implement it without a follow-up question.
The goal is not "minimum questions to start coding". It is "no ambiguity
left that would bite us at code-review or in production".
Rules
One question per turn. Never bundle multiple questions, sub-questions,
or "while we're at it" asides. If you catch yourself writing "and also" —
delete it and save it for the next turn. (Batch-confirmations of clearly
out-of-scope checklist items are not bundled questions; see "Using the
Checklist Efficiently".)
Discover before asking. Run the Discovery Phase first. Any fact that
the codebase, configs, docs, or git history can answer — read it, don't
ask. Questions of intent ("should we retry on this error?", "is partial
success acceptable?", "do we need an audit log?") must always be asked;
the code tells you what is, not what should be. Every question you do
ask should be grounded in something you read, not in the user's framing.
Walk the decision tree depth-first. Resolve a decision's dependencies
before moving to the next sibling. Don't jump branches until the current
one is settled.
Always recommend an answer. For every question, propose your
recommended answer with a one-sentence reason. The user can accept,
override, or refine — this prevents stall. When the user overrides a
recommendation, record the decision as
D<n>. <decision> (overrides recommendation: <user's reason>). Pushback
with no reason → ask once for the reason before recording; never silently
flip. Code-grounded findings remain facts regardless of the user's framing.
Tag the type of decision. Mark each question as [technical],
[product], [compat], or [scope] so the user knows whether they're
being asked an engineering tradeoff, a business call, a backward-compat
call, or a boundary call.
Write the decision log to disk as you go. Append each agreed answer,
explicit non-goal, and open risk to
docs/specs/<TICKET-ID>/spec.md at the moment it is decided
(create the file from the Spec File Template below on the first
decision). Every behavioral decision carries a Check: line — a runnable
command or named test that proves it (or manual QA: <step>). Cannot
write too vague; sharpen it in the same turn before
recording. Long interviews degrade chat recall; the file cannot forget. The
end-of-interview spec assembly (Output Step 1) organizes this file — it
does not reconstruct decisions from memory. Also track the consumer
list from Discovery in the same file so the backward-compat lens can be
closed item by item. On every append, check the new decision against the
existing decisions and non-goals — if it contradicts one, surface both
immediately and ask which wins; do not record two conflicting decisions.
Push back with code-grounded findings, not just questions. When you
spot a simpler design, a non-obvious risk, a broken consumer, or a more
idiomatic approach for this codebase — surface it on your own turn.
Ground it in something you actually read. Use this format:
Observation: <what you found in the code, with file:line>
Alternative: <what you would consider instead>
Tradeoff: <one sentence on what each side costs>
Then ask if the user wants to switch. If you finish an interview without
at least one code-grounded finding, you under-investigated — that is a
failure, not a clean run.
Question Format
Q[n] [type]: <single question>
Found: <the file:line / consumer / fact that prompted this, when applicable>
Recommendation: <your suggested answer>
Why: <one sentence>
Resume Protocol (check before anything else)
If docs/specs/<TICKET-ID>/spec.md already exists for this branch,
this is a resumed interview, not a fresh one:
- Read the spec file. Post a two-line status:
<d> decisions, <n> non-goals, <o> open items and the list of open items.
- Do not re-ask decided items. Resume from the first open item
(open risks, unresolved checklist entries, unhandled consumers).
- Re-run Discovery only for areas the spec marks unexplored or that the code
has changed since (check
git log from the spec's recorded Discovery
baseline SHA).
- If the user's new framing contradicts a recorded decision, surface the
conflict (Rule 6) instead of silently overwriting.
- If an implementation plan for this
<TICKET-ID> also exists (WIP or
promoted), the interview likely already completed — confirm intent before
re-opening. New decisions then flow into the spec and a plan
amendment; never leave the two contradicting.
Only when no spec file exists do you start at Calibration below.
First Turn (always) — Calibration
Resolve <TICKET-ID> first:
git branch --show-current | grep -oE '[A-Z]+-[0-9]+' (adjust the pattern to
your tracker's key format). No match → ask for the ticket ID as part of the
calibration turn (administrative, not a decision — not a Rule 1 violation).
Rule 6 writes the spec to docs/specs/<TICKET-ID>/spec.md at the first
decision, so the ID must exist before Q1. If the project does not use ticket
IDs, use a short kebab-case slug for the feature.
Then read the project quirks doc if one exists (e.g. docs/quirks.md —
hard-learned domain gotchas) and list the entries relevant to this feature so
the user sees what is already covered. Do not ask the user to enumerate
quirks here. A cold recall question asked before Discovery has read anything
is the transcription failure this skill exists to prevent, and it asks for
negative knowledge — what would a generic reviewer miss? — which nobody can
produce on demand. Unknown quirks are surfaced as grounded candidates in
Discovery step 7 instead.
Treat the quirks doc entries as permanent context for the rest of the
interview — every subsequent question, finding, and alternative is filtered
through them, and step 7's accepted candidates join them.
Discovery Phase (always — before Q1)
After calibration, investigate before questioning. Do not ask the user
anything answerable from the repo. Read, then report. Produce a short
Findings block in chat (not a wall of text):
- Touched code & patterns — read the files the change will modify and
the existing patterns there (naming, layering, error handling).
- Consumers — grep for every caller of any function, field, route, event,
or contract the change touches. List them with
file:line. This list is
the backward-compat surface. For API/event/contract changes, the grep MUST
span every repo/package that consumes the contract — prefix each entry
with the repo/package name. When the change removes a field or stops writing
one, include same-repo readers that derive behavior from it — audit diffs,
changed-field labels, conditional logs, cache keys. These break silently: the
field is simply never there, so nothing throws.
- Stored / in-flight data — records written under the old contract,
queued messages, deployed clients that will outlive the deploy.
- Existing tests — tests that pin current behaviour and would break.
- Product context — read the repo README,
docs/features/ entries for
adjacent tickets, and any product docs touching this domain. Business
rules often live in docs, not code — a discovery that reads only code
misses them.
- Business scenario hunt (generative, not confirmatory). From the facts
gathered above, generate 5–10 candidate edge scenarios the user has
not mentioned, then present them as one batch for accept/reject (each is
binary — this is not a Rule 1 violation). Mine these axes:
- actor × state × timing — two users mutating the same entity; the
entity deleted/archived mid-flow; a retry landing after success.
- abuse / misuse — quota exhaustion, oversized input, repeated calls,
a caller from the wrong tenant/role.
- money / counting — rounding, currency, off-by-one on limits,
double-counting on replay.
- lifecycle — feature toggled off mid-operation, account downgraded,
entity re-created with the same natural key.
- failed write — the mutation rejects: does local state revert to the
server value, or does the user keep seeing an unsaved value as if it
were stored?
Each accepted scenario becomes a Decision (how it must behave) — propose
the expected outcome with the batch and confirm it before recording the
D-number; acceptance without defined behavior is not a decision. Each
accepted scenario later becomes a test in the plan's test matrix; each
rejected one is recorded as a Non-goal. Presenting zero generated
scenarios = under-investigation, same failure as finishing with zero
code-grounded findings.
- Quirk sweep (generative, not confirmatory). From the code read above,
generate the divergences a generic reviewer would miss and present them
as one batch for accept/reject. Never ask the user to recall quirks from
memory — every candidate cites
file:line and proposes a reading. Mine
these axes:
- scope boundary — account vs location vs user vs tenant enforced in
one layer and not another.
- filter / time-window semantics — two call sites reading the same
source with different filters, boundaries, or timezone handling.
- hidden contracts — idempotency keys, dedup windows, event ordering
relied on but not enforced.
- protected sections — code whose comments, tests, or git history warn
against the obvious change; in-flight migrations.
Format each as
Found: <file:line> — <the divergence> | quirk (intentional) or bug? with a recommendation. Zero candidates is a valid outcome — say so
explicitly rather than inventing one. Accepted candidates become permanent
interview context; the ones that recur across tickets are the quirks doc's
input (graph-retro Step 5 routes them there).
Output the Findings as a compact list, then drive questions from it. Each
finding is either:
- silent-logged (obvious, no decision needed), or
- turned into a pointed question (
Q[n] with a Found: line).
Example of discovery-driven questioning (vs transcribing):
Found: tagLookup read in sales/.../x.ts:42 and workflow/.../y.ts:88;
sales reads legacyTarget, which your change removes.
Q3 [compat]: Break sales, migrate it, or dual-write legacyTarget for one
release?
Recommendation: dual-write one release, then drop — zero-downtime.
Why: sales deploys on a different cadence; a hard break strands it.
If Discovery reveals the codebase contradicts a user assumption, surface it
immediately as an Observation/Alternative (Rule 7) before continuing.
Three Lenses (must all be cleared)
The interview cannot stop until each lens is fully resolved:
- Business requirements — problem, measurable success, target user/role,
why a simpler/cheaper option was rejected.
- Backward compatibility — every item on the Discovery consumer list
is Decided / Non-goal / Open-accepted. This list is derived from grep, not
from memory. This is the lens that bites hardest at review — never close it
on "should be fine".
- Technical — the Coverage Checklist below.
Coverage Checklist (the technical + business bar)
Before producing the plan, every item below must be Decided,
Non-goal, or Open risk — accepted. Never leave one as "didn't think
about it".
Technical:
- Functional behaviour — happy path, expected inputs/outputs.
- Edge cases and failure modes — empty/null/duplicate/concurrent inputs,
partial failure, timeouts, retries that arrive after success.
- Data model & schema changes — new fields, migrations, backfill, indexing,
schema versioning. Schema presence is not persistence: for each new
field, confirm the actual writer (repository insert /
build / publish
payload, not just the domain type) carries it, and that a test reads it back
WITHOUT mocking the writer. A field with a schema default that the writer
omits ships zeros/nulls and looks deployed — must-resolve, not obvious-skip.
- API / event contract — request/response shape, status codes, versioning.
- Backward compatibility — deployed clients, in-flight messages, stored
records written under the old contract. (Cross-check the Discovery list.)
- Idempotency & retries — idempotency key, dedup window.
- Authn / authz — who can call this, required permissions, cross-tenant
exposure prevention.
- Observability — logs, metrics, traces, alerts; what a support engineer
sees when this breaks at 3am.
- Testing strategy — unit/integration/functional, coverage bar, must-test
scenarios.
- Rollout & rollback — feature flag, staged release, kill switch, order of
operations across services, revert without data loss. Activation: what
switch makes this take effect (env var wired into the running service,
index created, a queue/topic subscription added, feature flag enabled,
infra (IaC) applied) — and what would leave it silently inert despite
green tests.
- Performance & scale — volume, latency budget, cost ceiling, burst load.
- UX / accessibility / i18n — if user-facing.
- Documentation — README, AGENTS.md, runbook, API spec, ADR/DECISIONS.md.
- Dependencies — new libs/services, version pins, failure mode if down.
Business / domain:
- Business intent — problem solved, measurable success, simpler
alternatives considered and why rejected.
- Domain-specific edge cases — idempotency-on-replay, scope-boundary
(account vs location vs user vs tenant), time-window/filter-semantics
mismatches between layers, state drift between subsystems, domain
event-ordering races. Use the Discovery step 7 quirk sweep to enumerate
the specific quirks for this codebase.
- User personas / roles — does behaviour differ by role, tier, app, or
feature flag.
- Operational impact — what support sees, runbook/alert needed, who's
paged, manual recovery path.
- Compliance / data handling — PII, retention, audit trail, cross-tenant
exposure, regulatory scope.
- Scope & phasing — which parts are must-have vs nice-to-have; can the work
split into phases or separate plans, and what ships first. Ask this
once, explicitly — write-plan's Scope Check can only react; the split
decision belongs in the interview.
Using the Checklist Efficiently
The checklist is the coverage bar, not a literal question list. Asking
all 20 mechanically is a failure mode. For each item:
- Obvious from code/context → silent log. Record it silently and move
on. Don't burn a turn confirming the obvious.
- Clearly out of scope → batch-confirm. Combine adjacent N/A items into
one confirmation turn: "Assuming internal-only — no UX, no i18n, no public
API surface, no PII. Confirm?" Not a Rule 1 violation; each item is binary.
- Material and non-obvious → real
Q[n] turn. Only items where the
answer is both non-obvious AND would materially change the plan.
This is the difference between a 12-turn high-signal interview and a 25-turn
mechanical one.
Stopping Condition
Stop only when all are true:
- All three lenses are cleared (business, backward-compat, technical).
- Every Coverage Checklist item is Decided / Non-goal / Open-risk-accepted.
- Every consumer on the Discovery list is handled.
- No remaining question would, if answered differently, materially change
the plan.
- You can produce the plan without the phrase "to be decided".
Or: the user signals completion — "enough" / "good" / "let's go" /
equivalent. "stop" / "pause" is cancellation, not completion: save the spec
state and exit without the Self-Critique Gate or the write-plan confirmation.
When stopping, run the Self-Critique Gate. Do not ask "are we done?" — judge
that yourself. But before authoring anything, ask the user one explicit
confirmation to proceed to write-plan (see "Output" Step 2). Only after the user
confirms do you invoke write-plan, then run the Audit Pass against the file it
produced.
Self-Critique Gate (run silently before handing off to write-plan)
Anything that fails becomes one more turn, not a buried gap.
- Skipped questions — what three questions did I almost ask but skip?
If any skip-reason is weaker than "explicit non-goal" or "unambiguous from
code", ask now.
- Most-likely review flag — the single most likely thing a reviewer will
flag that I have not raised? Raise it now.
- Soft answers — was I answered with "yeah, sure" / "we'll see" /
"probably"? Not decisions. Re-ask with a sharper recommendation, force a
yes/no.
- Silent disagreement — what would I have designed differently from
scratch? Surfaced as an Observation/Alternative? If not, surface it now.
- Untouched consumer — is any consumer from the Discovery list still
unhandled? If so, that's an open backward-compat gap — ask.
- Decision conflicts — walk the decision log pairwise (and against the
non-goals): does any later decision contradict, narrow, or silently
supersede an earlier one? A late decision that reverses an early one must
be marked
supersedes D<n> in the spec, with the loser struck — never
leave both standing.
- Deferred material check — does
## Verify first hold anything a plan
task would be written around (API shape, field name, signature, path)?
Verify it now; Verify-first is for environment-only checks.
Output: Hand off to write-plan (the plan author)
This skill does not author the plan file itself. When the Stopping
Condition is met, it assembles the interview result into a spec and hands
that spec to the write-plan skill, which authors the comprehensive plan.
The division of labour:
- interview-plan owns: Discovery, the one-question interview, the three
lenses, the Coverage Checklist, the Self-Critique Gate, and the Audit Pass.
- write-plan owns: turning the resolved spec into the on-disk plan file
(file structure, bite-sized tasks, full-code steps, its own Self-Review,
execution handoff).
Step 1 — Assemble the spec (organize the spec file, before invoking write-plan)
Organize docs/specs/<TICKET-ID>/spec.md (built incrementally per
Rule 6) into the Spec File Template below, and post a summary in chat.
write-plan reads the spec file — zero ambiguity, no chat history needed.
Spec File Template (deterministic layout — write-plan depends on it)
# <TICKET-ID> — <one-line goal>
## Goal & business intent
Problem, measurable success, target user/role.
## Decisions
D1. <one line> (mark `supersedes D<n>` when a decision replaces one;
mark `(overrides recommendation: <reason>)` when the
user overrode the recommended answer)
Check: <runnable command / named test / `manual QA: <step>`>
D2. ...
## Non-goals
NG1. <one line — includes rejected business scenarios from the scenario hunt>
## Consumers (from Discovery — the backward-compat surface)
| # | repo:file:line | contract touched | status (Decided Dn / Non-goal / Open-accepted) |
## Discovery findings
Baseline: <repo> @ <short SHA> (per repo — resume diffs `git log` from here).
Touched code & patterns, stored/in-flight data, tests that pin behaviour,
product-doc facts.
## Business edge scenarios
Accepted (each → a D-number) and rejected (each → an NG-number).
## Coverage Checklist status
1–20, each: Decided D<n> / Non-goal / Open-accepted.
## Open risks (accepted) / Alternatives rejected
## Verify first
Environment-only checks that cannot run from here (deployed config, external
service state), each with its command. Material unknowns a plan task would be
written around — API shapes, field names, signatures, paths — must be
verified during the interview, never deferred here.
Spec lifecycle: the spec is the contract for the whole chain — write-plan
links it in the plan header, execute-plan and the review skill check the diff
against its numbered decisions, graph-retro attributes failures against it.
When the plan is promoted to docs/features/<TICKET-ID>/, promote the spec
with it (as design.md, or merge into an existing design.md) so the
decision record survives the gitignored WIP directory.
Step 2 — Confirm, then invoke write-plan
Ask the user to confirm before authoring the plan. Post the assembled spec
summary and ask exactly one question:
"Interview complete. Spec assembled above. Ready for me to write the plan with
write-plan? (yes / keep interviewing / edit the spec first)"
Do not author anything until the user answers yes (or equivalent). If they
say keep interviewing or want spec edits, return to the interview loop and
re-run the Self-Critique Gate before asking again.
Once confirmed, read the write-plan skill (write-plan/SKILL.md, wherever
your tool installs skills)
and follow it as the source of truth for authoring the plan, passing the
assembled spec as its input. Follow its full workflow — scope check, file
structure, data-path trace, bite-sized tasks, no-placeholders rule, Self-Review.
Suppress write-plan's Execution Handoff. When write-plan runs as this
sub-step, do not emit its "Plan complete… run /execute-plan" message — the
plan is not done until interview-plan's Audit Pass clears. interview-plan owns
the single final handoff (Audit Pass "Report and gate" below).
Default WIP path (gitignored), inferred from the branch name (e.g. PROJ-123)
or asked once:
docs/plans/<TICKET-ID>/<scope>-implementation-plan.md
Promote stable docs to docs/features/<TICKET-ID>/ (tracked). See write-plan
Documentation layout and your repo's own docs convention.
Step 3 — Run the Audit Pass
After write-plan saves the file, do not stop at write-plan's own handoff —
run the Audit Pass below against the written file before returning the path.
The Audit Pass is interview-plan's contribution on top of write-plan: it closes
every traceability gap (decision↔task, every consumer handled) with the user
still in the loop.
Audit Pass (mandatory before returning the path)
The point is to close every gap with the user still in the loop. Run all
passes against the written file (re-read it; do not trust memory).
Pass 1 — Matrix (traceability; the omission-catcher)
The syntactic scan catches bad phrasing; this catches omissions — the
thing that was never written. Build the Coverage Matrix in chat by mapping the
interview decision log + Discovery list against the ### Task N headers in
the write-plan-authored file:
- Every Decision (from the interview decision log) maps to at least one
Task (
### Task N). A decision with no task = an unimplemented decision
= gap.
- Every Task maps back to a Decision. A task with no decision = scope
creep — flag it. Exception: tasks marked
Implements: — (pure
plumbing, the coverage run, and the mandatory final Review gate task from
write-plan) — verify the justification in parentheses instead of flagging.
- Every Coverage Checklist item is Decided / Non-goal / Open-accepted.
- Every consumer from the Discovery list is handled by a task or
explicitly marked unaffected.
- No two Decisions conflict, and no Task implements a Non-goal — the
pairwise check from Self-Critique Gate item 6, re-run against the written
file.
Any orphan, unhandled consumer, or unresolved conflict → surface as an open
gap.
Pass 2 — Fresh-eyes review
Re-read the plan cold, as a reviewer with zero chat history. Write the
three questions such a reviewer would ask first. Answer each in the plan,
or surface it as an open gap. This runs the user's own review step before
handoff — it is the pass that catches what they currently catch after.
Pass 3 — Edge-hunt (per task)
For each task ask: what breaks this task? what precondition is unstated?
what is the reverse/rollback operation? Add an edge bullet to the task, or
surface as an open gap.
Pass 4 — Trimmed syntactic scan
Re-read for these only (secondary, fast):
| Pattern |
Means |
TODO, FIXME, XXX |
unresolved gap |
... inside a code block (not prose) |
hand-waved code |
| "as needed", "as appropriate", "handle this", "etc." |
vague behaviour |
| acceptance check that is a sentence, not a runnable command |
not verifiable |
any field name / route / env var / column / function NOT backed by file:line or Verify first: |
unevidenced assertion |
Fix anything fixable from existing context in one rewrite pass (replace
ellipses with a diff anchor or concrete sketch, sentences with commands,
guesses with Verify first:).
Report and gate
Post a compact audit table in chat:
Audit pass on <path>:
matrix : <d> decisions, <s> steps, <o> orphan decisions, <c> creep steps, <u> unhandled consumers
fresh-eyes : 3 cold questions → <answered> answered, <open> open
edge-hunt : <tasks> tasks → <covered> with edge notes, <open> gaps
syntactic scan : <n> hits → <fixed> fixed, <open> open
If any open count > 0, list each as section <n>: <one-line gap> and ask
the user to resolve. Do not return the path yet. Fold answers in (one rewrite
pass), re-run Passes 1–4. Repeat until every open count is 0.
If all open counts are 0: record **Audit:** clean @ <date> in the plan
file directly under its header, then return:
Plan ready at <absolute path>
Audit: clean.
Run /execute-plan (or say "execute") to implement it.
write-plan already ran — do not re-invoke it on this file.
Do not paste the file contents back into chat — the file is the
deliverable; pasting wastes tokens and forks the source of truth.
Anti-patterns
- Transcribing instead of discovering. Building the plan from the user's
words without reading the codebase first. The Discovery Phase is mandatory.
- Closing backward-compat from memory. The consumer list must come from
grep, and every entry must be handled. "Should be fine" is not a decision.
- Bundling real decisions into one turn (batch-confirming clearly-N/A items
is allowed).
- Asking the user what the repo already answers (file paths, patterns,
current behaviour, naming).
- Staying neutral instead of recommending — the user invoked this to be
pushed, not surveyed.
- Finishing with zero code-grounded findings (Rule 7) — means passive
interview.
- Treating "I can technically start coding" as the stopping bar. The bar is
three lenses + checklist + handled consumers + Self-Critique Gate.
- Authoring the plan file directly instead of handing the assembled spec to
the write-plan skill — write-plan owns the on-disk plan; this skill owns the
interview, the spec, and the Audit Pass.
- Stopping at write-plan's own execution handoff and skipping this skill's
Audit Pass — the Audit Pass is the omission-catcher and must run last.
- Asserting field names, routes, env vars, or library functions not actually
seen — use
Verify first: callouts.
- Returning the path before running the Audit Pass, or reporting "clean"
without re-reading the written file.
- Reporting "audit clean" while a matrix orphan or unhandled consumer
remains — the matrix pass is the omission-catcher; do not skip it.
1---2name: interview-plan3description: Interview the user one question at a time to produce an ambiguity-free implementation plan across three lenses — business requirements, backward compatibility, and technical. The model actively investigates the codebase first (Discovery Phase), confronts the user with what it found, and pushes back with alternatives — it does not transcribe the user's words. After the interview, it hands the assembled spec to the write-plan skill, which authors the on-disk plan, then runs an Audit Pass over that file so it is self-contained for a fresh model or engineer. Use only when the user explicitly invokes "interview-plan" or asks to "interview me" / "stress-test the plan" about a plan or design.4---56# Plan Interview78Produce **one ambiguity-free implementation plan** by interviewing the user9**one question at a time**. The crucial goal is a plan with **no ambiguity**10across three lenses:1112- **Business requirements** — what problem, measurable success, who, why not13 simpler.14- **Backward compatibility** — every consumer, stored record, in-flight15 message, and deployed client affected, **enumerated from the actual code**.16- **Technical** — behaviour, edge cases, data model, contracts, testing,17 rollout.1819The model **discovers and interrogates** — it reads the codebase first,20confronts the user with findings, and pushes back with alternatives. It does21**not** prepare a plan from the user's words alone. A plan built only from22what the user said is the failure mode this skill exists to prevent.2324The single output is **one plan markdown file written to disk** — authored by25the **write-plan** skill from the spec this interview assembles, then verified26by this skill's Audit Pass. It must be complete enough that a fresh reader can27implement it without a follow-up question.2829The goal is not "minimum questions to start coding". It is "no ambiguity30left that would bite us at code-review or in production".3132## Rules33341. **One question per turn.** Never bundle multiple questions, sub-questions,35 or "while we're at it" asides. If you catch yourself writing "and also" —36 delete it and save it for the next turn. (Batch-confirmations of clearly37 out-of-scope checklist items are not bundled questions; see "Using the38 Checklist Efficiently".)392. **Discover before asking.** Run the Discovery Phase first. Any fact that40 the codebase, configs, docs, or git history can answer — read it, don't41 ask. Questions of *intent* ("should we retry on this error?", "is partial42 success acceptable?", "do we need an audit log?") must always be asked;43 the code tells you what *is*, not what *should be*. Every question you do44 ask should be grounded in something you read, not in the user's framing.453. **Walk the decision tree depth-first.** Resolve a decision's dependencies46 before moving to the next sibling. Don't jump branches until the current47 one is settled.484. **Always recommend an answer.** For every question, propose your49 recommended answer with a one-sentence reason. The user can accept,50 override, or refine — this prevents stall. When the user overrides a51 recommendation, record the decision as52 `D<n>. <decision> (overrides recommendation: <user's reason>)`. Pushback53 with no reason → ask once for the reason before recording; never silently54 flip. Code-grounded findings remain facts regardless of the user's framing.555. **Tag the type of decision.** Mark each question as `[technical]`,56 `[product]`, `[compat]`, or `[scope]` so the user knows whether they're57 being asked an engineering tradeoff, a business call, a backward-compat58 call, or a boundary call.596. **Write the decision log to disk as you go.** Append each agreed answer,60 explicit non-goal, and open risk to61 `docs/specs/<TICKET-ID>/spec.md` **at the moment it is decided**62 (create the file from the **Spec File Template** below on the first63 decision). Every behavioral decision carries a `Check:` line — a runnable64 command or named test that proves it (or `manual QA: <step>`). Cannot65 write one = decision too vague; sharpen it in the same turn before66 recording. Long interviews degrade chat recall; the file cannot forget. The67 end-of-interview spec assembly (Output Step 1) organizes this file — it68 does not reconstruct decisions from memory. Also track the **consumer69 list** from Discovery in the same file so the backward-compat lens can be70 closed item by item. **On every append, check the new decision against the71 existing decisions and non-goals** — if it contradicts one, surface both72 immediately and ask which wins; do not record two conflicting decisions.737. **Push back with code-grounded findings, not just questions.** When you74 spot a simpler design, a non-obvious risk, a broken consumer, or a more75 idiomatic approach for *this* codebase — surface it on your own turn.76 Ground it in something you actually read. Use this format:7778 ```79 Observation: <what you found in the code, with file:line>80 Alternative: <what you would consider instead>81 Tradeoff: <one sentence on what each side costs>82 ```8384 Then ask if the user wants to switch. If you finish an interview without85 at least one code-grounded finding, you under-investigated — that is a86 failure, not a clean run.8788## Question Format8990```91Q[n] [type]: <single question>92Found: <the file:line / consumer / fact that prompted this, when applicable>93Recommendation: <your suggested answer>94Why: <one sentence>95```9697## Resume Protocol (check before anything else)9899If `docs/specs/<TICKET-ID>/spec.md` already exists for this branch,100this is a **resumed interview**, not a fresh one:1011021. Read the spec file. Post a two-line status: `<d> decisions, <n> non-goals,103 <o> open items` and the list of open items.1042. Do **not** re-ask decided items. Resume from the first open item105 (open risks, unresolved checklist entries, unhandled consumers).1063. Re-run Discovery only for areas the spec marks unexplored or that the code107 has changed since (check `git log` from the spec's recorded Discovery108 baseline SHA).1094. If the user's new framing contradicts a recorded decision, surface the110 conflict (Rule 6) instead of silently overwriting.1115. If an implementation plan for this `<TICKET-ID>` also exists (WIP or112 promoted), the interview likely already completed — confirm intent before113 re-opening. New decisions then flow into the spec **and** a plan114 amendment; never leave the two contradicting.115116Only when no spec file exists do you start at Calibration below.117118## First Turn (always) — Calibration119120**Resolve `<TICKET-ID>` first:**121`git branch --show-current | grep -oE '[A-Z]+-[0-9]+'` (adjust the pattern to122your tracker's key format). No match → ask for the ticket ID as part of the123calibration turn (administrative, not a decision — not a Rule 1 violation).124Rule 6 writes the spec to `docs/specs/<TICKET-ID>/spec.md` at the first125decision, so the ID must exist before Q1. If the project does not use ticket126IDs, use a short kebab-case slug for the feature.127128**Then read the project quirks doc if one exists** (e.g. `docs/quirks.md` —129hard-learned domain gotchas) and list the entries relevant to this feature so130the user sees what is already covered. **Do not ask the user to enumerate131quirks here.** A cold recall question asked before Discovery has read anything132is the transcription failure this skill exists to prevent, and it asks for133negative knowledge — what would a generic reviewer miss? — which nobody can134produce on demand. Unknown quirks are surfaced as grounded candidates in135Discovery step 7 instead.136137Treat the quirks doc entries as permanent context for the rest of the138interview — every subsequent question, finding, and alternative is filtered139through them, and step 7's accepted candidates join them.140141## Discovery Phase (always — before Q1)142143After calibration, **investigate before questioning**. Do not ask the user144anything answerable from the repo. Read, then report. Produce a short145**Findings** block in chat (not a wall of text):1461471. **Touched code & patterns** — read the files the change will modify and148 the existing patterns there (naming, layering, error handling).1492. **Consumers** — grep for every caller of any function, field, route, event,150 or contract the change touches. List them with `file:line`. This list *is*151 the backward-compat surface. **For API/event/contract changes, the grep MUST152 span every repo/package that consumes the contract** — prefix each entry153 with the repo/package name. **When the change removes a field or stops writing154 one, include same-repo readers that *derive* behavior from it** — audit diffs,155 changed-field labels, conditional logs, cache keys. These break silently: the156 field is simply never there, so nothing throws.1573. **Stored / in-flight data** — records written under the old contract,158 queued messages, deployed clients that will outlive the deploy.1594. **Existing tests** — tests that pin current behaviour and would break.1605. **Product context** — read the repo README, `docs/features/` entries for161 adjacent tickets, and any product docs touching this domain. Business162 rules often live in docs, not code — a discovery that reads only code163 misses them.1646. **Business scenario hunt (generative, not confirmatory).** From the facts165 gathered above, **generate 5–10 candidate edge scenarios** the user has166 not mentioned, then present them as one batch for accept/reject (each is167 binary — this is not a Rule 1 violation). Mine these axes:168 - **actor × state × timing** — two users mutating the same entity; the169 entity deleted/archived mid-flow; a retry landing after success.170 - **abuse / misuse** — quota exhaustion, oversized input, repeated calls,171 a caller from the wrong tenant/role.172 - **money / counting** — rounding, currency, off-by-one on limits,173 double-counting on replay.174 - **lifecycle** — feature toggled off mid-operation, account downgraded,175 entity re-created with the same natural key.176 - **failed write** — the mutation rejects: does local state revert to the177 server value, or does the user keep seeing an unsaved value as if it178 were stored?179 Each accepted scenario becomes a Decision (how it must behave) — propose180 the expected outcome with the batch and confirm it before recording the181 D-number; acceptance without defined behavior is not a decision. Each182 accepted scenario later becomes a test in the plan's test matrix; each183 rejected one is recorded as a Non-goal. Presenting zero generated184 scenarios = under-investigation, same failure as finishing with zero185 code-grounded findings.1867. **Quirk sweep (generative, not confirmatory).** From the code read above,187 **generate the divergences a generic reviewer would miss** and present them188 as one batch for accept/reject. Never ask the user to recall quirks from189 memory — every candidate cites `file:line` and proposes a reading. Mine190 these axes:191 - **scope boundary** — account vs location vs user vs tenant enforced in192 one layer and not another.193 - **filter / time-window semantics** — two call sites reading the same194 source with different filters, boundaries, or timezone handling.195 - **hidden contracts** — idempotency keys, dedup windows, event ordering196 relied on but not enforced.197 - **protected sections** — code whose comments, tests, or git history warn198 against the obvious change; in-flight migrations.199 Format each as `Found: <file:line> — <the divergence> | quirk (intentional)200 or bug?` with a recommendation. Zero candidates is a valid outcome — say so201 explicitly rather than inventing one. Accepted candidates become permanent202 interview context; the ones that recur across tickets are the quirks doc's203 input (graph-retro Step 5 routes them there).204205Output the Findings as a compact list, then drive questions from it. Each206finding is either:207208- **silent-logged** (obvious, no decision needed), or209- **turned into a pointed question** (`Q[n]` with a `Found:` line).210211Example of discovery-driven questioning (vs transcribing):212213> Found: `tagLookup` read in `sales/.../x.ts:42` and `workflow/.../y.ts:88`;214> sales reads `legacyTarget`, which your change removes.215> Q3 [compat]: Break sales, migrate it, or dual-write `legacyTarget` for one216> release?217> Recommendation: dual-write one release, then drop — zero-downtime.218> Why: sales deploys on a different cadence; a hard break strands it.219220If Discovery reveals the codebase contradicts a user assumption, surface it221immediately as an Observation/Alternative (Rule 7) before continuing.222223## Three Lenses (must all be cleared)224225The interview cannot stop until **each lens** is fully resolved:226227- **Business requirements** — problem, measurable success, target user/role,228 why a simpler/cheaper option was rejected.229- **Backward compatibility** — **every** item on the Discovery consumer list230 is Decided / Non-goal / Open-accepted. This list is derived from grep, not231 from memory. This is the lens that bites hardest at review — never close it232 on "should be fine".233- **Technical** — the Coverage Checklist below.234235## Coverage Checklist (the technical + business bar)236237Before producing the plan, every item below must be **Decided**,238**Non-goal**, or **Open risk — accepted**. Never leave one as "didn't think239about it".240241**Technical:**2422431. Functional behaviour — happy path, expected inputs/outputs.2442. Edge cases and failure modes — empty/null/duplicate/concurrent inputs,245 partial failure, timeouts, retries that arrive after success.2463. Data model & schema changes — new fields, migrations, backfill, indexing,247 schema versioning. **Schema presence is not persistence:** for each new248 field, confirm the actual writer (repository insert / `build` / publish249 payload, not just the domain type) carries it, and that a test reads it back250 WITHOUT mocking the writer. A field with a schema default that the writer251 omits ships zeros/nulls and looks deployed — must-resolve, not obvious-skip.2524. API / event contract — request/response shape, status codes, versioning.2535. Backward compatibility — deployed clients, in-flight messages, stored254 records written under the old contract. (Cross-check the Discovery list.)2556. Idempotency & retries — idempotency key, dedup window.2567. Authn / authz — who can call this, required permissions, cross-tenant257 exposure prevention.2588. Observability — logs, metrics, traces, alerts; what a support engineer259 sees when this breaks at 3am.2609. Testing strategy — unit/integration/functional, coverage bar, must-test261 scenarios.26210. Rollout & rollback — feature flag, staged release, kill switch, order of263 operations across services, revert without data loss. **Activation:** what264 switch makes this take effect (env var wired into the running service,265 index created, a queue/topic subscription added, feature flag enabled,266 infra (IaC) applied) — and what would leave it silently inert despite267 green tests.26811. Performance & scale — volume, latency budget, cost ceiling, burst load.26912. UX / accessibility / i18n — if user-facing.27013. Documentation — README, AGENTS.md, runbook, API spec, ADR/DECISIONS.md.27114. Dependencies — new libs/services, version pins, failure mode if down.272273**Business / domain:**27427515. Business intent — problem solved, measurable success, simpler276 alternatives considered and why rejected.27716. Domain-specific edge cases — idempotency-on-replay, scope-boundary278 (account vs location vs user vs tenant), time-window/filter-semantics279 mismatches between layers, state drift between subsystems, domain280 event-ordering races. Use the Discovery step 7 quirk sweep to enumerate281 the specific quirks for *this* codebase.28217. User personas / roles — does behaviour differ by role, tier, app, or283 feature flag.28418. Operational impact — what support sees, runbook/alert needed, who's285 paged, manual recovery path.28619. Compliance / data handling — PII, retention, audit trail, cross-tenant287 exposure, regulatory scope.28820. Scope & phasing — which parts are must-have vs nice-to-have; can the work289 split into phases or separate plans, and what ships first. Ask this290 **once, explicitly** — write-plan's Scope Check can only react; the split291 decision belongs in the interview.292293## Using the Checklist Efficiently294295The checklist is the **coverage bar**, not a literal question list. Asking296all 20 mechanically is a failure mode. For each item:297298- **Obvious from code/context → silent log.** Record it silently and move299 on. Don't burn a turn confirming the obvious.300- **Clearly out of scope → batch-confirm.** Combine adjacent N/A items into301 one confirmation turn: *"Assuming internal-only — no UX, no i18n, no public302 API surface, no PII. Confirm?"* Not a Rule 1 violation; each item is binary.303- **Material and non-obvious → real `Q[n]` turn.** Only items where the304 answer is both non-obvious AND would materially change the plan.305306This is the difference between a 12-turn high-signal interview and a 25-turn307mechanical one.308309## Stopping Condition310311Stop only when **all** are true:312313- All three lenses are cleared (business, backward-compat, technical).314- Every Coverage Checklist item is Decided / Non-goal / Open-risk-accepted.315- Every consumer on the Discovery list is handled.316- No remaining question would, if answered differently, materially change317 the plan.318- You can produce the plan without the phrase "to be decided".319320Or: the user signals completion — "enough" / "good" / "let's go" /321equivalent. "stop" / "pause" is cancellation, not completion: save the spec322state and exit without the Self-Critique Gate or the write-plan confirmation.323324When stopping, run the Self-Critique Gate. Do **not** ask "are we done?" — judge325that yourself. But **before authoring anything**, ask the user one explicit326confirmation to proceed to write-plan (see "Output" Step 2). Only after the user327confirms do you invoke write-plan, then run the Audit Pass against the file it328produced.329330## Self-Critique Gate (run silently before handing off to write-plan)331332Anything that fails becomes one more turn, not a buried gap.3333341. **Skipped questions** — what three questions did I almost ask but skip?335 If any skip-reason is weaker than "explicit non-goal" or "unambiguous from336 code", ask now.3372. **Most-likely review flag** — the single most likely thing a reviewer will338 flag that I have not raised? Raise it now.3393. **Soft answers** — was I answered with "yeah, sure" / "we'll see" /340 "probably"? Not decisions. Re-ask with a sharper recommendation, force a341 yes/no.3424. **Silent disagreement** — what would I have designed differently from343 scratch? Surfaced as an Observation/Alternative? If not, surface it now.3445. **Untouched consumer** — is any consumer from the Discovery list still345 unhandled? If so, that's an open backward-compat gap — ask.3466. **Decision conflicts** — walk the decision log pairwise (and against the347 non-goals): does any later decision contradict, narrow, or silently348 supersede an earlier one? A late decision that reverses an early one must349 be marked `supersedes D<n>` in the spec, with the loser struck — never350 leave both standing.3517. **Deferred material check** — does `## Verify first` hold anything a plan352 task would be written around (API shape, field name, signature, path)?353 Verify it now; Verify-first is for environment-only checks.354355## Output: Hand off to write-plan (the plan author)356357This skill does **not** author the plan file itself. When the Stopping358Condition is met, it assembles the interview result into a **spec** and hands359that spec to the **write-plan** skill, which authors the comprehensive plan.360The division of labour:361362- **interview-plan** owns: Discovery, the one-question interview, the three363 lenses, the Coverage Checklist, the Self-Critique Gate, and the **Audit Pass**.364- **write-plan** owns: turning the resolved spec into the on-disk plan file365 (file structure, bite-sized tasks, full-code steps, its own Self-Review,366 execution handoff).367368### Step 1 — Assemble the spec (organize the spec file, before invoking write-plan)369370Organize `docs/specs/<TICKET-ID>/spec.md` (built incrementally per371Rule 6) into the **Spec File Template** below, and post a summary in chat.372write-plan reads the spec **file** — zero ambiguity, no chat history needed.373374#### Spec File Template (deterministic layout — write-plan depends on it)375376```markdown377# <TICKET-ID> — <one-line goal>378379## Goal & business intent380Problem, measurable success, target user/role.381382## Decisions383D1. <one line> (mark `supersedes D<n>` when a decision replaces one;384 mark `(overrides recommendation: <reason>)` when the385 user overrode the recommended answer)386 Check: <runnable command / named test / `manual QA: <step>`>387D2. ...388389## Non-goals390NG1. <one line — includes rejected business scenarios from the scenario hunt>391392## Consumers (from Discovery — the backward-compat surface)393| # | repo:file:line | contract touched | status (Decided Dn / Non-goal / Open-accepted) |394395## Discovery findings396Baseline: <repo> @ <short SHA> (per repo — resume diffs `git log` from here).397Touched code & patterns, stored/in-flight data, tests that pin behaviour,398product-doc facts.399400## Business edge scenarios401Accepted (each → a D-number) and rejected (each → an NG-number).402403## Coverage Checklist status4041–20, each: Decided D<n> / Non-goal / Open-accepted.405406## Open risks (accepted) / Alternatives rejected407408## Verify first409Environment-only checks that cannot run from here (deployed config, external410service state), each with its command. Material unknowns a plan task would be411written around — API shapes, field names, signatures, paths — must be412verified during the interview, never deferred here.413```414415**Spec lifecycle:** the spec is the contract for the whole chain — write-plan416links it in the plan header, execute-plan and the review skill check the diff417against its numbered decisions, graph-retro attributes failures against it.418When the plan is promoted to `docs/features/<TICKET-ID>/`, promote the spec419with it (as `design.md`, or merge into an existing `design.md`) so the420decision record survives the gitignored WIP directory.421422### Step 2 — Confirm, then invoke write-plan423424**Ask the user to confirm before authoring the plan.** Post the assembled spec425summary and ask exactly one question:426427> "Interview complete. Spec assembled above. Ready for me to write the plan with428> write-plan? (yes / keep interviewing / edit the spec first)"429430Do not author anything until the user answers `yes` (or equivalent). If they431say keep interviewing or want spec edits, return to the interview loop and432re-run the Self-Critique Gate before asking again.433434Once confirmed, read the **write-plan** skill (`write-plan/SKILL.md`, wherever435your tool installs skills)436and follow it as the source of truth for authoring the plan, passing the437assembled spec as its input. Follow its full workflow — scope check, file438structure, data-path trace, bite-sized tasks, no-placeholders rule, Self-Review.439440**Suppress write-plan's Execution Handoff.** When write-plan runs as this441sub-step, do **not** emit its "Plan complete… run /execute-plan" message — the442plan is not done until interview-plan's Audit Pass clears. interview-plan owns443the single final handoff (Audit Pass "Report and gate" below).444445Default WIP path (gitignored), inferred from the branch name (e.g. `PROJ-123`)446or asked once:447448`docs/plans/<TICKET-ID>/<scope>-implementation-plan.md`449450Promote stable docs to `docs/features/<TICKET-ID>/` (tracked). See **write-plan**451Documentation layout and your repo's own docs convention.452453### Step 3 — Run the Audit Pass454455After write-plan saves the file, **do not** stop at write-plan's own handoff —456run the Audit Pass below against the written file before returning the path.457The Audit Pass is interview-plan's contribution on top of write-plan: it closes458every traceability gap (decision↔task, every consumer handled) with the user459still in the loop.460461## Audit Pass (mandatory before returning the path)462463The point is to close every gap *with the user still in the loop*. Run all464passes against the **written file** (re-read it; do not trust memory).465466### Pass 1 — Matrix (traceability; the omission-catcher)467468The syntactic scan catches bad phrasing; this catches **omissions** — the469thing that was never written. Build the Coverage Matrix in chat by mapping the470interview decision log + Discovery list against the **`### Task N`** headers in471the write-plan-authored file:472473- Every **Decision** (from the interview decision log) maps to at least one474 **Task** (`### Task N`). A decision with no task = an unimplemented decision475 = gap.476- Every **Task** maps back to a Decision. A task with no decision = scope477 creep — flag it. **Exception:** tasks marked `Implements: —` (pure478 plumbing, the coverage run, and the mandatory final Review gate task from479 write-plan) — verify the justification in parentheses instead of flagging.480- Every **Coverage Checklist item** is Decided / Non-goal / Open-accepted.481- Every **consumer** from the Discovery list is handled by a task or482 explicitly marked unaffected.483- **No two Decisions conflict**, and no Task implements a Non-goal — the484 pairwise check from Self-Critique Gate item 6, re-run against the written485 file.486487Any orphan, unhandled consumer, or unresolved conflict → surface as an open488gap.489490### Pass 2 — Fresh-eyes review491492Re-read the plan **cold**, as a reviewer with zero chat history. Write the493**three questions** such a reviewer would ask first. Answer each in the plan,494or surface it as an open gap. This runs the user's own review step *before*495handoff — it is the pass that catches what they currently catch after.496497### Pass 3 — Edge-hunt (per task)498499For each task ask: **what breaks this task? what precondition is unstated?500what is the reverse/rollback operation?** Add an edge bullet to the task, or501surface as an open gap.502503### Pass 4 — Trimmed syntactic scan504505Re-read for these only (secondary, fast):506507| Pattern | Means |508|---|---|509| `TODO`, `FIXME`, `XXX` | unresolved gap |510| `...` inside a code block (not prose) | hand-waved code |511| "as needed", "as appropriate", "handle this", "etc." | vague behaviour |512| acceptance check that is a sentence, not a runnable command | not verifiable |513| any field name / route / env var / column / function NOT backed by `file:line` or `Verify first:` | unevidenced assertion |514515Fix anything fixable from existing context in one rewrite pass (replace516ellipses with a diff anchor or concrete sketch, sentences with commands,517guesses with `Verify first:`).518519### Report and gate520521Post a compact audit table in chat:522523```524Audit pass on <path>:525 matrix : <d> decisions, <s> steps, <o> orphan decisions, <c> creep steps, <u> unhandled consumers526 fresh-eyes : 3 cold questions → <answered> answered, <open> open527 edge-hunt : <tasks> tasks → <covered> with edge notes, <open> gaps528 syntactic scan : <n> hits → <fixed> fixed, <open> open529```530531**If any open count > 0**, list each as `section <n>: <one-line gap>` and ask532the user to resolve. Do not return the path yet. Fold answers in (one rewrite533pass), re-run Passes 1–4. Repeat until every open count is 0.534535**If all open counts are 0**: record `**Audit:** clean @ <date>` in the plan536file directly under its header, then return:537538> Plan ready at `<absolute path>`539> Audit: clean.540> Run `/execute-plan` (or say "execute") to implement it.541> write-plan already ran — do not re-invoke it on this file.542543Do **not** paste the file contents back into chat — the file is the544deliverable; pasting wastes tokens and forks the source of truth.545546## Anti-patterns547548- **Transcribing instead of discovering.** Building the plan from the user's549 words without reading the codebase first. The Discovery Phase is mandatory.550- **Closing backward-compat from memory.** The consumer list must come from551 grep, and every entry must be handled. "Should be fine" is not a decision.552- Bundling real decisions into one turn (batch-confirming clearly-N/A items553 is allowed).554- Asking the user what the repo already answers (file paths, patterns,555 current behaviour, naming).556- Staying neutral instead of recommending — the user invoked this to be557 pushed, not surveyed.558- Finishing with zero code-grounded findings (Rule 7) — means passive559 interview.560- Treating "I can technically start coding" as the stopping bar. The bar is561 three lenses + checklist + handled consumers + Self-Critique Gate.562- Authoring the plan file directly instead of handing the assembled spec to563 the write-plan skill — write-plan owns the on-disk plan; this skill owns the564 interview, the spec, and the Audit Pass.565- Stopping at write-plan's own execution handoff and skipping this skill's566 Audit Pass — the Audit Pass is the omission-catcher and must run last.567- Asserting field names, routes, env vars, or library functions not actually568 seen — use `Verify first:` callouts.569- Returning the path before running the Audit Pass, or reporting "clean"570 without re-reading the written file.571- Reporting "audit clean" while a matrix orphan or unhandled consumer572 remains — the matrix pass is the omission-catcher; do not skip it.