Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

spec-cleanup

БесплатноБез исполняемых скриптовНе проверен

Identify and clean up stale or superseded feature specs in a project's specs/ directory. Use whenever the user wants to prune, tidy, audit, consolidate, or…

ArjenSchwarzот ArjenSchwarz★ 20 звёзд на GitHub

Об этом скилле

Spec Cleanup

Spec directories accumulate history: a feature gets specced, then re-specced with a better approach, and the old spec lingers. Those leftovers cost mindshare — every overview scan, every "which spec is current?" question pays for them. This skill finds superseded specs and resolves them in one of two ways:

  • Fully replaced — a newer spec covers everything the old one did. The old spec should be removed.
  • Extended — a newer spec builds on a still-valid base, adding features. Both hold unique information, so a human must decide: consolidate into one spec, or remove one.

The skill is deliberately conservative. It deletes nothing without explicit approval, and when classification is ambiguous it errs toward "extended" because that routes the call to the user instead of the trash.

Prerequisites

  • A specs/ directory in the project root with at least two spec subdirectories.

Process

1. Discover

  • List all subdirectories under specs/, excluding specs/bugfixes/ (bug reports are historical records, not competing specs).
  • For each spec, read the primary document (requirements.md, smolspec.md, design.md, or plan.md — whichever exists first in that order), plus decision_log.md and tasks.md if present.
  • If the project is a git repository, collect per-spec dates: creation (git log --diff-filter=A --format='%aI' -- 'specs/<dir>/', oldest entry) and last modification (newest entry without the filter). Parallelize these lookups.

2. Detect supersession candidates

Group specs into candidate pairs or clusters when any of these signals appear:

  • Naming: shared stem with a version or revision suffix (feature / feature-v2, -revised, -improved, -new, -redesign).
  • Explicit references: one spec says it "supersedes", "replaces", "builds on", or "extends" another, or links to it as prior art.
  • Decision logs: a decision with status superseded by ..., or an entry recording that an approach was abandoned in favour of another spec.
  • Scope overlap: two specs describe the same feature area or repeat substantially the same requirements.
  • Git corroboration: the older spec has had no commits since the newer one was created, or its tasks sit unchecked while the newer spec's tasks progressed.

A single signal — especially naming — is a hint, not a verdict. payments and payments-v2 might be a replacement, or v2 might be phase two of a still-valid phase one. Read both specs' content before pairing them; a spec that merely mentions another is not automatically its successor.

3. Classify each candidate

For each pair/cluster, compare scope and decide:

  • Fully replaced: the newer spec covers all of the older spec's requirements (possibly with a different approach), or the older spec was abandoned before implementation in favour of the newer one. Nothing in the old spec is still the authoritative record for anything. → Recommend removal.
  • Extended: the newer spec adds features on top of the older one, and the older spec remains the authoritative record for the base behaviour. → Recommend a user decision: consolidate both into one spec, or remove one and accept the information loss.
  • Not actually related: on reading, the specs cover different things. Drop the pair from the report; do not pad the findings.

Implementation status matters: a completed old spec whose behaviour is restated in the new spec is safe to remove (the code and the new spec carry the knowledge). A completed old spec whose details the new spec does not restate is an "extended" case — removing it loses the only written record.

When genuinely unsure, classify as extended. The cost of asking an unnecessary question is small; the cost of deleting the only record of a design decision is not.

4. Report — approval gate

Present the findings before touching any file. Use this structure:

# Spec Cleanup Report

| # | Stale spec | Superseded by | Classification | Recommended action |
|---|-----------|---------------|----------------|--------------------|
| 1 | user-auth | user-auth-v2  | Fully replaced | Remove             |
| 2 | export-csv | export-formats | Extended      | Decide: consolidate or remove |

## 1. user-auth → user-auth-v2 (fully replaced)

**Evidence:**
- user-auth-v2/requirements.md states "This spec supersedes user-auth"
- All 6 requirements in user-auth appear in user-auth-v2 (revised approach)
- user-auth untouched since 2025-03-02; tasks 2/9 complete, abandoned

**Recommended action:** remove `specs/user-auth/`

## 2. export-csv → export-formats (extended)
...

Every claim in the evidence list must be checkable — quote the supersession sentence, name the decision entry, give the dates. The user is approving deletions based on this report; vague evidence makes the gate meaningless.

Then stop and wait for explicit approval. The user may approve all items, a subset, or override a classification (e.g. "consolid

Полный SKILL.md на GitHub

Установить spec-cleanup в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

FAQ

Что делает скилл spec-cleanup?

Identify and clean up stale or superseded feature specs in a project's specs/ directory. Use whenever the user wants to prune, tidy, audit, consolidate, or declutter specs, mentions outdated/overruled/replaced/superseded specs or a spec that has a v2 or improved version, or asks which specs are still relevant — even if they don't explicitly say "cleanup".

Как установить скилл spec-cleanup?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл spec-cleanup запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить spec-cleanup с