con un clic
spectra-drift
Detect drift between a Spectra change and the current codebase state
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Detect drift between a Spectra change and the current codebase state
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Use when 使用者說「自動推」「loop」「幫我把 change 推到 ready」「不在的時候繼續做」、或 routine fire 自動觸發(--unattended)。適用於推進既有 spectra change;NOT for 非 spectra 工作、一次性任務、interval 盲跑命令(用 /loop)、user 在場想逐項拍板(用 /goal)、或想設計新 loop(看 vendor/snippets/loop-engineering cookbook)。
依功能分類變更並逐步完成 commit,遵循 commitlint 規範。Use when 使用者說「commit」「提交」「分批 commit」,或 working tree 有多組 unrelated 變更需要分門別類提交。
Deprecated alias — 已改名 /change-loop(2026-07-05)。Use when 既有 routine 或舊指令仍呼叫 /loop-engineer 時轉發。
Analyze artifact consistency for a change
Implement or resume tasks from a Spectra change
Archive a completed change
Basado en la clasificación ocupacional SOC
| name | spectra-drift |
| description | Detect drift between a Spectra change and the current codebase state |
| context | fork |
| agent | Explore |
| disallowedTools | ["Edit","Write"] |
| license | MIT |
| compatibility | Requires spectra CLI. |
| effort | medium |
| metadata | {"author":"spectra","version":"1.0","generatedBy":"Spectra"} |
This generated Claude Code skill runs with context: fork. The rules in this section take precedence over the shared drift body below.
When no change name is provided, run spectra list --json. Auto-select only when there is exactly one active change. If there are zero active changes or more than one active change, return the candidate list or empty-state message and ask the main thread to rerun /spectra-drift <change-name>. Do NOT ask an interactive selection question inside the fork.
Detect drift between a Spectra change and the current codebase state. Reports time dormancy, broken design anchors, task collisions with external commits, and a single recommended next command.
Input: Optionally specify a change name (e.g., /spectra-drift add-auth). If omitted, infer from conversation context or auto-select if only one active change exists.
Prerequisites: This skill requires the spectra CLI. If any spectra command fails with "command not found" or similar, report the error and STOP.
Steps
Determine change name
If not provided, infer from context or run spectra list --json to auto-select. If multiple active changes exist and no name is given, list candidates and ask the user to rerun with an explicit name.
Run programmatic drift analysis
spectra drift <change-name> --json
The JSON contains:
severity: "light" / "medium" / "heavy"total_score: aggregate over Time / Structure / Tasks (Environment is display-only)dimensions: array of { kind, status, score, contributes_to_total }broken_anchors: design.md references (file paths / symbols / functions / CLI flags) that no longer resolvetasks_blocked_external: pending tasks whose referenced files were modified by commits outside the change dirtasks_maybe_resolved: pending tasks whose verb+target keywords match commit subjects since createdprimary_recommendation: a single copy-pasteable command linePresent the report
Use a user-readable, conclusion-first format. The first substantive paragraph after the title MUST be a plain-language conclusion that says what to do next before showing score tables, broken anchors, task collisions, or severity labels.
Translate severity into action-oriented meaning:
Recommended shape:
## Drift Report: <change-name>
<Plain-language conclusion. Example for medium: "This change can continue, but update the plan before implementing it. Related code has changed since the plan was written, so applying the old tasks directly may cause rework or conflicts.">
### Why
- <1-3 plain-language reasons derived from dimensions, broken anchors, and task collisions>
### Details
| Item | Result |
| ----------------- | ------------------------------------------------------ |
| Time | <status> |
| Design references | <broken anchor count or "No broken references"> |
| Pending tasks | <blocked/maybe-resolved count or "No task collisions"> |
| Overall | <light/medium/heavy, total score N> |
### Recommendation
Run `<primary_recommendation>`.
Keep technical details below the plain-language conclusion. List broken anchors, blocked tasks, and maybe-resolved tasks only when non-empty. Omit empty technical detail sections entirely. Keep the report short enough to skim; the goal is to help the user decide, not to explain the scoring model.
Apply the recommendation interactively
Use the AskUserQuestion tool to offer one decision based on severity. Use plain-language option labels while preserving the exact command in each option description. Do NOT auto-invoke /spectra-apply, /spectra-ingest, or spectra archive; always wait for the user's choice.
/spectra-apply <name>/spectra-ingest <name> with the broken references and task collisions as context/spectra-apply <name> only if the user knows the reported changes are harmless<primary_recommendation>/spectra-ingest <name> before restartingIf the AskUserQuestion tool is not available, present the same plain-language choices as text and wait for the user's response.
Passive Trigger
When /spectra-apply is invoked on a change whose .openspec.yaml created date is more than 5 days ago AND no commits have touched the change directory in the past 3 days, the apply skill SHOULD run drift analysis first and surface findings before tasks begin. The trigger is guidance only and MUST NOT block apply from proceeding.
(Threshold reasoning: AI-assisted commits are daily-cadence, not weekly. A change sitting ≥5 days with ≥3 days of no commits is almost always genuine stagnation rather than normal pacing.)
Guardrails
ANCHOR_CAP in spectra_core::drift to bound run-timespectra drift returns a non-zero exit code (e.g., older binary without the drift subcommand), report the error and stop