docs/commands.md
This is the reference for OpenSpec's slash commands. These commands are invoked in your AI coding assistant's chat interface (e.g., Claude Code, Cursor, Windsurf).
For workflow patterns and when to use each command, see Workflows. For CLI commands, see CLI.
core profile)| Command | Purpose |
|---|---|
/opsx:propose | Create a change and generate planning artifacts in one step |
/opsx:explore | Think through ideas before committing to a change |
/opsx:apply | Implement tasks from the change |
/opsx:archive | Archive a completed change |
| Command | Purpose |
|---|---|
/opsx:new | Start a new change scaffold |
/opsx:continue | Create the next artifact based on dependencies |
/opsx:ff | Fast-forward: create all planning artifacts at once |
/opsx:verify | Validate implementation matches artifacts |
/opsx:sync | Merge delta specs into main specs |
/opsx:bulk-archive | Archive multiple changes at once |
/opsx:onboard | Guided tutorial through the complete workflow |
The default global profile is core. To enable expanded workflow commands, run openspec config profile, select workflows, then run openspec update in your project.
/opsx:proposeCreate a new change and generate planning artifacts in one step. This is the default start command in the core profile.
Syntax:
/opsx:propose [change-name-or-description]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name-or-description | No | Kebab-case name or plain-language change description |
What it does:
openspec/changes/<change-name>/spec-driven: proposal, specs, design, tasks)/opsx:applyExample:
You: /opsx:propose add-dark-mode
AI: Created openspec/changes/add-dark-mode/
✓ proposal.md
✓ specs/ui/spec.md
✓ design.md
✓ tasks.md
Ready for implementation. Run /opsx:apply.
Tips:
/opsx:new + /opsx:continue/opsx:exploreThink through ideas, investigate problems, and clarify requirements before committing to a change.
Syntax:
/opsx:explore [topic]
Arguments:
| Argument | Required | Description |
|---|---|---|
topic | No | What you want to explore or investigate |
What it does:
/opsx:propose (default) or /opsx:new (expanded workflow) when insights crystallizeExample:
You: /opsx:explore
AI: What would you like to explore?
You: How should we handle authentication for the mobile app?
AI: Let me investigate your current auth setup...
[Analyzes codebase]
I see you're using session-based auth for the web app.
For mobile, we have three main options:
1. JWT tokens (stateless, works offline)
2. OAuth2 (if you need third-party login)
3. Extend current sessions (simpler, but requires connectivity)
Your API already has CORS configured. Which direction interests you?
You: Let's go with JWT. Can we start a change for that?
AI: Ready when you are. Run /opsx:propose add-jwt-auth to begin.
Tips:
/opsx:newStart a new change scaffold. Creates the change folder and waits for you to generate artifacts with /opsx:continue or /opsx:ff.
This command is part of the expanded workflow set (not included in the default core profile).
Syntax:
/opsx:new [change-name] [--schema <schema-name>]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Name for the change folder (prompted if not provided) |
--schema | No | Workflow schema to use (default: from config or spec-driven) |
What it does:
openspec/changes/<change-name>/ directory.openspec.yaml metadata file in the change folderWhat it creates:
openspec/changes/<change-name>/
└── .openspec.yaml # Change metadata (schema, created date)
Example:
You: /opsx:new add-dark-mode
AI: Created openspec/changes/add-dark-mode/
Schema: spec-driven
Ready to create: proposal
Use /opsx:continue to create it, or /opsx:ff to create all artifacts.
Tips:
add-feature, fix-bug, refactor-moduleupdate, changes, wipopenspec/config.yaml)/opsx:continueCreate the next artifact in the dependency chain. Creates one artifact at a time for incremental progress.
Syntax:
/opsx:continue [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to continue (inferred from context if not provided) |
What it does:
Example:
You: /opsx:continue
AI: Change: add-dark-mode
Artifact status:
✓ proposal (done)
◆ specs (ready)
◆ design (ready)
○ tasks (blocked - needs: specs)
Creating specs...
[Reads proposal.md, creates specs based on requirements]
✓ Created openspec/changes/add-dark-mode/specs/ui/spec.md
Now available: tasks
Run /opsx:continue to create the next artifact.
Tips:
/opsx:ffFast-forward through artifact creation. Creates all planning artifacts at once.
Syntax:
/opsx:ff [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to fast-forward (inferred from context if not provided) |
What it does:
apply-required artifacts are completeExample:
You: /opsx:ff add-dark-mode
AI: Fast-forwarding add-dark-mode...
✓ Creating proposal.md
✓ Creating specs/ui/spec.md
✓ Creating design.md
✓ Creating tasks.md
All planning artifacts complete!
Ready for implementation. Run /opsx:apply to begin.
Tips:
/opsx:continue for straightforward changes/opsx:applyImplement tasks from the change. Works through the task list, writing code and checking off items.
Syntax:
/opsx:apply [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to implement (inferred from context if not provided) |
What it does:
tasks.md and identifies incomplete tasks[x]Example:
You: /opsx:apply
AI: Implementing add-dark-mode...
Reading tasks.md:
- [ ] 1.1 Create ThemeContext
- [ ] 1.2 Add CSS custom properties
- [ ] 1.3 Implement localStorage persistence
Working on 1.1: Create ThemeContext...
[Creates src/context/ThemeContext.tsx]
✓ 1.1 Complete
Working on 1.2: Add CSS custom properties...
[Updates src/styles/globals.css]
✓ 1.2 Complete
...
Tips:
tasks.md checkboxes/opsx:verifyValidate that implementation matches your change artifacts. Checks completeness, correctness, and coherence.
Syntax:
/opsx:verify [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to verify (inferred from context if not provided) |
What it does:
Verification dimensions:
| Dimension | What it validates |
|---|---|
| Completeness | All tasks done, all requirements implemented, scenarios covered |
| Correctness | Implementation matches spec intent, edge cases handled |
| Coherence | Design decisions reflected in code, patterns consistent |
Example:
You: /opsx:verify
AI: Verifying add-dark-mode...
COMPLETENESS
✓ All 8 tasks in tasks.md are checked
✓ All requirements in specs have corresponding code
⚠ Scenario "System preference detection" has no test coverage
CORRECTNESS
✓ Implementation matches spec intent
✓ Edge cases from scenarios are handled
✓ Error states match spec definitions
COHERENCE
✓ Design decisions reflected in code structure
✓ Naming conventions consistent with design.md
⚠ Design mentions "CSS variables" but implementation uses Tailwind classes
SUMMARY
─────────────────────────────
Critical issues: 0
Warnings: 2
Ready to archive: Yes (with warnings)
Recommendations:
1. Add test for system preference detection
2. Update design.md to reflect Tailwind usage, or refactor to use CSS variables
Tips:
/opsx:syncOptional command. Merge delta specs from a change into main specs. Archive will prompt to sync if needed, so you typically don't need to run this manually.
Syntax:
/opsx:sync [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to sync (inferred from context if not provided) |
What it does:
openspec/specs/ directoryExample:
You: /opsx:sync
AI: Syncing add-dark-mode delta specs...
Reading: openspec/changes/add-dark-mode/specs/ui/spec.md
Target: openspec/specs/ui/spec.md
Changes to apply:
✓ ADDED: Theme Selection requirement (2 scenarios)
✓ ADDED: Accessibility requirement (1 scenario)
Merging...
✓ openspec/specs/ui/spec.md updated
Change remains active. Run /opsx:archive when ready to complete.
When to use manually:
| Scenario | Use sync? |
|---|---|
| Long-running change, want specs in main before archiving | Yes |
| Multiple parallel changes need the updated base specs | Yes |
| Want to preview/review the merge separately | Yes |
| Quick change, going straight to archive | No (archive handles it) |
Tips:
/opsx:archiveArchive a completed change. Finalizes the change and moves it to the archive folder.
Syntax:
/opsx:archive [change-name]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-name | No | Which change to archive (inferred from context if not provided) |
What it does:
openspec/changes/archive/YYYY-MM-DD-<name>/Example:
You: /opsx:archive
AI: Archiving add-dark-mode...
Artifact status:
✓ proposal.md exists
✓ specs/ exists
✓ design.md exists
✓ tasks.md exists (8/8 tasks complete)
Delta specs: Not yet synced
→ Sync now? (recommended)
You: Yes
AI: ✓ Synced specs to openspec/specs/ui/spec.md
✓ Moved to openspec/changes/archive/2025-01-24-add-dark-mode/
Change archived successfully.
Tips:
/opsx:verify first to catch issues/opsx:bulk-archiveArchive multiple completed changes at once. Handles spec conflicts between changes.
Syntax:
/opsx:bulk-archive [change-names...]
Arguments:
| Argument | Required | Description |
|---|---|---|
change-names | No | Specific changes to archive (prompts to select if not provided) |
What it does:
Example:
You: /opsx:bulk-archive
AI: Found 3 completed changes:
- add-dark-mode (8/8 tasks complete)
- fix-login-bug (3/3 tasks complete)
- update-footer (2/2 tasks complete)
Checking for spec conflicts...
⚠ add-dark-mode and update-footer both touch specs/ui/
Inspecting codebase to resolve...
Both changes are implemented. Will merge in chronological order:
1. add-dark-mode (created Jan 20)
2. update-footer (created Jan 22)
Archive all 3 changes?
You: Yes
AI: ✓ Archived add-dark-mode
✓ Archived fix-login-bug
✓ Archived update-footer
Specs merged: add-dark-mode → update-footer
Tips:
/opsx:onboardGuided onboarding through the complete OpenSpec workflow. An interactive tutorial using your actual codebase.
Syntax:
/opsx:onboard
What it does:
Phases:
/opsx:new)/opsx:apply)Example:
You: /opsx:onboard
AI: Welcome to OpenSpec!
I'll walk you through the complete workflow using your actual codebase.
We'll find something small to improve, create a proper change for it,
implement it, and archive it.
Let me scan your codebase for opportunities...
[Analyzes codebase]
I found a few things we could work on:
1. Add input validation to the contact form
2. Improve error messages in the auth flow
3. Add loading states to async buttons
Which interests you? (or suggest something else)
Tips:
Different AI tools use slightly different command syntax. Use the format that matches your tool:
| Tool | Syntax Example |
|---|---|
| Claude Code | /opsx:propose, /opsx:apply |
| Cursor | /opsx-propose, /opsx-apply |
| Windsurf | /opsx-propose, /opsx-apply |
| Copilot (IDE) | /opsx-propose, /opsx-apply |
| Trae | Skill-based invocations such as /openspec-propose, /openspec-apply-change (no generated opsx-* command files) |
The intent is the same across tools, but how commands are surfaced can differ by integration.
Note: GitHub Copilot commands (
.github/prompts/*.prompt.md) are only available in IDE extensions (VS Code, JetBrains, Visual Studio). GitHub Copilot CLI does not currently support custom prompt files — see Supported Tools for details and workarounds.
These commands use the older "all-at-once" workflow. They still work but OPSX commands are recommended.
| Command | What it does |
|---|---|
/openspec:proposal | Create all artifacts at once (proposal, specs, design, tasks) |
/openspec:apply | Implement the change |
/openspec:archive | Archive the change |
When to use legacy commands:
Migrating to OPSX: Legacy changes can be continued with OPSX commands. The artifact structure is compatible.
The command couldn't identify which change to work on.
Solutions:
/opsx:apply add-dark-modeopenspec listAll artifacts are either complete or blocked by missing dependencies.
Solutions:
openspec status --change <name> to see what's blockingThe specified schema doesn't exist.
Solutions:
openspec schemasopenspec schema init <name>The AI tool doesn't recognize OpenSpec commands.
Solutions:
openspec initopenspec update.claude/skills/ directory exists (for Claude Code)The AI creates incomplete or incorrect artifacts.
Solutions:
openspec/config.yaml/opsx:continue instead of /opsx:ff for more control