OpenSpec Workflow
archmax uses OpenSpec for spec-driven development. Every feature PR must include a corresponding spec change. This is a hard requirement, not optional. A proposal with spec deltas gets reviewed first, and implementation only begins after approval.
Install OpenSpec
Section titled “Install OpenSpec”Install the CLI globally so it’s available in your terminal:
npm install -g openspec-cliVerify the installation:
openspec --versionPR Requirements
Section titled “PR Requirements”Every pull request that introduces or modifies user-facing behavior must include:
- An OpenSpec change proposal (under
openspec/changes/<change-id>/) - Spec deltas that describe the new or modified requirements
- A validated proposal (
openspec validate <change-id> --strictpasses)
PRs without spec changes will be rejected during review. Bug fixes, typo corrections, and non-breaking dependency updates are the only exceptions.
When to Create a Proposal
Section titled “When to Create a Proposal”Requires a proposal:
- New features or capabilities
- Breaking changes (API, schema, behavior)
- Architecture changes
- Performance optimizations that change behavior
Skip proposals for:
- Bug fixes that restore intended behavior
- Typos, formatting, comments
- Non-breaking dependency updates
- Configuration-only changes
Directory Structure
Section titled “Directory Structure”openspec/├── project.md # Project conventions and context├── specs/ # Current truth: what IS built│ └── <capability>/│ └── spec.md # Requirements and scenarios├── changes/ # Active proposals│ └── <change-id>/│ ├── proposal.md # Why and what changes│ ├── tasks.md # Implementation checklist│ ├── design.md # Technical decisions (optional)│ └── specs/ # Delta changes to capabilities│ └── <capability>/│ └── spec.md└── AGENTS.md # AI assistant instructionsCreating a Proposal
Section titled “Creating a Proposal”Proposals should be generated using AI assistants with the OpenSpec skill, not hand-written. The project includes an openspec-proposal Cursor command that scaffolds all required files with correct formatting, validates the result, and avoids common mistakes like missing scenarios or malformed headers.
Using the Cursor command (recommended):
Describe your change and invoke the /openspec-proposal command. The assistant will:
- Review existing specs and active changes for conflicts
- Pick a unique change ID
- Scaffold
proposal.md,tasks.md,design.md(if needed), and spec deltas - Validate with
openspec validate <change-id> --strict
Manual creation (if not using Cursor):
-
Pick a change ID: kebab-case, verb-led (e.g.,
add-two-factor-auth,update-mcp-tools) -
Scaffold the files: create
proposal.md,tasks.md, and spec deltas underopenspec/changes/<change-id>/ -
Write spec deltas: use
## ADDED,## MODIFIED, or## REMOVED Requirementsheaders with#### Scenario:blocks:## ADDED Requirements### Requirement: Two-Factor AuthenticationUsers MUST provide a second factor during login.#### Scenario: OTP required- **WHEN** valid credentials are provided- **THEN** an OTP challenge is required -
Validate: run
openspec validate <change-id> --strictand fix any issues before opening a PR
Documentation Sync
Section titled “Documentation Sync”When your change affects user-facing behavior, include a documentation update task in tasks.md. Spec content from openspec/specs/ is synced to the docs automatically at build time, but guides and reference pages need manual updates.
Useful Commands
Section titled “Useful Commands”openspec list # List active changesopenspec list --specs # List all specificationsopenspec show <item> # View change or spec detailsopenspec validate --strict # Validate all changesAfter Deployment
Section titled “After Deployment”Once a change is deployed, it gets archived:
openspec archive <change-id> --yesThis moves the change to changes/archive/ and updates the specs to reflect the new state.