Bootstrap Spec-Kit
Generate a customized spec-kit configuration for an existing codebase. Uses the project profile from /speckit.brownfield.scan (or performs a scan if none exists) to create a constitution, templates, and agent configuration that match the project's actual architecture, tech stack, and conventions.
User Input
$ARGUMENTS
You MUST consider the user input before proceeding (if not empty). The user may specify preferences (e.g., "strict TDD", "minimal constitution"), a target directory for a monorepo module, or request specific template customizations.
Prerequisites
- Verify the current directory is a git repository
- Verify a spec-kit project exists by checking for
.specify/ directory (run specify init first if missing)
- Check if a project profile exists from a previous scan — if not, run a scan first
Outline
Load or generate project profile: Check if /speckit.brownfield.scan has been run:
- If a project profile exists, use it
- If not, perform an inline scan to gather tech stack, architecture, and conventions
- Confirm the profile with the user before proceeding
Generate constitution: Create .specify/memory/constitution.md tailored to the project:
The constitution MUST include:
- Project identity: Name, purpose, primary language(s), architecture pattern
- Code boundaries: Which directories contain which types of code (e.g., "frontend code lives in
client/, backend in server/")
- Naming conventions: File naming, variable naming, branch naming as detected
- Testing requirements: Test framework, test location, coverage expectations
- Dependency rules: How modules depend on each other, what imports are allowed
- Quality gates: Linting, formatting, CI checks that must pass
The constitution MUST NOT:
- Override existing project standards without user confirmation
- Invent conventions that don't exist in the codebase
- Include generic boilerplate unrelated to the actual project
Customize spec template: Modify .specify/templates/spec-template.md to reflect the project:
- Add project-specific sections (e.g., "Database Migrations" for projects with ORMs)
- Include architecture-aware requirements (e.g., "Frontend Requirements" and "API Requirements" for full-stack projects)
- Reference actual module paths instead of generic placeholders
Customize plan template: Modify .specify/templates/plan-template.md to reflect the project:
- Include module-aware implementation sections (e.g., separate phases for frontend/backend)
- Reference actual test frameworks and build tools
- Include project-specific complexity factors
Customize tasks template: Modify .specify/templates/tasks-template.md to reflect the project:
- Task phases should map to the project's actual module structure
- Include project-specific setup tasks (e.g., database migration, dependency install)
- Reference actual test commands (e.g.,
npm test, pytest, go test ./...)
Generate AGENTS.md (if multi-module): For monorepos and multi-module projects:
- Define agent boundaries per module
- Specify which agent owns which directories
- Set up inter-agent communication rules
Present changes: Show the user what will be created or modified:
# Bootstrap Plan
| File | Action | Description |
|------|--------|-------------|
| `.specify/memory/constitution.md` | Create | Project-specific constitution with detected conventions |
| `.specify/templates/spec-template.md` | Modify | Add project-specific sections (Database Migrations, API Contract) |
| `.specify/templates/plan-template.md` | Modify | Add module-aware phases (frontend, backend, shared) |
| `.specify/templates/tasks-template.md` | Modify | Add actual test commands and build steps |
| `AGENTS.md` | Create | Agent boundaries for frontend and backend modules |
Proceed with bootstrap? (confirm before writing)
Execute bootstrap: After user confirmation, write all files.
Report:
# Bootstrap Complete
| Artifact | Status |
|----------|--------|
| Constitution | ✅ Created — 12 rules from detected conventions |
| Spec template | ✅ Customized — added Database Migrations, API Contract sections |
| Plan template | ✅ Customized — frontend/backend phase split |
| Tasks template | ✅ Customized — actual test commands included |
| AGENTS.md | ✅ Created — 2 agents (frontend, backend) |
## Next Steps
- Review `.specify/memory/constitution.md` and adjust any rules
- Run `/speckit.brownfield.validate` to verify configuration matches project
- Run `/speckit.brownfield.migrate` to reverse-engineer specs for existing features
- Start new features with `/speckit.specify` — templates are now project-aware
Rules
- Always confirm before writing — show the bootstrap plan and wait for approval
- Never overwrite without asking — if constitution or templates already exist, show a diff and ask
- Derive from reality — every constitution rule must trace to something detected in the codebase
- No invented conventions — if the project has no consistent pattern for something, say so instead of guessing
- Respect existing spec-kit setup — if
.specify/ already has customizations, merge rather than replace
- Module-aware — for monorepos, generate configuration that respects module boundaries
1---2name: speckit-brownfield-bootstrap3description: Generate spec-kit configuration tailored to the existing codebase4---56# Bootstrap Spec-Kit78Generate a customized spec-kit configuration for an existing codebase. Uses the project profile from `/speckit.brownfield.scan` (or performs a scan if none exists) to create a constitution, templates, and agent configuration that match the project's actual architecture, tech stack, and conventions.910## User Input1112```text13$ARGUMENTS14```1516You **MUST** consider the user input before proceeding (if not empty). The user may specify preferences (e.g., "strict TDD", "minimal constitution"), a target directory for a monorepo module, or request specific template customizations.1718## Prerequisites19201. Verify the current directory is a git repository212. Verify a spec-kit project exists by checking for `.specify/` directory (run `specify init` first if missing)223. Check if a project profile exists from a previous scan — if not, run a scan first2324## Outline25261. **Load or generate project profile**: Check if `/speckit.brownfield.scan` has been run:27 - If a project profile exists, use it28 - If not, perform an inline scan to gather tech stack, architecture, and conventions29 - Confirm the profile with the user before proceeding30312. **Generate constitution**: Create `.specify/memory/constitution.md` tailored to the project:3233 The constitution **MUST** include:34 - **Project identity**: Name, purpose, primary language(s), architecture pattern35 - **Code boundaries**: Which directories contain which types of code (e.g., "frontend code lives in `client/`, backend in `server/`")36 - **Naming conventions**: File naming, variable naming, branch naming as detected37 - **Testing requirements**: Test framework, test location, coverage expectations38 - **Dependency rules**: How modules depend on each other, what imports are allowed39 - **Quality gates**: Linting, formatting, CI checks that must pass4041 The constitution **MUST NOT**:42 - Override existing project standards without user confirmation43 - Invent conventions that don't exist in the codebase44 - Include generic boilerplate unrelated to the actual project45463. **Customize spec template**: Modify `.specify/templates/spec-template.md` to reflect the project:47 - Add project-specific sections (e.g., "Database Migrations" for projects with ORMs)48 - Include architecture-aware requirements (e.g., "Frontend Requirements" and "API Requirements" for full-stack projects)49 - Reference actual module paths instead of generic placeholders50514. **Customize plan template**: Modify `.specify/templates/plan-template.md` to reflect the project:52 - Include module-aware implementation sections (e.g., separate phases for frontend/backend)53 - Reference actual test frameworks and build tools54 - Include project-specific complexity factors55565. **Customize tasks template**: Modify `.specify/templates/tasks-template.md` to reflect the project:57 - Task phases should map to the project's actual module structure58 - Include project-specific setup tasks (e.g., database migration, dependency install)59 - Reference actual test commands (e.g., `npm test`, `pytest`, `go test ./...`)60616. **Generate AGENTS.md** (if multi-module): For monorepos and multi-module projects:62 - Define agent boundaries per module63 - Specify which agent owns which directories64 - Set up inter-agent communication rules65667. **Present changes**: Show the user what will be created or modified:6768 ```markdown69 # Bootstrap Plan7071 | File | Action | Description |72 |------|--------|-------------|73 | `.specify/memory/constitution.md` | Create | Project-specific constitution with detected conventions |74 | `.specify/templates/spec-template.md` | Modify | Add project-specific sections (Database Migrations, API Contract) |75 | `.specify/templates/plan-template.md` | Modify | Add module-aware phases (frontend, backend, shared) |76 | `.specify/templates/tasks-template.md` | Modify | Add actual test commands and build steps |77 | `AGENTS.md` | Create | Agent boundaries for frontend and backend modules |7879 Proceed with bootstrap? (confirm before writing)80 ```81828. **Execute bootstrap**: After user confirmation, write all files.83849. **Report**:8586 ```markdown87 # Bootstrap Complete8889 | Artifact | Status |90 |----------|--------|91 | Constitution | ✅ Created — 12 rules from detected conventions |92 | Spec template | ✅ Customized — added Database Migrations, API Contract sections |93 | Plan template | ✅ Customized — frontend/backend phase split |94 | Tasks template | ✅ Customized — actual test commands included |95 | AGENTS.md | ✅ Created — 2 agents (frontend, backend) |9697 ## Next Steps98 - Review `.specify/memory/constitution.md` and adjust any rules99 - Run `/speckit.brownfield.validate` to verify configuration matches project100 - Run `/speckit.brownfield.migrate` to reverse-engineer specs for existing features101 - Start new features with `/speckit.specify` — templates are now project-aware102 ```103104## Rules105106- **Always confirm before writing** — show the bootstrap plan and wait for approval107- **Never overwrite without asking** — if constitution or templates already exist, show a diff and ask108- **Derive from reality** — every constitution rule must trace to something detected in the codebase109- **No invented conventions** — if the project has no consistent pattern for something, say so instead of guessing110- **Respect existing spec-kit setup** — if `.specify/` already has customizations, merge rather than replace111- **Module-aware** — for monorepos, generate configuration that respects module boundaries