bb-plan · git:20260608.1149f4a · 2026-06-08 · sha256 6b66ac7a1ef4b04e
bb-plan git:20260608.1149f4aA
Immutable. This exact content never changes and is served at /api/v1/blob/6b66ac7a1ef4b04e.
---
name: bb-plan
description: Execute the implementation planning workflow using the plan template to generate design artifacts.
argument-hint: <tech stack and context>
---
> **Templates:** If you need the template files referenced below (spec-template.md, plan-template.md, etc.), they are available in the BuildBetter Skills repository at `templates/`. If installed locally, check `~/.bb-skills/templates/` or the project's `templates/` directory.
## User Input
```text
$ARGUMENTS
```
You **MUST** consider the user input before proceeding (if not empty).
## Outline
1. **Setup**: Locate the current feature directory by finding the active feature branch and its corresponding specs directory. Parse for FEATURE_SPEC, IMPL_PLAN, SPECS_DIR, BRANCH. For single quotes in args like "I'm Groot", use escape syntax: e.g 'I'\''m Groot' (or double-quote if possible: "I'm Groot").
2. **Load context**: Read FEATURE_SPEC and `constitution.md` (project-relative; check project root or `docs/` directory). Load IMPL_PLAN template (already copied). Also load BuildBetter artifacts when present:
- `FEATURE_DIR/buildbetter-context.md`
- `FEATURE_DIR/buildbetter-context.json`
- `FEATURE_DIR/user-stories.md`
Treat these as evidence inputs for planning decisions and tradeoff rationale.
3. **Execute plan workflow**: Follow the structure in IMPL_PLAN template to:
- Fill Technical Context (mark unknowns as "NEEDS CLARIFICATION")
- Fill Constitution Check section from constitution
- Fill BuildBetter Context section from evidence artifacts (or explicitly state unavailable)
- Evaluate gates (ERROR if violations unjustified)
- Phase 0: Generate research.md (resolve all NEEDS CLARIFICATION)
- Phase 1: Generate data-model.md, contracts/, quickstart.md
- Ensure plan references product taxonomy, product areas, domains, and customers affected (if available from BuildBetter context)
- Phase 1: Update agent context as needed
- Re-evaluate Constitution Check post-design
4. **Stop and report**: Command ends after Phase 2 planning. Report branch, IMPL_PLAN path, generated artifacts, and whether BuildBetter evidence was used.
## Phases
### Phase 0: Outline & Research
1. **Extract unknowns from Technical Context** above:
- For each NEEDS CLARIFICATION -> research task
- For each dependency -> best practices task
- For each integration -> patterns task
- For each evidence-backed customer pain point -> validation task in research
2. **Generate and dispatch research agents**:
```text
For each unknown in Technical Context:
Task: "Research {unknown} for {feature context}"
For each technology choice:
Task: "Find best practices for {tech} in {domain}"
```
3. **Consolidate findings** in `research.md` using format:
- Decision: [what was chosen]
- Rationale: [why chosen]
- Alternatives considered: [what else evaluated]
- Evidence linkage: [BuildBetter evidence IDs and quotes that influenced the decision]
**Output**: research.md with all NEEDS CLARIFICATION resolved
### Phase 1: Design & Contracts
**Prerequisites:** `research.md` complete
1. **Extract entities from feature spec** -> `data-model.md`:
- Entity name, fields, relationships
- Validation rules from requirements
- State transitions if applicable
2. **Define interface contracts** (if project has external interfaces) -> `/contracts/`:
- Identify what interfaces the project exposes to users or other systems
- Document the contract format appropriate for the project type
- Examples: public APIs for libraries, command schemas for CLI tools, endpoints for web services, grammars for parsers, UI contracts for applications
- Skip if project is purely internal (build scripts, one-off tools, etc.)
3. **Agent context update**:
- Update the appropriate agent-specific context file if needed
- Add only new technology from current plan
- Preserve manual additions between markers
**Output**: data-model.md, /contracts/*, quickstart.md, agent-specific file
## Key rules
- Use absolute paths
- ERROR on gate failures or unresolved clarifications