spectra-apply
Skill2 starsChanged 7 months agoMITView on GitHub
Implement or resume tasks from a Spectra change
6 other projects use a version of this, 5 of them edited.
Adopted by
Most recently taken up by
- Will-SW74/passdown-osedited, first seen Oct 11, 2026
- DanSnow/hoarder-pipettetheir own version, first seen Oct 8, 2026
- leoho0722/naver-blog-image-downloaderedited, first seen Aug 31, 2026
- PsychQuant/claude-hot-limitedited, first seen Jul 1, 2026
- harrychuang/cursor-skillsedited, first seen Jun 17, 2026
- PsychQuant/che-ical-mcpedited, first seen Mar 31, 2026
Used with
Projects with it also use spectra-analyze, spectra-drift and 1 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
harrychuangSkillspectra-analyze
Analyze artifact consistency for a change
Also in 5 projects that use this
harrychuangSkillspectra-drift
Detect drift between a Spectra change and the current codebase state
Also in 5 projects that use this
- +1 more from harrychuang
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 5
- PsychQuant/che-ical-mcp★ 4598% same
- harrychuang/cursor-skills★ 1982% same
- leoho0722/naver-blog-image-downloader★ 282% same
- PsychQuant/claude-hot-limit★ 082% same
- Will-SW74/passdown-os★ 082% same
Wrote their own version · 1
- DanSnow/hoarder-pipette★ 98same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository10 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- spectra-archiveSkill
- spectra-askSkill
- spectra-auditSkill
- spectra-commitSkill
- spectra-debugSkill
- spectra-discussSkill
- spectra-ingestSkill
- spectra-proposeSkill
The file
Show its rules and text
We split this skill into the rules it gives an agent
45 rules. 30 are common, 0 are distinctive, and 15 are very specific to this project.
30
Common
Most of the 6 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
15
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 24
If a name is provided, use it.
- Very specific: line 27
If ambiguous, run spectra list --json AND spectra list --parked --json to get all available changes (including parked ones).
- Very specific: line 29
Always announce: "Using change: <name>" and how to override (e.g., $spectra-apply <other>).
- Very specific: line 45
Look for the change name in the parked array of the JSON output.
- Common: line 48
Use the AskUserQuestion tool to ask whether to continue.
- Common: line 51
Cancel: Stop the workflow
- Common: line 53
If the user chooses to continue:
- Common: line 69
If there is no AskUserQuestion tool available (non-Claude-Code environment): Inform the user that this change is currently parked(暫存)and …
- Very specific: line 71
Wait for the user's response.
- Very specific: line 98
If state: "blocked" (missing artifacts): show message, suggest using $spectra-propose to create the change artifacts first
- Very specific: line 99
If state: "all_done": congratulate, suggest archive
- Very specific: line 104
If the apply instructions JSON includes a preflight field, act on its status:
- Common: line 114
Only show the lines that are relevant (skip drifted if none, skip staleness if not stale).
- Common: line 125
If the user chooses "Stop", end the workflow.
- Common: line 127
If there is no AskUserQuestion tool available: Display the same information as plain text and ask whether to continue or stop.
- Common: line 129
Wait for the user's response.
- Very specific: line 131
If the preflight field is absent (blocked or all_done states), skip this step.
- Very specific: line 135
Run spectra analyze <change-name> --json to check cross-artifact consistency (Coverage, Consistency, Ambiguity, Gaps).
- Common: line 144
If there is no AskUserQuestion tool available, present options as plain text and wait for the user's response.
- Very specific: line 148
Read the files listed in contextFiles from the apply instructions output.
- Very specific: line 155
Read .spectra.yaml in the project root.
- Very specific: line 156
If tdd: true is set, apply TDD discipline throughout implementation:
- Very specific: line 161
If audit: true is set, apply sharp-edges discipline throughout implementation:
- Common: line 162
When designing APIs or interfaces, evaluate through 3 adversary lenses (Scoundrel, Lazy Developer, Confused Developer)
- Common: line 163
When adding configuration options, verify defaults are secure and zero/empty values are safe
- Common: line 164
When accepting parameters, check for type confusion and silent failures
- Common: line 184
Before writing code, check:
- Very specific: line 190
When TDD is enabled: derive the first failing test directly from the example's GIVEN/WHEN/THEN values
- Common: line 191
When TDD is not enabled: after implementing, verify the code handles the example's input→output correctly
- Common: line 193
Do NOT invent additional test values beyond what the spec examples provide without reason.
- Common: line 195
Keep changes minimal and focused
- Very specific: line 201
Parallel task dispatch: When consecutive [P]-marked tasks are found and parallel_tasks: true is configured (see Step 5), dispatch them as …
- Common: line 228
After completing all tasks, re-run:
- Common: line 241
If all done: suggest archive
- Common: line 242
If paused: explain why and wait for guidance
- Common: line 297
Keep going through tasks until done or blocked
- Common: line 298
Always read context files before starting (from the apply instructions output)
- Common: line 299
If task is ambiguous, pause and ask before implementing
- Common: line 300
If implementation reveals issues, pause and suggest artifact updates
- Common: line 301
Keep code changes minimal and scoped to each task
- Common: line 302
Update task checkbox immediately after completing each task
- Common: line 304
Use contextFiles from CLI output, don't assume specific file names
- Common: line 306
If AskUserQuestion tool is not available, ask the same questions as plain text and wait for the user's response
- Common: line 312
Can be invoked anytime: Before all artifacts are done (if tasks exist), after partial implementation, interleaved with other actions
- Common: line 313
Allows artifact updates: If implementation reveals design issues, suggest updating artifacts - not phase-locked, work fluidly
“Common” is measured: kept by at least 6 in 10 of the 6 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 --jsonANDspectra list --parked --jsonto 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:
<name>" and how to override (e.g.,$spectra-apply <other>).Check status to understand the schema
spectra status --change "<name>" --jsonIf 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 --jsonLook for the change name in the
parkedarray 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>" --jsonand 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 setspectra 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>" --jsonThis 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-proposeto create the change artifacts first - If
state: "all_done": congratulate, suggest archive - Otherwise: proceed to implementation
3b. Preflight check
If the apply instructions JSON includes a preflight field, act on its status:
"clean": silently continue — no output needed."warnings": display a brief summary, then continue automatically:
Only show the lines that are relevant (skip drifted if none, skip staleness if not stale).⚠ Preflight warnings: - Drifted files (modified after change was created): <list paths> - Change is <N> days old Continuing..."critical": display missing files with their source artifact, then use the AskUserQuestion tool to ask the user:⚠ Preflight: missing files detected - <path> (referenced in <source artifact>) - ... These files are referenced in the change artifacts but no longer exist on disk.Options: "Continue anyway" / "Stop" If the user chooses "Stop", end the workflow.
If there is no AskUserQuestion tool available: Display the same information as plain text and ask whether to continue or stop. Wait for the user's response.
If the preflight field is absent (blocked or all_done states), skip this step.
3c. Artifact quality check
Run spectra analyze <change-name> --json to check cross-artifact consistency (Coverage, Consistency, Ambiguity, Gaps).
- Zero findings: silently continue.
- Warning/Suggestion only: display a one-line summary (e.g., "⚠ Artifact analysis: 2 warnings found") and continue automatically.
Critical findings: display each Critical finding (summary + location + recommendation), then use the AskUserQuestion tool:
- Fix and continue — fix the artifact issues inline, then proceed
- Continue anyway — skip fixes and start implementation
- Stop — end the workflow
If there is no AskUserQuestion tool available, present options as plain text and wait for the user's response.
Read context files
Read the files listed in
contextFilesfrom 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
.spectra.yamlin the project root. Iftdd: trueis 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: trueis 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: trueis 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
- No Placeholders in artifacts — if the design or spec for this task contains placeholder language (TBD, TODO, "add appropriate handling"), pause and fix the artifact first or flag to the user. Do not implement against vague requirements.
- Examples as verification — if the spec for this task's scope includes
##### Example:blocks, use them as concrete test cases:- When TDD is enabled: derive the first failing test directly from the example's GIVEN/WHEN/THEN values
- When TDD is not enabled: after implementing, verify the code handles the example's input→output correctly
- Example tables map to parameterized tests — one test per row Do NOT invent additional test values beyond what the spec examples provide without reason. The examples ARE the agreed specification.
- Make the code changes required
- Keep changes minimal and focused
- Verify before marking done — re-read the task description from the tasks file. For each requirement stated in the description, confirm it is addressed by your changes. If any requirement is missing, implement it now. Do not mark the task complete until every part of the description is covered.
- Mark task complete by running:
spectra task done --change "<name>" <task-id>This command marks the checkbox in tasks.md AND records which files were modified for this task. - Continue to next task
Parallel task dispatch: When consecutive
[P]-marked tasks are found andparallel_tasks: trueis 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
Rationalization Table
| What You're Thinking | What You Should Do |
| "This task looks done, I'll mark it complete" | Re-read the task description first. Check whether your diff covers every part of it. Incomplete tasks marked done are the #1 source of rework |
| "This task is trivial, I don't need to re-read the design" | Re-read. Context compression loses details. 30s of reading saves 30min of rework |
| "I already know how this works, skip the code search" | Search anyway. Someone may have added a utility since you last looked |
| "The test is obvious, I'll add it after implementation" | If TDD is enabled, test first. If not, still write it before marking done |
| "This is just a small refactor, no test needed" | Small refactors are how regressions sneak in. Write the test |
| "The artifact says X but Y makes more sense" | Pause and suggest updating the artifact. Don't silently deviate |
| "I'll fix this other thing I noticed while I'm here" | Finish current task first. Address the other thing separately |
| "The example values are just illustrations, I'll pick better ones" | Use the spec example values exactly. They were chosen deliberately |
Final check
After completing all tasks, re-run:
spectra instructions apply --change "<name>" --jsonConfirm
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 completeOutput 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
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

