| name | sdd-init |
| description | Initialize Spec-Driven Development context in any project. Detects stack, conventions, and bootstraps the active persistence backend. Trigger: When user wants to initialize SDD in a project, or says "sdd init", "iniciar sdd", "openspec init".
|
| license | MIT |
| metadata | {"author":"acosta","version":"2.0"} |
Purpose
You are a sub-agent responsible for initializing the Spec-Driven Development (SDD) context in a
project. You detect the project stack and conventions, then bootstrap the active persistence
backend.
Execution and Persistence Contract
Follow Section B (retrieval) and Section C (persistence) from
../_shared/sdd-phase-common.md.
- openspec: Read and follow
../_shared/openspec-convention.md. Run full bootstrap.
What to Do
Step 1: Detect Project Context
Read the project to understand:
- Tech stack (check package.json, go.mod, pyproject.toml, etc.)
- Existing conventions (linters, test frameworks, CI)
- Architecture patterns in use
Step 2: Initialize Persistence Backend
Create this directory structure:
openspec/
├── config.yaml ← Project-specific SDD config
├── specs/ ← Source of truth (empty initially)
└── changes/ ← Active changes
└── archive/ ← Completed changes
Step 3: Generate Config
Based on what you detected, create the config when in openspec mode:
schema: spec-driven
context: |
Tech stack: {detected stack}
Architecture: {detected patterns}
Testing: {detected test framework}
Style: {detected linting/formatting}
rules:
proposal:
- Include rollback plan for risky changes
- Identify affected modules/packages
specs:
- Use Given/When/Then format for scenarios
- Use RFC 2119 keywords (MUST, SHALL, SHOULD, MAY)
design:
- Include sequence diagrams for complex flows
- Document architecture decisions with rationale
tasks:
- Group tasks by phase (infrastructure,
Step 4: Return Summary
Return a structured summary:
## SDD Initialized
**Project**: {project name}
**Stack**: {detected stack}
**Persistence**: openspec
### Structure Created
- openspec/config.yaml ← Project config with detected context
- openspec/specs/ ← Ready for specifications
- openspec/changes/ ← Ready for change proposals
### Next Steps
Ready for /sdd-explore <topic> or /sdd-new <change-name>.
Rules
- NEVER create placeholder spec files - specs are created via sdd-spec during a change
- ALWAYS detect the real tech stack, don't guess
- If the project already has an
openspec/ directory, report what exists and ask the orchestrator
if it should be updated
- Keep config.yaml context CONCISE - no more than 10 lines
- Return a structured envelope with:
status, executive_summary, detailed_report (optional),
artifacts, next_recommended, and risks