# Spec compact

> Spec compact is an open-source agent skill for developer tools. Trims shipped spec and plan files down to their rationale, keeping decisions and links. It is available on Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf and Goose.

- **Kind:** Skill
- **Pricing:** Open source
- **Platforms:** Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, Windsurf, Goose
- **Website:** https://github.com/kevinlin/skills/tree/main/spec-compact
- **Repository:** https://github.com/kevinlin/skills
- **GitHub stars:** 5
- **License:** MIT
- **Skill name:** spec-compact
- **Collection:** https://github.com/kevinlin/skills
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-12-01

## About

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`.

## What it can access

From a static check of the files on GitHub; nothing was run.

- [Runs shell and TypeScript scripts](https://github.com/kevinlin/skills/tree/HEAD/spec-compact)
- [No network calls found in its scripts](https://github.com/kevinlin/skills/tree/HEAD/spec-compact)
- [License: MIT](https://github.com/kevinlin/skills/tree/HEAD/spec-compact)

## Features

- **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

## Install

### Claude Code

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):

```sh
/plugin marketplace add kevinlin/skills
/plugin install ai-sdlc-skills@ai-sdlc
```

Or copy only this skill to `~/.claude/skills/spec-compact`:

```sh
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.

### Codex

Copy the skill folder to `~/.agents/skills/spec-compact` to use it in every repository:

```sh
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.

### Cursor

Copy the skill folder to `~/.cursor/skills/spec-compact` to use it in every project:

```sh
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.

### Gemini CLI

Run in a terminal (add `--scope workspace` to install it for the current workspace only):

```sh
gemini skills install https://github.com/kevinlin/skills.git --path spec-compact
```

Or copy the folder to `~/.gemini/skills/spec-compact` yourself.

### VS Code

For GitHub Copilot in VS Code, copy the skill folder to `~/.copilot/skills/spec-compact`:

```sh
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.

### Other agents

Get the folder:

```sh
git clone --depth 1 https://github.com/kevinlin/skills.git
```

Then copy `skills/spec-compact` into your agent's skills folder as `spec-compact`. Agents that support SKILL.md read one folder per skill.

## 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.

## Alternatives

- [Spec coding](https://ai-powered.com/skills/spec-coding): Spec coding is an open-source agent skill for developer tools.
- [Spec lint](https://ai-powered.com/skills/spec-lint): Spec lint is an open-source agent skill for developer tools.
- [Refactor seams](https://ai-powered.com/skills/refactor-seams): Refactor seams is an open-source agent skill for developer tools.
- [Spec](https://ai-powered.com/skills/spec-jasgujral): Spec is an open-source agent skill for developer tools.
- [Shiplog](https://ai-powered.com/skills/shiplog-devallibus): Shiplog is an open-source agent skill for developer tools.
- [Refactor plan](https://ai-powered.com/skills/refactor-plan): Refactor plan is an open-source agent skill for developer tools.
- [Make PR easy to review](https://ai-powered.com/skills/make-pr-easy-to-review): Make PR easy to review is an open-source agent skill for developer tools.
- [Create specification](https://ai-powered.com/skills/create-specification): Create specification is an open-source agent skill for developer tools.

---
Source: https://ai-powered.com/skills/spec-compact
