The OpenSpec Workflow
OpenSpec enforces a disciplined 3-stage workflow to prevent requirements drift and ensure AI assistants remain aligned with human intent.
Stage 1: Creating Changes (Proposal)
Before writing code, you define what is changing.
- Identify Need: A new feature, refactor, or architectural shift.
- Scaffold: Create a unique directory under
openspec/changes/<change-id>/. - Define Specs: Write Deltas (Additions, Modifications, Removals) for the relevant capabilities.
- Plan: Create a
tasks.mdfile breaking the work into verifiable steps. - Validate: Use
openspec validateto ensure the proposal is structurally sound.
Why? This stage forces alignment on the "What" and "Why" before spending resources on the "How".
Stage 2: Implementation
This is the coding phase. The AI assistant uses the artifacts from Stage 1 as its instructions.
- Context Loading: The AI reads
proposal.mdandspecs/to understand requirements. - Execution: The AI works through
tasks.mdsequentially. - Tracking: Tasks are marked as complete (
[x]) in real-time.
Why? By following a pre-approved checklist, the AI avoids hallucinating features or skipping edge cases defined in the specs.
Stage 3: Archiving (Integration)
Once the code is deployed and verified, the change proposal is no longer a "proposal"—it is reality.
- Archive Command: Running
openspec archive <change-id>moves the change folder toopenspec/changes/archive/. - Spec Merging: The CLI automatically applies the Spec Deltas (ADDED/MODIFIED requirements) to the main
openspec/specs/directory.
Why? This keeps your documentation (specs/) permanently in sync with your codebase. The specs/ folder always represents the currently deployed capabilities.