description: Create an implementation spec for a feature or task
A hybrid approach using subagents: research in isolated context, interview in main context, write in isolated context.
Run git rev-parse --show-toplevel to locate the repository root.
Read <git-root>/.bonfire/config.json if it exists.
Specs location: Read specsLocation from config. Default to .bonfire/specs/ if not set.
Get the topic from $ARGUMENTS or ask if unclear.
Check for existing context:
<git-root>/.bonfire/index.md for project stateSPEC.md or spec.md in git root (user's spec template)Use the Task tool to invoke the codebase-explorer subagent for research.
Provide a research directive with these questions:
Research the codebase for implementing: [TOPIC]
Find:
1. **Patterns & Architecture**: How similar features are implemented, existing abstractions to reuse, naming conventions
2. **Technical Constraints**: Dependencies, API boundaries, performance considerations
3. **Potential Conflicts**: Files that need changes, intersections with existing code, migration concerns
Return structured findings only - no raw file contents.
Wait for the subagent to return findings before proceeding.
The subagent runs in isolated context (haiku model, fast), preserving main context for interview.
Using the research findings, interview the user with informed questions via AskUserQuestion.
Ask about fundamental approach based on patterns found:
Example questions (adapt based on actual findings):
services/ and [Pattern B] in handlers/. Which pattern should this feature follow?"Based on Round 1 answers and research, ask about:
Example questions:
If scope is still unclear:
Keep asking rounds of questions until you have clarity on:
Tell the user "I have enough to write the spec" when ready.
Use the Task tool to invoke the spec-writer subagent.
Provide:
<git-root>/<specsLocation>/<filename>.md)The subagent will write the spec file directly.
Naming convention: <issue-id>-<topic>.md or <topic>.md
Add a reference to the spec in <git-root>/.bonfire/index.md under Current State.
Read the generated spec and present a summary. Ask if user wants to:
Good questions are:
Bad questions:
Examples of good informed questions:
UserService uses repository pattern but OrderService uses direct DB access. Which approach?"auth middleware validates JWT but doesn't check permissions. Should this feature add permission checks or assume auth is enough?"BaseController with shared logic. Extend it or keep this feature standalone?"Specs are temporary artifacts - they exist to guide implementation:
When a spec is fully implemented:
docs/