with one click
spectra-apply
Implement or resume tasks from an OpenSpec change
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Menu
Implement or resume tasks from an OpenSpec change
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Based on SOC occupation classification
Archive a completed change
Query openspec documents and answer questions based on spec content
Audit changed code for security sharp edges — dangerous defaults, type confusion, and silent failures
Systematically debug a problem using a four-phase workflow
Have a focused discussion about a topic and reach a conclusion
Update an existing OpenSpec change from external context
| name | spectra-apply |
| description | Implement or resume tasks from an OpenSpec change |
| license | MIT |
| compatibility | Requires openspec CLI. |
| metadata | {"author":"spectra","version":"1.0","generatedBy":"Spectra"} |
Implement tasks from an OpenSpec change.
Input: Optionally specify a change name (e.g., /spectra:apply add-auth). If omitted, check if it can be inferred from conversation context. If vague or ambiguous you MUST prompt for available changes.
Task tracking is file-based only. The tasks file's markdown checkboxes (- [ ] / - [x]) are the single source of truth for progress. Do NOT use any external task management system, built-in task tracker, or todo tool. When a task is done, edit the checkbox in the tasks file — that is the only way to record progress.
Prerequisites: This skill requires the spectra CLI. If any spectra command fails with "command not found" or similar, report the error and STOP.
Steps
Select the change
If a name is provided, use it. Otherwise:
spectra list --json to get available changes and use the AskUserQuestion tool to let the user selectAlways announce: "Using change: " and how to override (e.g., /spectra:apply <other>).
After selecting the change, mark it as in-progress:
spectra in-progress add "<name>"
This is a silent operation — do not show the output to the user.
Check status to understand the schema
spectra status --change "<name>" --json 2>/dev/null
If the command fails: show the error and STOP.
If the command succeeds, check whether the change is parked (status can succeed even for parked changes):
spectra list --parked --json
Look for the change name in the parked array of the JSON output.
If the change IS in the parked list (it's parked): Inform the user that this change is currently shelved ("暫存" in the app). Use the AskUserQuestion tool to ask whether to continue. Use the app's own terminology — in Chinese locales, park = 暫存. Two options:
If the user chooses to continue:
spectra unpark "<name>"
Then re-run spectra status --change "<name>" --json and continue normally.
If there is no AskUserQuestion tool available (non-Claude-Code environment): Inform the user that the change is shelved and they need to un-shelve it in Spectra first. STOP.
If the change is NOT in the parked list: proceed normally.
Parse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")Get apply instructions
spectra instructions apply --change "<name>" --json
This returns:
Handle states:
state: "blocked" (missing artifacts): show message, suggest using /spectra:propose to create the change artifacts firststate: "all_done": congratulate, suggest archiveRead context files
Read the files listed in contextFiles from the apply instructions output.
The files depend on the schema being used:
Check project preferences
Read openspec/config.yaml in the project root.
If tdd: true is set, apply TDD discipline throughout implementation:
spectra instructions --skill tdd, then follow the Red-Green-Refactor cycleIf audit: true is set, apply sharp-edges discipline throughout implementation:
spectra instructions --skill audit, follow the discipline checklist (not the standalone 3-agent workflow)If parallel_tasks: true is set, check whether consecutive pending tasks have [P] markers (format: - [ ] [P] Task description). You SHALL dispatch consecutive [P] tasks as parallel agents. Only fall back to sequential when tasks have a data dependency (one task's output is another's input) or when tasks modify overlapping regions of the same file. Targeting the same file alone is NOT a reason to skip parallel dispatch — if the modified regions are disjoint, dispatch in parallel. If the environment does not support parallel execution, ignore [P] markers and execute tasks sequentially.
Show current progress
Display:
Implement tasks (loop until done or blocked)
Reminder: Track progress by editing checkboxes in the tasks file only. Do not use any built-in task tracker.
For each pending task:
- [ ] → - [x]Parallel task dispatch: When consecutive [P]-marked tasks are found and parallel_tasks: true is configured (see Step 5), dispatch them as parallel agents in a single message. If any [P] task fails, pause and report.
Pause if:
Final check
After completing all tasks, re-run:
spectra instructions apply --change "<name>" --json
Confirm state: "all_done". If not, review remaining tasks and complete them.
On completion or pause, show status
Display:
Output During Implementation
## Implementing: <change-name> (schema: <schema-name>)
Working on task 3/7: <task description>
[...implementation happening...]
✓ Task complete
Working on task 4/7: <task description>
[...implementation happening...]
✓ Task complete
Output On Completion
## Implementation Complete
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 7/7 tasks complete ✓
### Completed This Session
- [x] Task 1
- [x] Task 2
...
All tasks complete! You can archive this change with `/spectra:archive`.
Output On Pause (Issue Encountered)
## Implementation Paused
**Change:** <change-name>
**Schema:** <schema-name>
**Progress:** 4/7 tasks complete
### Issue Encountered
<description of the issue>
**Options:**
1. <option 1>
2. <option 2>
3. Other approach
What would you like to do?
Guardrails
Fluid Workflow Integration
This skill supports the "actions on a change" model: