OpenSpec Cheatsheet
OpenSpec is a spec-driven development (SDD) framework designed to align humans and AI coding assistants by creating reviewable specifications before any code is written. It acts as “version control for intent,” helping to prevent “vibe coding” and maintain consistency.
1. Setup & Installation
Get started by installing the CLI globally and initializing your project:
- Install:
npm install -g @fission-ai/openspec@latest - Initialize:
openspec init(Prompts you to select your AI tool, e.g., Claude Code, Cursor, Copilot) - Update:
openspec update(Regenerates tool configs after a CLI upgrade)
2. Core Workflow Commands (/opsx)
These slash commands are used within your AI assistant to manage the lifecycle of a feature or change.
| Command | Action | Description |
|---|---|---|
/opsx:propose | Plan | Creates a new change folder with a proposal.md, specs, and tasks.md. |
/opsx:apply | Build | Executes the tasks in the approved proposal and writes the actual code. |
/opsx:verify | Check | Validates that the implementation matches the requirements and specs. |
/opsx:archive | Merge | Records completion and merges delta specs into the project’s main specs. |
3. Essential CLI Commands
Run these in your terminal to manage the state of your project:
- List Changes:
openspec list(Shows all active and archived changes). - Validate:
openspec validate <change-id> --strict(Checks for structural or requirement issues). - Show Specs:
openspec list --specs(Displays current project specifications).
4. File Structure
The openspec/ directory organizes your project’s technical “source of truth”:
project.md: High-level details about the project, tech stack, and conventions.AGENTS.md: A managed hand-off file for various AI assistants.changes/: Contains subfolders for each feature, including itsproposal.md,design.md, andtasks.md.
5. Pro-Tips for Success
- Verb-Led IDs: Use
kebab-caseand verb-led IDs for changes (e.g.,add-dark-mode,update-auth-api). - Deltas Matter: Focus on “Delta Specs” to describe exactly what is changing, rather than rewriting the entire spec from scratch.
- Customization: Edit
openspec/config.yamlto inject custom project rules or specific tech stack context for the AI to follow.
“Don’t vibe code it — spec it first, then let AI build it right.”-Rushi