Implement tasks from a Spectra 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:
- Infer from conversation context if the user mentioned a change
- Auto-select if only one active change exists
- If ambiguous, run
spectra list --json AND spectra list --parked --json to get all available changes (including parked ones). Parked changes should be annotated with "(parked)" in the selection list. Use the AskUserQuestion tool to let the user select
Always announce: "Using change: " and how to override (e.g., /spectra-apply <other>).
Check status to understand the schema
spectra status --change "<name>" --json
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 parked(暫存).
Use the AskUserQuestion tool to ask whether to continue.
Two options:
- Continue: Unpark the change and proceed with apply
- Cancel: Stop the workflow
If the user chooses to continue:
spectra unpark "<name>"
Then mark it as in-progress:
spectra in-progress add "<name>"
This is a silent operation — do not show the output to the user.
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 this change is currently parked(暫存)and ask via plain text whether to unpark and continue, or cancel.
Wait for the user's response. If the user confirms, run spectra unpark "<name>", then set spectra in-progress add "<name>", and continue normally.
If the change is NOT in the parked list: mark it as in-progress and proceed normally.
spectra in-progress add "<name>"
This is a silent operation — do not show the output to the user.
Parse the JSON to understand:
schemaName: The workflow being used (e.g., "spec-driven")
- Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)
Get apply instructions
spectra instructions apply --change "<name>" --json
This returns:
- Context file paths (varies by schema)
- Progress (total, complete, remaining)
- Task list with status
- Dynamic instruction based on current state
Handle states:
- If
state: "blocked" (missing artifacts): show message, suggest using /spectra-propose to create the change artifacts first
- If
state: "all_done": congratulate, suggest archive
- Otherwise: proceed to implementation
Read context files
Read the files listed in contextFiles from the apply instructions output.
The files depend on the schema being used:
- spec-driven: proposal, specs, design, tasks
- Other schemas: follow the contextFiles from CLI output
Check project preferences
Read openspec/config.yaml in the project root.
If tdd: true is set, apply TDD discipline throughout implementation:
- For each task, write a failing test FIRST, then implement to make it pass
- Fetch TDD instructions by running
spectra instructions --skill tdd, then follow the Red-Green-Refactor cycle
- For bug fixes, reproduce the bug with a failing test before fixing
If audit: true is set, apply sharp-edges discipline throughout implementation:
- When designing APIs or interfaces, evaluate through 3 adversary lenses (Scoundrel, Lazy Developer, Confused Developer)
- When adding configuration options, verify defaults are secure and zero/empty values are safe
- When accepting parameters, check for type confusion and silent failures
- Fetch audit instructions by running
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:
- Schema being used
- Progress: "N/M tasks complete"
- Remaining tasks overview
- Dynamic instruction from CLI
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:
- Show which task is being worked on
- Re-read the sections of design and spec files that are relevant to this task's scope — do not rely on memory from earlier in the conversation, as context may have been compressed
- Before writing code, check:
- Reuse — search adjacent modules and shared utilities for existing implementations before writing new code
- Quality — derive values from existing state instead of duplicating; use existing types and constants over new literals
- Efficiency — parallelize independent async operations; avoid unnecessary awaits; match operation scope to actual need
- Make the code changes required
- Keep changes minimal and focused
- Mark task complete in the tasks file:
- [ ] → - [x]
- Continue to next task
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:
- Task is unclear → ask for clarification
- Implementation reveals a design issue → suggest updating artifacts
- Error or blocker encountered → report and wait for guidance
- User interrupts
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:
- Tasks completed this session
- Overall progress: "N/M tasks complete"
- If all done: suggest archive
- If paused: explain why and wait for guidance
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
- Keep going through tasks until done or blocked
- Always read context files before starting (from the apply instructions output)
- If task is ambiguous, pause and ask before implementing
- If implementation reveals issues, pause and suggest artifact updates
- Keep code changes minimal and scoped to each task
- Update task checkbox immediately after completing each task
- Pause on errors, blockers, or unclear requirements - don't guess
- Use contextFiles from CLI output, don't assume specific file names
- No external task tracking — do not use any built-in task management, todo list, or progress tracking tool; the tasks file is the only system
- If AskUserQuestion tool is not available, ask the same questions as plain text and wait for the user's response
Fluid Workflow Integration
This skill supports the "actions on a change" model:
- Can be invoked anytime: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- Allows artifact updates: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
1---2name: spectra-apply-33description: "Implement or resume tasks from a Spectra change"4license: MIT5compatibility: Requires spectra CLI.6metadata:7 source: https://skillmd.com/skills/dansnow/spectra-apply-38 author: spectra9 version: "1.0"10 generatedBy: "Spectra"11---1213Implement tasks from a Spectra change.1415**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.1617**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.1819**Prerequisites**: This skill requires the `spectra` CLI. If any `spectra` command fails with "command not found" or similar, report the error and STOP.2021**Steps**22231. **Select the change**2425 If a name is provided, use it. Otherwise:26 - Infer from conversation context if the user mentioned a change27 - Auto-select if only one active change exists28 - If ambiguous, run `spectra list --json` AND `spectra list --parked --json` to get all available changes (including parked ones). Parked changes should be annotated with "(parked)" in the selection list. Use the **AskUserQuestion tool** to let the user select2930 Always announce: "Using change: <name>" and how to override (e.g., `/spectra-apply <other>`).31322. **Check status to understand the schema**3334 ```bash35 spectra status --change "<name>" --json36 ```3738 **If the command fails**: show the error and STOP.3940 **If the command succeeds**, check whether the change is parked (status can succeed even for parked changes):4142 ```bash43 spectra list --parked --json44 ```4546 Look for the change name in the `parked` array of the JSON output.47 - **If the change IS in the parked list** (it's parked):48 Inform the user that this change is currently parked(暫存).49 Use the **AskUserQuestion tool** to ask whether to continue.50 Two options:51 - **Continue**: Unpark the change and proceed with apply52 - **Cancel**: Stop the workflow5354 If the user chooses to continue:5556 ```bash57 spectra unpark "<name>"58 ```5960 Then mark it as in-progress:6162 ```bash63 spectra in-progress add "<name>"64 ```6566 This is a silent operation — do not show the output to the user.6768 Then re-run `spectra status --change "<name>" --json` and continue normally.6970 If there is no AskUserQuestion tool available (non-Claude-Code environment):71 Inform the user that this change is currently parked(暫存)and ask via plain text whether to unpark and continue, or cancel.72 Wait for the user's response. If the user confirms, run `spectra unpark "<name>"`, then set `spectra in-progress add "<name>"`, and continue normally.7374 - **If the change is NOT in the parked list**: mark it as in-progress and proceed normally.7576 ```bash77 spectra in-progress add "<name>"78 ```7980 This is a silent operation — do not show the output to the user.8182 Parse the JSON to understand:83 - `schemaName`: The workflow being used (e.g., "spec-driven")84 - Which artifact contains the tasks (typically "tasks" for spec-driven, check status for others)85863. **Get apply instructions**8788 ```bash89 spectra instructions apply --change "<name>" --json90 ```9192 This returns:93 - Context file paths (varies by schema)94 - Progress (total, complete, remaining)95 - Task list with status96 - Dynamic instruction based on current state9798 **Handle states:**99 - If `state: "blocked"` (missing artifacts): show message, suggest using `/spectra-propose` to create the change artifacts first100 - If `state: "all_done"`: congratulate, suggest archive101 - Otherwise: proceed to implementation1021034. **Read context files**104105 Read the files listed in `contextFiles` from the apply instructions output.106 The files depend on the schema being used:107 - **spec-driven**: proposal, specs, design, tasks108 - Other schemas: follow the contextFiles from CLI output1091105. **Check project preferences**111112 Read `openspec/config.yaml` in the project root.113 If `tdd: true` is set, apply TDD discipline throughout implementation:114 - For each task, write a failing test FIRST, then implement to make it pass115 - Fetch TDD instructions by running `spectra instructions --skill tdd`, then follow the Red-Green-Refactor cycle116 - For bug fixes, reproduce the bug with a failing test before fixing117118 If `audit: true` is set, apply sharp-edges discipline throughout implementation:119 - When designing APIs or interfaces, evaluate through 3 adversary lenses (Scoundrel, Lazy Developer, Confused Developer)120 - When adding configuration options, verify defaults are secure and zero/empty values are safe121 - When accepting parameters, check for type confusion and silent failures122 - Fetch audit instructions by running `spectra instructions --skill audit`, follow the discipline checklist (not the standalone 3-agent workflow)123124 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.1251266. **Show current progress**127128 Display:129 - Schema being used130 - Progress: "N/M tasks complete"131 - Remaining tasks overview132 - Dynamic instruction from CLI1331347. **Implement tasks (loop until done or blocked)**135136 **Reminder: Track progress by editing checkboxes in the tasks file only. Do not use any built-in task tracker.**137138 For each pending task:139 - Show which task is being worked on140 - Re-read the sections of design and spec files that are relevant to this task's scope — do not rely on memory from earlier in the conversation, as context may have been compressed141 - Before writing code, check:142 1. **Reuse** — search adjacent modules and shared utilities for existing implementations before writing new code143 2. **Quality** — derive values from existing state instead of duplicating; use existing types and constants over new literals144 3. **Efficiency** — parallelize independent async operations; avoid unnecessary awaits; match operation scope to actual need145 - Make the code changes required146 - Keep changes minimal and focused147 - Mark task complete in the tasks file: `- [ ]` → `- [x]`148 - Continue to next task149150 **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.151152 **Pause if:**153 - Task is unclear → ask for clarification154 - Implementation reveals a design issue → suggest updating artifacts155 - Error or blocker encountered → report and wait for guidance156 - User interrupts1571588. **Final check**159160 After completing all tasks, re-run:161162 ```bash163 spectra instructions apply --change "<name>" --json164 ```165166 Confirm `state: "all_done"`. If not, review remaining tasks and complete them.1671689. **On completion or pause, show status**169170 Display:171 - Tasks completed this session172 - Overall progress: "N/M tasks complete"173 - If all done: suggest archive174 - If paused: explain why and wait for guidance175176**Output During Implementation**177178```179## Implementing: <change-name> (schema: <schema-name>)180181Working on task 3/7: <task description>182[...implementation happening...]183✓ Task complete184185Working on task 4/7: <task description>186[...implementation happening...]187✓ Task complete188```189190**Output On Completion**191192```193## Implementation Complete194195**Change:** <change-name>196**Schema:** <schema-name>197**Progress:** 7/7 tasks complete ✓198199### Completed This Session200- [x] Task 1201- [x] Task 2202...203204All tasks complete! You can archive this change with `/spectra-archive`.205```206207**Output On Pause (Issue Encountered)**208209```210## Implementation Paused211212**Change:** <change-name>213**Schema:** <schema-name>214**Progress:** 4/7 tasks complete215216### Issue Encountered217<description of the issue>218219**Options:**2201. <option 1>2212. <option 2>2223. Other approach223224What would you like to do?225```226227**Guardrails**228229- Keep going through tasks until done or blocked230- Always read context files before starting (from the apply instructions output)231- If task is ambiguous, pause and ask before implementing232- If implementation reveals issues, pause and suggest artifact updates233- Keep code changes minimal and scoped to each task234- Update task checkbox immediately after completing each task235- Pause on errors, blockers, or unclear requirements - don't guess236- Use contextFiles from CLI output, don't assume specific file names237- **No external task tracking** — do not use any built-in task management, todo list, or progress tracking tool; the tasks file is the only system238- If **AskUserQuestion tool** is not available, ask the same questions as plain text and wait for the user's response239240**Fluid Workflow Integration**241242This skill supports the "actions on a change" model:243244- **Can be invoked anytime**: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions245- **Allows artifact updates**: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly