openspec persistence mode.
Directory Structure
Artifact File Paths
Reading Artifacts
Each skill reads its dependencies from the filesystem:Writing Rules
- ALWAYS create the change directory (
openspec/changes/{change-name}/) before writing artifacts - If a file already exists, READ it first and UPDATE it (don’t overwrite blindly)
- If the change directory already exists with artifacts, the change is being CONTINUED
- Use the
openspec/config.yamlrulessection to apply project-specific constraints per phase
Config File Reference
Config Fields
string
required
Must be
spec-drivenstring
required
Project context detected by
sdd-init. Includes tech stack, architecture, testing framework, and style conventions.array
Rules for the proposal phase (applied by
sdd-propose)array
Rules for the specs phase (applied by
sdd-spec)array
Rules for the design phase (applied by
sdd-design)array
Rules for the task planning phase (applied by
sdd-tasks)boolean
Enable TDD workflow in
sdd-apply. When true, every task follows RED → GREEN → REFACTOR cycle.string
Override test command for running tests during implementation (e.g.,
npm test, pytest, go test)string
Override test command for verification phase. If not set, uses
rules.apply.test_command or auto-detects.string
Override build command for verification phase (e.g.,
npm run build, go build, python -m build)number
Minimum coverage percentage required. If set to 0 (default), coverage check is skipped. Set to e.g. 80 to enforce 80% coverage.
array
Rules for the archive phase (applied by
sdd-archive)Archive Structure
When archiving, the change folder moves to:Example Archive
Main Specs (Source of Truth)
Theopenspec/specs/ directory contains the current state of all specifications. These are updated by sdd-archive when a change is completed.
Delta Specs vs Main Specs
- Delta specs (
openspec/changes/{change-name}/specs/) describe what’s changing - Main specs (
openspec/specs/) describe current behavior
sdd-archive.
Example: Change Lifecycle
1. Initialize
2. Create Change
3. Explore
4. Propose
5. Spec
6. Design
7. Tasks
8. Apply
9. Verify
10. Archive
Git Integration
Theopenspec/ directory is designed to be committed to git:
Related
- Persistence Contract — Mode resolution rules
- Engram Convention — Memory-based alternative
- Init Sub-Agent — Bootstraps the directory structure