Skip to content
Back to skills

Speclink Drift

ASecurity

Use when picking a change back up after it sat idle, before touching its tasks — reports how far the codebase has moved from the delta's assumptions.

  • 27 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added November 23, 2026
developmentgobashexpressrailsgitapi

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Scanned November 23, 2026

npx -y skills add MomoChenisMe/speclink --skill speclink-drift --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Speclink Drift?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Speclink Drift
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/momochenisme-speclink-drift-speclink/badge)](https://www.skillsdirectory.com/skills/momochenisme-speclink-drift-speclink)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: speclink-drift
description: "Use when picking a change back up after it sat idle, before touching its tasks — reports how far the codebase has moved from the delta's assumptions."
context: fork
agent: Explore
disallowedTools: [Edit, Write]
license: MIT
compatibility: Requires speclink CLI.
metadata:
  author: speclink
  version: "v1.59.0"
  generatedBy: "Speclink"
---

## Claude fork context

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 `speclink 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 `/speclink-drift <change-name>`. Do NOT ask an interactive selection question inside the fork.

---

**Conversation language**: write to the user in the language they use with you — progress updates, questions, and summaries. This skill is written in English, and its example messages show structure, not language: translate their prose, and keep commands, file paths, code, and fixed tokens (severity labels, status words) as they are. When a step sets the language of its own output — a document, a report, or the way it presents results and asks about them (for example through `locale`) — that step decides for that output. When you edit a document that already exists and no step sets its language, keep the language it is written in. When you run in a forked context that cannot see the conversation, use the language of the request you were given.

Detect drift between a Speclink change and the current codebase state. Reports time dormancy, broken design anchors, task collisions with external commits, and a single recommended next command.

**Read-only**: never modify files, artifacts, or git state based on drift findings.

**Input**: Optionally specify a change name (e.g., `/speclink-drift add-auth`). If omitted, infer from conversation context or auto-select if only one active change exists.

**Prerequisites**: This skill requires the `speclink` CLI. If any `speclink` command fails with "command not found" or similar, report the error and STOP.

**Steps**

1. **Determine change name**

   If not provided, infer from context or run `speclink 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.

2. **Run programmatic drift analysis**

   ```bash
   speclink drift <change-name> --json
   ```

   A non-zero exit code (e.g., a binary without the drift subcommand) → report the error and stop.

   The JSON contains:
   - `severity`: `"light"` / `"medium"` / `"heavy"`
   - `total_score`: aggregate over Time / Structure / Tasks / Specs (Environment is display-only)
   - `dimensions`: array of `{ kind, status, score, contributes_to_total }`
   - `broken_anchors`: design.md references that no longer resolve. Only code-like tokens anchor (camelCase / snake_case / multi-hump PascalCase, plus backticked expressions); prose capitalized words never do. Backticked file paths (`hr/index.html`) are existence-checked and report as category `File`. The change's own directory is excluded from the symbol search, so a committed design does not satisfy its own anchors.
   - `spec_assumptions`: delta-spec operations whose canonical target has drifted — a MODIFIED/REMOVED/RENAMED requirement that no longer exists, or an ADDED requirement that now already exists. **The archive merge gate refuses these**; any entry here routes the recommendation to ingest.
   - `tasks_blocked_external`: pending tasks referencing a file that was touched by commits since `created` and no longer exists
   - `tasks_maybe_resolved`: pending tasks referencing a file that was committed since `created` and exists — the work may already be done
   - `commits_since_created` and the Environment status: commits since the created date (midnight-anchored), with a count of how many touch files this change references (touched record + task references)
   - `primary_recommendation`: a single copy-pasteable command line

3. **Present the report**

   **Report language**: run `speclink instructions apply --change "<name>" --json` and use its `locale` field (e.g., "Traditional Chinese (繁體中文)") — write the report in that language, prose, headings, and table labels included. Keep severity labels (light/medium/heavy), command lines, and code references in English. If the field is absent or the call fails, write in English.

   Use a user-readable, conclusion-first format. The first substantive paragraph after the title is 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:
   - **Light**: the change can continue with apply.
   - **Medium**: the change can continue, but the plan should be refreshed before implementation.
   - **Heavy**: the old plan is likely unsuitable for direct implementation; restart or refresh first.

   Recommended shape:

   ```markdown
   ## 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">           |
   | Delta assumptions | <stale assumption count or "All delta targets still hold"> |
   | Pending tasks     | <blocked/maybe-resolved count or "No task collisions">    |
   | Environment       | <N commits, M touching this change's files>               |
   | Overall           | <light/medium/heavy, total score N>                       |

   ### Recommendation

   Run `<primary_recommendation>`.
   ```

   Keep technical details below the plain-language conclusion. List broken anchors, stale delta assumptions, 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.

   **Stale delta assumptions take priority in the conclusion**: they mean another change has already rewritten the canonical requirement this delta targets, and the archive merge gate will refuse the change as-is. Say so explicitly and lead with the ingest recommendation.

4. **Apply the recommendation interactively**

   Use the **AskUserQuestion tool** to offer one decision based on `severity`. Use plain-language option labels (in the report language) while preserving the exact command in each option description. Do NOT auto-invoke `/speclink-apply`, `/speclink-ingest`, `speclink archive`, or any other follow-up command; always wait for the user's choice. If the **AskUserQuestion tool** is not available, present the same plain-language choices as plain text and wait for the user's response.
   - **Light** (score 0-3, drift is minor):
     - Recommended label: "Directly start work"
       - Description: run `/speclink-apply <name>`
     - Alternate label: "Pause for now"
       - Description: do nothing until the user reviews manually
   - **Medium** (score 4-8, refresh worth doing):
     - Recommended label: "Refresh the plan"
       - Description: run `/speclink-ingest <name>` with the broken references and task collisions as context
     - Alternate label: "Directly start work"
       - Description: run `/speclink-apply <name>` only if the user knows the reported changes are harmless
     - Alternate label: "Pause for now"
       - Description: do nothing until the user reviews manually
   - **Heavy** (score >8 or anchor decay >30%, design diverges from code):
     - Recommended label: "Archive and restart"
       - Description: run `<primary_recommendation>`
     - Alternate label: "Refresh the plan"
       - Description: try `/speclink-ingest <name>` before restarting
     - Alternate label: "Pause for now"
       - Description: do nothing until the user reviews manually


**Passive Trigger**

When `/speclink-apply` is invoked on a dormant change, the apply skill SHOULD run drift analysis first and surface findings before tasks begin. A change is dormant when the `created` of its entry in `speclink list --json` is more than 5 days ago and its `modifiedAt` is more than 3 days ago. An entry with no `modifiedAt` is judged on `created` alone — say then that the last activity cannot be read. An entry with no `created` is not dormant. The trigger is guidance only and does not block apply from proceeding.

(Threshold reasoning: AI-assisted work is daily-cadence, not weekly. A change created ≥5 days ago whose documents have not changed for ≥3 days is almost always genuine stagnation rather than normal pacing.)

**Guardrails**

Check these before you report (the CLI caps anchor checks at 50 via `ANCHOR_CAP` in `speclink_core::drift` to bound run-time):

- [ ] Nothing was modified ("Read-only").
- [ ] The report opens with the plain-language conclusion, and stale delta assumptions lead it when present (step 3).
- [ ] No follow-up command ran without the user's choice (step 4).

## Next steps

Suggestions only. This skill NEVER invokes any of them — report where things stand and stop; the user decides what runs next.

- The delta's assumptions are stale → `/speclink-ingest <change-name>` to refresh the artifacts before any code is written
- No meaningful drift → `/speclink-apply <change-name>` to pick the tasks back up

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.