Feature Planning
Interactive planning workflow that gathers requirements, validates assumptions, and proposes a solution before any code
is written.
Phase 1: Gather Requirements
Collect the plan proposal from the user. If the goal argument was provided, use it and skip the first question.
Ask the user the following questions one at a time using AskUserQuestion. After each answer, acknowledge it
briefly before asking the next question. Stop and wait for the user's reply after each question. Do not ask
multiple questions in one message.
- High-level goal — "What is the high-level goal of this feature or change?"
- Essential requirements — "What are the essential requirements? (things that must be true for this to be done)"
- Considerations (optional) — "Anything specific to consider? (existing patterns, performance constraints,
compatibility, etc. — say 'skip' if none)"
- Things to avoid (optional) — "Anything to explicitly avoid? (approaches, dependencies, patterns, etc. — say '
skip' if none)"
For questions 3-4, accept "skip" or "none" as valid answers and move on.
After collecting all answers, summarize the proposal back to the user in a compact format:
**Goal:** ...
**Must have:** ...
**Consider:** ...
**Avoid:** ...
Ask the user to confirm the proposal is correct before proceeding.
Phase 2: Research and Assumptions
Read the codebase documentation to understand the problem space:
- Read
.claude/CODEBASE.mdand any linked docs relevant to the goal. - Use LSP (
documentSymbol,goToDefinition,findReferences,workspaceSymbol) for Rust/TS code exploration.
Fall back to Glob/Grep/Read for docs, config files, and when LSP is unavailable.
- Identify the modules, traits, and types involved.
Then list your assumptions — things you believe to be true based on your research that affect the solution design.
Present these to the user as a numbered list and ask them to confirm, correct, or add to them using AskUserQuestion
with options like "Confirmed", "Need corrections" (user types details), "Add more assumptions".
Example format:
Based on my research, here are my assumptions:
1. This change affects
tycho-indexer/src/services/rpc.rsandtycho-common/src/dto.rs
2. The
ExtractionGatewaytrait doesn't need to change
3. ...
Are these correct? Anything to add or fix?
Do not proceed until the user confirms.
Phase 3: Propose Solution
With confirmed assumptions, propose a high-level solution. The proposal must include:
- Approach — 2-3 sentence summary of the solution
- Files to modify — list each file with a one-line description of the change
- New files (if any) — list each with purpose
- Key design decisions — any non-obvious choices and why
Present the proposal and ask the user to choose using AskUserQuestion (this is the one structured choice point):
- Accept and implement — proceed to full implementation
- Accept and scaffold (auto-accept changes) — create the structure with placeholder logic (Phase 4a)
- Reject — user explains what's wrong, loop back to Phase 3
If rejected, incorporate the user's feedback, revise the proposal, and present again. If any different input is given,
process it and loop back to step 3.
Phase 4a: Scaffold (if chosen)
Spawn a subagent using the Agent tool to perform the scaffolding. Pass it the full plan context (goal, requirements,
assumptions, proposed solution, and file list) so it has everything it needs.
Subagent prompt must include these instructions:
You are scaffolding a feature. Create only structural changes — no business logic.
Required changes:
- New files with module declarations and imports
- Empty or stub function/method signatures with
todo!()bodies
- New struct/enum definitions with fields
- Trait implementations with
todo!()bodies
- Required
moddeclarations andusestatements
- Imports and calls to new scaffolded code, the user wants to see how it is connected to the existing codebase.
- All structs and fields should be documented briefly so the user knows their intended purpose
- Unit tests calling the public API of the new code with actual assertions based on user requirements. These tests
should be market with #[ignore].
Rules:
- No business logic — use
todo!()for function bodies
- Add a brief comment above each
todo!()describing what it should do
- Make sure the scaffolded code is "connected", that it is called in controllers or factories.
- After all changes, run
cargo check --workspace --all-featuresto verify the code compiles
- If
cargo checkfails, read the errors, fix them, and runcargo checkagain
- Repeat until
cargo checkpasses
- Report back: files created/modified, and the final
cargo checkresult
After the subagent completes, report the results to the user and tell them the scaffold is ready for review. Do NOT
proceed to implementation automatically.
Phase 4b: Implement (if chosen)
- Save the full plan to
.claude/plans/<name>.mdwhere<name>is a kebab-case slug derived from the goal.
Include all gathered context: goal, requirements, assumptions, proposed solution, and files list.
- Load the relevant knowledge documents for the implementation:
- Rust:
.claude/knowledge/rust.md - Python (tycho-client-py):
.claude/knowledge/python.md
- Implement the solution file by file. After completing all changes, run a quick validation:
cargo check --workspacefor Rust changesmaturin develop+pytestfor Python binding changes
- Report what was implemented and any remaining work.
Planning guidelines
- No speculative features — Don't add features, flags, or configuration unless actively needed.
- No premature abstraction — Don't create utilities until you've written the same code three times.
- Clarity over cleverness — Prefer explicit, readable code over dense one-liners.
- Justify new dependencies — Each dependency is attack surface and maintenance burden.
- Finish the job — Handle edge cases you can see. Clean up what you touched. Flag broken adjacent code. But don't
invent new scope.