Skip to main content
skill Claude Code CX Codex Cursor GitHub Copilot

spec-miner — Claude Code skill: extract specs from code

A skill for reverse-engineering codebases. Extracts specifications from existing code, maps dependencies, and generates documentation for legacy and undocumented systems.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add Jeffallan/claude-skills --skill spec-miner -a claude-code
Open on GitHub

What spec-miner does

spec-miner operates in two perspectives: analyzing system architecture and tracing observable behavior. It uses Read, Grep, and Glob to explore project structure, follow data flows, and document findings in EARS format (Easy Approach to Requirements Syntax). Each observation is tied to specific code locations.

Use it when onboarding to a new codebase, planning enhancements, or extracting requirements from implementation. The skill avoids assumptions without code evidence and marks uncertain areas separately. It's essential for inherited systems where documentation is outdated or missing.

What it helps with

  • recover requirements from a legacy codebase
  • create documentation for undocumented systems
  • understand how third-party functions and modules work
  • uncover hidden business logic in old code
  • plan changes by understanding current architecture

Example prompts for the agent

  • Analyze this codebase to find APIs and core business logic
  • Generate a specification for the inherited project using EARS format
  • Trace data flows through the application and create a diagram

How to install spec-miner

1Skills CLI (Vercel)

npx skills add Jeffallan/claude-skills --skill spec-miner -a claude-code

2Manually: put the files in place

~/.claude/skills/spec-miner/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/spec-miner/

From the same set61

The whole set →
laravel-specialist https://github.com/Jeffallan Configures the agent for Laravel 10+ and PHP 8.2+ development. It guides Eloquent modeling, Horizon queues, API resources, and Pest testing. Claude Code CX Codex Cursor +1 23,300installs golang-pro https://github.com/Jeffallan A Go skill for concurrent code, microservices, performance profiling, and idiomatic interfaces. Use it for goroutines, gRPC, benchmarks, and table-driven tests. Claude Code CX Codex Cursor +1 18,900installs php-pro https://github.com/Jeffallan Enforces PHP 8.3+ standards across Laravel and Symfony projects with strict typing, PHPStan level 9 checks, and automated Pest tests. Claude Code CX Codex Cursor +1 15,500installs flutter-expert https://github.com/Jeffallan Skill for building cross-platform apps with Flutter 3+ and Dart. Covers widgets, state management via Riverpod or Bloc, GoRouter navigation, and performance optimization. Claude Code CX Codex Cursor +1 14,300installs typescript-pro https://github.com/Jeffallan Implements advanced TypeScript type systems, branded types, and tRPC configurations. Use it when building type-first APIs or complex discriminated unions. Claude Code CX Codex Cursor +1 14,200installs kubernetes-specialist https://github.com/Jeffallan This skill helps create and validate Kubernetes manifests, set workload security, and troubleshoot failing pods. Use it for deployment and cluster operations. Claude Code CX Codex Cursor +1 14,100installs devops-engineer https://github.com/Jeffallan This skill creates Dockerfiles, CI/CD configs, Kubernetes manifests, and IaC templates. Use it for deployments, platform work, and incident response. Claude Code CX Codex Cursor +1 11,200installs wordpress-pro https://github.com/Jeffallan This skill builds WordPress themes, plugins, Gutenberg blocks, and WooCommerce features. Use it for REST API work, hooks, security checks, and performance tuning. Claude Code CX Codex Cursor +1 9,700installs

Similar

ralplan Yeachan-Heo A skill that runs iterative planning with three agents (Planner, Architect, Critic) until consensus. Blocks vague requests before execution, never runs changes without your approval. Claude Code CX Codex Cursor +1 1,200installs github-code-review ruvnet Runs a swarm of specialized AI agents to inspect GitHub pull requests for security, performance, and architecture issues. Claude Code CX Codex Cursor +1 1,300installs sharp-edges trailofbits Audits API designs and configuration schemas for developer footguns. Flags dangerous defaults and fragile interfaces where the easiest path causes security vulnerabilities. Claude Code CX Codex Cursor +1 6,900installs security-review getsentry Finds injections, XSS, authorization flaws, and other vulnerabilities in code. Reports only high-confidence findings. Claude Code CX Codex Cursor +1 21,100installs post-mortem thananon Skill writes an engineering post-mortem after debugging: root cause with code identifiers, symptom, mechanism, the fix, and why it slipped through. Use after validation, before closing the ticket. Claude Code CX Codex Cursor +1 4,700installs improve-codebase-architecture Matt Pocock This skill scans a codebase for architectural friction, then builds a visual HTML report with refactoring candidates. Use it before a deeper architecture review. Claude Code 1,163,035installs tdd Matt Pocock Guides the red-green TDD loop: ensures tests are written first, keep them at public interfaces, and avoid coupling to implementation details. Claude Code 1,141,062installs triage Matt Pocock This skill moves issues and external PRs through triage states, verification, and agent briefs. It fits maintainers managing an issue queue. Claude Code 990,453installs

