OpenSpec smart router — auto-detect project state and guide to the correct next step. Use when working with OpenSpec, starting spec-driven development, or needing to know next steps. Triggers on "openspec", "spec-driven", "using openspec", "opsx".
インストール
Codex または Claude でインストール この Prompt をコピーして Codex、Claude、または他のアシスタントに貼り付けると、Skill ページを確認してインストールできます。
OpenSpec smart router — auto-detect project state and guide to the correct next step. Use when working with OpenSpec, starting spec-driven development, or needing to know next steps. Triggers on "openspec", "spec-driven", "using openspec", "opsx".
version
1.0.0
scope
public
OpenSpec Router
Auto-detect project OpenSpec state and tell you what to do next.
Integrations
downstream:
- command: /opsx:new
produces: Create new change
- command: /opsx:continue
produces: Create next artifact
- command: /opsx:ff
produces: Create all artifacts at once
- command: /opsx:apply
produces: Implement tasks
- command: /opsx:verify
produces: Verify implementation quality
- command: /opsx:archive
produces: Archive completed change
Out of Scope
Directly executing OpenSpec operations (only routes, does not execute on behalf)
Installing or upgrading the OpenSpec CLI
Workflow
1. DETECT → Detect whether the project has initialized openspec
2. STATUS → Query active changes and artifact status
3. ANALYZE → Determine current stage
4. ROUTE → Suggest next action + executable command
Step 1: DETECT
Check whether the current project has initialized OpenSpec:
# Check if openspec directory existsls openspec/ 2>/dev/null
# Check if CLI is availablewhich openspec
Result
State
Next Step
No openspec directory
Not Initialized
openspec init . --tools claude
Directory exists but empty
Initialized, Empty
/opsx:new or /opsx:onboard
Has changes/specs
Active
Proceed to Step 2
Step 2: STATUS
Query all active changes:
openspec list --json
Result
State
No active changes
Ready for New Work
Has active changes
Proceed to Step 3 to analyze each
Step 3: ANALYZE
Check artifact status for each active change:
openspec status --change "<name>" --json
Determine stage:
Artifact State
Stage
Description
0/N complete
Just Created
Just scaffolded, no artifacts written yet
Partially complete, some ready
In Progress (Artifacts)
Currently building artifacts
All complete, tasks not started
Ready to Apply
All artifacts ready, can start implementation
Tasks partially complete
In Progress (Implementation)
Implementation in progress
Tasks all complete
Ready to Verify/Archive
Implementation done, can verify or archive
Step 4: ROUTE
Based on analysis results, output a concise status summary + suggested action:
## OpenSpec Status
**Project**: <project name>
**State**: <Initialized | N active changes>
### Active Changes
| Change | Progress | Stage | Suggested Action |
|--------|----------|-------|------------------|
| <name> | 3/4 artifacts | In Progress | `/opsx:continue <name>` |
### Suggested Next Step
> <Specific suggestion + directly executable command>
Routing Decision Table
Scenario
Suggested Command
Description
Not initialized
openspec init . --tools claude
Initialize first
No changes, first time use
/opsx:onboard
Walk through tutorial mode
No changes, want to start new feature
/opsx:new or /opsx:ff
new=step-by-step, ff=all at once
Has change, artifacts incomplete
/opsx:continue <name>
Create next artifact
Has change, all artifacts ready
/opsx:apply <name>
Start implementation
Has change, tasks partially complete
/opsx:apply <name>
Continue implementation
Has change, all tasks complete
/opsx:verify <name>
Verify then archive
Multiple changes all complete
/opsx:bulk-archive
Batch archive
Want to think before acting
/opsx:explore
Exploration mode
Combining with User Intent
When the user provides extra context, combine with intent routing: