
Spec compact
Trims shipped spec and plan files down to their rationale, keeping decisions and links
Spec compact is an open-source agent skill for developer tools. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.
- Scripts
- shell, TypeScript
- Platforms
- Claude Code, Codex, Cursor
- GitHub stars
- 5
- Last commit
- License
- MIT
- Listing updated
Similar skills
About Spec compact
This skill shrinks a plan or design markdown file once the feature it describes has shipped. It removes transient material such as code snippets, step-by-step walkthroughs, file-by-file diffs and verification command lists, on the reasoning that the codebase and git history now hold those details. Decisions, context, key file references and changelog entries are kept.
The workflow is staged. The agent first locates the specs folder and reads any convention or index files to find sibling design and requirements documents. It then checks that the implementation has shipped, using signals such as files existing on disk or recent commits, and refuses requirements or index files unless forced. Every heading is sorted into keep, thin, remove, hoist or defer buckets, and the agent shows a compaction plan before editing anything. Naming, dead links and index drift are passed to a separate spec-lint skill rather than fixed here.
The skill is written for markdown spec files in a repository that follows a specs-folder layout. It expects a file path inside that tree and works through the agent's file reading and git access. Output is an in-place edit with a dated changelog entry, or an optional preview file, left uncommitted for the user to review.
When your agent uses it
Compact a spec plan (or design doc) markdown file after the implementation has shipped: strip the transient how — code snippets, step-by-step walkthroughs, file-by-file diffs — that the codebase now owns, keep the why — design decisions, key file references, changelog. Use when the user wants to compact, shrink, or trim a plan/spec file post-implementation, says the plan is bloated or too long now that the feature shipped, or invokes `/spec-compact`. Renaming files, fixing dead links, and index updates belong to `spec-lint`.
From the skill's SKILL.md. Your agent reads this description to decide when to load the skill.
What it can access
- Runs shell and TypeScript scripts(see the files on GitHub)
- No network calls found in its scripts(see the files on GitHub)
- License: MIT(see the files on GitHub)
From a static check of its 39 files (46 KB) on GitHub on 1 December 2026. Nothing was run. Read the files before you install a skill: it can tell your agent to run anything its tools allow.
Check another skill before you install it.
Install
This skill ships in the ai-sdlc-skills plugin. In Claude Code, add the marketplace and install the plugin (it may include other skills too):
/plugin marketplace add kevinlin/skills
/plugin install ai-sdlc-skills@ai-sdlcOr copy only this skill to ~/.claude/skills/spec-compact:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/kevinlin/skills.git "$tmp" &&
mkdir -p ~/.claude/skills &&
rm -rf ~/.claude/skills/spec-compact &&
cp -R "$tmp/spec-compact" ~/.claude/skills/spec-compact &&
rm -rf "$tmp"For one project only, put the folder in .claude/skills/spec-compact inside it instead.
Copy the skill folder to ~/.agents/skills/spec-compact to use it in every repository:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/kevinlin/skills.git "$tmp" &&
mkdir -p ~/.agents/skills &&
rm -rf ~/.agents/skills/spec-compact &&
cp -R "$tmp/spec-compact" ~/.agents/skills/spec-compact &&
rm -rf "$tmp"For one repository only, put the folder in .agents/skills/spec-compact inside it instead.
Copy the skill folder to ~/.cursor/skills/spec-compact to use it in every project:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/kevinlin/skills.git "$tmp" &&
mkdir -p ~/.cursor/skills &&
rm -rf ~/.cursor/skills/spec-compact &&
cp -R "$tmp/spec-compact" ~/.cursor/skills/spec-compact &&
rm -rf "$tmp"For one project only, put the folder in .cursor/skills/spec-compact inside it instead.
Run in a terminal (add --scope workspace to install it for the current workspace only):
gemini skills install https://github.com/kevinlin/skills.git --path spec-compactOr copy the folder to ~/.gemini/skills/spec-compact yourself.
For GitHub Copilot in VS Code, copy the skill folder to ~/.copilot/skills/spec-compact:
tmp=$(mktemp -d) &&
git clone --depth 1 https://github.com/kevinlin/skills.git "$tmp" &&
mkdir -p ~/.copilot/skills &&
rm -rf ~/.copilot/skills/spec-compact &&
cp -R "$tmp/spec-compact" ~/.copilot/skills/spec-compact &&
rm -rf "$tmp"For one project only, put the folder in .github/skills/spec-compact inside it instead.
Get the folder:
git clone --depth 1 https://github.com/kevinlin/skills.gitThen copy skills/spec-compact into your agent's skills folder as spec-compact. Agents that support SKILL.md read one folder per skill.
What it does
- Post-ship section triage
- Sorts each heading into keep, thin, remove, hoist or defer based on whether its content still has forward value.
- Shipment verification
- Checks several signals such as existing critical files and recent commits before any compaction is planned.
- Rationale preservation
- Keeps goals, design decisions, error tables and architecture diagrams while stripping implementation detail.
- Confirmed compaction plan
- Presents a before-and-after plan and waits for approval, with options to preview the file or diff first.
- Changelog entry
- Adds a dated note recording the compaction, so the original plan remains recoverable through git history.
Good for
- Shrink a plan file now that the feature it guided has shipped
- Remove code snippets and step lists from an old design doc
- Trim a bloated spec that is too long after implementation
- Preview a compacted version of a plan before overwriting it
Spec compact FAQ
When does the skill trigger?
When the user asks to compact, shrink or trim a plan or spec file after implementation, says the plan is bloated, or invokes /spec-compact.
Will Spec compact edit a file without asking?
No. It shows a compaction plan and waits for an explicit yes, and it can write a preview file instead of changing the original.
Which files can Spec compact compact?
Only plan and design files. Requirements, index and meta files are refused unless the user passes a force flag.
Does Spec compact fix dead links or file names?
No. Those fixes belong to the spec-lint skill, and spec-compact only lists them as deferred findings.
How do I install Spec compact in Claude Code?
Copy the skill folder from GitHub to ~/.claude/skills/spec-compact to use it in all your projects, or to .claude/skills/spec-compact in one project. Or install the ai-sdlc-skills plugin, which includes it: /plugin marketplace add kevinlin/skills, then /plugin install ai-sdlc-skills@ai-sdlc.
Does Spec compact run scripts?
Yes. It runs shell and TypeScript scripts. No network calls were found in its scripts. This comes from a static check of the files on GitHub; nothing was run. Read the files before you install it.
Which AI agents can use Spec compact?
Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose. Each reads skills in the SKILL.md format from its own folder; the install steps on this page list them.
What are the best alternatives to Spec compact?
The closest alternatives to Spec compact are Spec coding, Spec lint, Refactor seams, Spec and Shiplog.
Where this comes from
- Description: from the skill's own SKILL.md.
More from kevinlin/skills

Builds a cross-tool report on how you use your local AI coding agent sessions
- Open source
- 5 GitHub stars
- Developer tools

Gives your agent a senior-engineer checklist for reviewing diffs, PRs and branches
- Open source
- 5 GitHub stars
- Developer tools

Removes AI-writing tells from any text and rewrites it to fit its genre
- Open source
- 5 GitHub stars
- Writing style

Produces structured HTML gap analysis reports and a master gap register for bids
- Open source
- 5 GitHub stars
- Productivity

Generates styled HTML/CSS architecture and pipeline diagrams that embed directly
- Open source
- 5 GitHub stars
- Developer tools

Turns meeting recordings and notes into speaker-attributed transcripts and verified recaps
- Open source
- 5 GitHub stars
- Productivity