Questions about spec-miner

How do I install spec-miner in Claude Code?

Run npx skills add Jeffallan/claude-skills --skill spec-miner -a claude-code. The skill will be added to ~/.claude/skills/spec-miner/SKILL.md.

What does spec-miner do?

It analyzes your codebase to extract specifications, map dependencies, and create documentation in EARS format. Use it to understand legacy systems and projects with no documentation.

Which tools does the skill use?

Read to examine files, Grep to search for patterns, and Glob to scan project structure.

Source text

SKILL.md · MIT
---
name: spec-miner
description: "Reverse-engineering specialist that extracts specifications from existing codebases. Use when working with legacy or undocumented systems, inherited projects, or old codebases with no documentation. Invoke to map code dependencies, generate API documentation from source, identify undocumented business logic, figure out what code does, or create architecture documentation from implementation. Trigger phrases: reverse engineer, old codebase, no docs, no documentation, figure out how this works, inherited project, legacy analysis, code archaeology, undocumented features."
license: MIT
allowed-tools: Read, Grep, Glob
metadata:
  author: https://github.com/Jeffallan
  company: https://synergetic.solutions
  version: "1.1.0"
  domain: workflow
  triggers: reverse engineer, legacy code, code analysis, undocumented, understand codebase, existing system
  role: specialist
  scope: review
  output-format: document
  related-skills: feature-forge, fullstack-guardian, architecture-designer
---

# Spec Miner

Reverse-engineering specialist who extracts specifications from existing codebases.

## Role Definition

You operate with two perspectives: **Arch Hat** for system architecture and data flows, and **QA Hat** for observable behaviors and edge cases.

## When to Use This Skill

- Understanding legacy or undocumented systems
- Creating documentation for existing code
- Onboarding to a new codebase
- Planning enhancements to existing features
- Extracting requirements from implementation

## Core Workflow

1. **Scope** - Identify analysis boundaries (full system or specific feature)
2. **Explore** - Map structure using Glob, Grep, Read tools
   - _Validation checkpoint:_ Confirm sufficient file coverage before proceeding. If key entry points, configuration files, or core modules remain unread, continue exploration before writing documentation.
3. **Trace** - Follow data flows and request paths
4. **Document** - Write observed requirements in EARS format
5. **Flag** - Mark areas needing clarification

### Example Exploration Patterns

```
# Find entry points and public interfaces
Glob('**/*.py', exclude=['**/test*', '**/__pycache__/**'])

# Locate technical debt markers
Grep('TODO|FIXME|HACK|XXX', include='*.py')

# Discover configuration and environment usage
Grep('os\.environ|config\[|settings\.', include='*.py')

# Map API route definitions (Flask/Django/Express examples)
Grep('@app\.route|@router\.|router\.get|router\.post', include='*.py')
```

### EARS Format Quick Reference

EARS (Easy Approach to Requirements Syntax) structures observed behavior as:

| Type | Pattern | Example |
|------|---------|---------|

> See `references/ears-format.md` for the complete EARS reference.

## Reference Guide

Load detailed guidance based on context:

| Topic | Reference | Load When |
|-------|-----------|-----------|
| Analysis Process | `references/analysis-process.md` | Starting exploration, Glob/Grep patterns |
| EARS Format | `references/ears-format.md` | Writing observed requirements |
| Specification Template | `references/specification-template.md` | Creating final specification document |
| Analysis Checklist | `references/analysis-checklist.md` | Ensuring thorough analysis |

## Constraints

### MUST DO
- Ground all observations in actual code evidence
- Use Read, Grep, Glob extensively to explore
- Distinguish between observed facts and inferences
- Document uncertainties in dedicated section
- Include code locations for each observation

### MUST NOT DO
- Make assumptions without code evidence
- Skip security pattern analysis
- Ignore error handling patterns
- Generate spec without thorough exploration

## Output Templates

Save specification as: `specs/{project_name}_reverse_spec.md`

Include:
1. Technology stack and architecture
2. Module/directory structure
3. Observed requirements (EARS format)
4. Non-functional observations
5. Inferred acceptance criteria
6. Uncertainties and questions
7. Recommendations

Maintained by [@jeffallan](https://github.com/jeffallan), Principal Consultant at [Synergetic Solutions](https://synergetic.solutions)

[Documentation](https://jeffallan.github.io/claude-skills/skills/workflow/spec-miner/)

© https://github.com/Jeffallan · MIT · Jeffallan/claude-skills

See also

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor