# /spec-miner: Write a specification for code nobody documented

Source: https://trendhub.net/skills/jeffallan-claude-skills/spec-miner
Skill folder: https://github.com/Jeffallan/claude-skills/tree/main/plugin/skills/spec-miner
Pack: Jeffallan's Claude Skills (https://trendhub.net/skills/jeffallan-claude-skills)
Works with: Claude Code (plugin marketplace)

Spec Miner reverse-engineers a specification from an existing codebase. Limited to read and search tools, the agent sets a scope, explores entry points, configuration and routes, traces data flows, and writes observed behaviour as EARS requirements with code locations. It keeps facts and inferences apart and records open questions in their own section.

## When to use it

- You inherited a project with no documentation and need to know what it does.
- You are about to extend a legacy feature and want its current behaviour written down first.
- A new team member needs an architecture overview drawn from the code itself.

## How it works

1. **Scope**: Decides whether to analyse the whole system or one feature.
2. **Explore**: Searches for entry points, TODO markers, environment use and route definitions, and keeps reading until key modules are covered.
3. **Trace**: Follows request paths and data flows through the code.
4. **Document and flag**: Writes observed requirements in EARS form with file locations, then lists uncertainties and recommendations in a reverse spec file.

## What it steers the agent away from

- Claims about behaviour that no code supports.
- Writing the spec before exploration covers the core modules.
- Skipping security and error handling patterns in the analysis.

## What it can touch

Restricted to Read, Grep and Glob, so it reads the codebase without changing it, and produces a single spec document.

## Pairs well with

- `/architecture-designer`
- `/feature-forge`
- `/legacy-modernizer`

## Questions

### Will it modify my code?

No. The skill declares only Read, Grep and Glob as allowed tools.

### What does the output contain?

Stack and architecture, module layout, observed requirements, non-functional notes, inferred acceptance criteria, open questions and recommendations.
