Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
pixel-process-ug avatar

Reverse Engineering Specs

  • 88 installs
  • 1 repo stars
  • Updated March 16, 2026
  • pixel-process-ug/superkit-agents

Helps with ai & agent building tasks.

About

reverse-engineering-specs is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • reverse-engineering-specs
  • AI & Agent Building
  • AI-coding skill

Reverse Engineering Specs by the numbers

  • 88 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 4, 2026 (Skillselion tracking)
  • Ranked #4,935 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
npx skills add https://github.com/pixel-process-ug/superkit-agents --skill reverse-engineering-specs

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs88
repo stars1
Last updatedMarch 16, 2026
Repositorypixel-process-ug/superkit-agents

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

Reverse Engineering Specifications

Overview

For brownfield/legacy projects without documentation, this skill generates implementation-free specifications by exhaustively analyzing existing code. The output is a complete behavioral description that drives autonomous development on top of the existing codebase — enabling safe refactoring, feature addition, and modernization.

Key principle: Document actual behavior, including bugs. Bugs are "documented features" until explicitly marked for fixing.

This is a RIGID skill. Every code path must be traced. No assumptions, no skipping.

Phase 1: Exhaustive Code Investigation

[HARD-GATE] Every code path must be traced. No assumptions, no skipping.

Deploy parallel subagents via the Agent tool (up to 500, with subagent_type="Explore") to analyze:

Analysis TargetWhat to DocumentPriority
Entry pointsAll ways the system can be invoked (HTTP, CLI, events, cron)P0
Code pathsEvery branch, loop, conditional, early returnP0
Data flowsInput → transformation → output for every pipelineP0
State mutationsEvery place state is read, written, or deletedP0
Error handlingTry/catch blocks, error codes, fallback behaviorsP0
Side effectsExternal calls, file I/O, database writes, event emissionsP1
ConfigurationEnvironment variables, config files, feature flagsP1
DependenciesExternal services, libraries, APIs consumedP1
ConcurrencyAsync operations, race conditions, locking mechanismsP2
Implicit behaviorConvention-based routing, middleware chains, decoratorsP2

Investigation Strategy Decision Table

Codebase SizeStrategySubagent Count
Small (<50 files)Single-pass full scan5-10
Medium (50-500 files)Module-by-module scan50-100
Large (500+ files)Entry-point-first, then depth scan200-500

STOP after investigation — present a summary of discovered entry points, data flows, and behaviors. Get confirmation before generating specs.

Phase 2: Behavioral Specification Generation

Transform code analysis into implementation-free specs following the spec-writing skill format.

Transformation Rules

RuleExplanation
Strip ALL implementation detailsNo function names, variable names, technology references
Describe WHAT, never HOWObservable behavior only
Document actual behavior (bugs included)Bugs become "current behavior" in specs
Use Given/When/Then formatFor all acceptance criteria
Include data contractsInput shapes, output shapes, invariants
Separate known issuesBugs go in KNOWN_ISSUES.md, not inline

Implementation Detail Stripping

Code ArtifactWhat You SeeWhat You Write in Spec
jwt.verify(token, secret)Token validation with JWT"Credentials are validated against the authentication system"
redis.get(cacheKey)Redis cache lookup"Previously computed results are retrieved from cache"
if (user.role === 'admin')Role check"Privileged operations require administrator access"
res.status(429).json(...)Rate limiting response"Excessive requests receive a rate limit error"
bcrypt.hash(pw, 12)Password hashing"Passwords are stored in a non-reversible format"

STOP after spec generation — run the completeness checklist before organizing.

Phase 3: Specification Organization

Create spec files following the naming convention:

specs/
├── 01-[first-capability].md
├── 02-[second-capability].md
├── ...
├── NN-[last-capability].md
└── KNOWN_ISSUES.md

KNOWN_ISSUES.md Format

# Known Issues

## [Issue Title]
- **Current behavior:** [What actually happens]
- **Expected behavior:** [What should happen, if known]
- **Affected specs:** [Which spec files reference this behavior]
- **Severity:** [Critical | High | Medium | Low]
- **Notes:** [Additional context]

Severity Classification

SeverityCriteriaAction
CriticalData loss, security vulnerability, system crashFix before any new features
HighIncorrect results, broken workflowFix in next release
MediumPoor UX, performance issuePlan for future fix
LowCosmetic, minor inconsistencyFix opportunistically

STOP after organization — present the spec file list and KNOWN_ISSUES for review.

Phase 4: Quality Verification

[HARD-GATE] All checks must pass before this phase is complete.

#CheckQuestionStatus
1Entry pointsAre ALL entry points documented?[ ]
2Code pathsAre ALL branches and conditionals traced?[ ]
3Data flowsAre ALL input→output pipelines described?[ ]
4State mutationsAre ALL state changes captured?[ ]
5Error handlingAre ALL error paths documented?[ ]
6Side effectsAre ALL external interactions noted?[ ]
7Edge casesAre boundary conditions described?[ ]
8ConcurrencyAre async behaviors documented?[ ]
9ConfigurationAre ALL config options listed?[ ]
10DependenciesAre ALL external dependencies identified?[ ]
11Implementation-freeZero code, tech names, or architecture in specs?[ ]
12Given/When/ThenAll acceptance criteria in correct format?[ ]

Concrete Example: Code to Spec Transformation

Code (input — what you analyze):

function checkAuth(req, res, next) {
  const token = req.headers.authorization?.split(' ')[1];
  if (!token) return res.status(401).json({ error: 'No token' });
  try {
    const decoded = jwt.verify(token, process.env.JWT_SECRET);
    req.user = decoded;
    next();
  } catch (e) {
    return res.status(403).json({ error: 'Invalid token' });
  }
}

Spec (output — what you produce):

# Request Authentication

## Job to Be Done
When a request arrives at a protected endpoint, I want to verify the
caller's identity, so I can ensure only authorized users access the system.

## Acceptance Criteria

### Valid Credentials
- Given a request with valid credentials in the authorization header
- When the request is processed
- Then the request proceeds to the next handler
- And the authenticated user identity is available to downstream handlers

### Missing Credentials
- Given a request without credentials
- When the request is processed
- Then a 401 status is returned
- And an error message indicates missing credentials

### Invalid Credentials
- Given a request with invalid or expired credentials
- When the request is processed
- Then a 403 status is returned
- And an error message indicates invalid credentials

## Edge Cases
- Malformed authorization header (missing "Bearer" prefix): treated as missing credentials
- Expired credentials: treated as invalid credentials

## Data Contracts
- Input: Authorization header in "Bearer <credential>" format
- Output on success: User identity object attached to request context
- Output on failure: JSON error response with appropriate status code

Notice: No mention of JWT, middleware, Express, environment variables, or any implementation detail.

Anti-Patterns / Common Mistakes

MistakeWhy It Is WrongWhat To Do Instead
Skipping "boring" code pathsUndocumented behavior causes bugs during refactoringTrace EVERY path, even error handlers
Leaking implementation details into specsDefeats the purpose of behavioral specsStrip all tech names, function names, code
Marking bugs as "correct behavior"Loses the information that it is a bugDocument in KNOWN_ISSUES.md with severity
Skipping async/concurrency analysisRace conditions are the hardest bugs to findDocument all async behavior
Analyzing only happy pathsMost bugs live in error pathsDocument ALL error handling paths
Guessing behavior instead of tracing codeSpec becomes fictionRead every line — no assumptions
Generating specs without user reviewMisunderstandings propagatePresent for review after each phase

Anti-Rationalization Guards

  • [HARD-GATE] Do NOT skip any code path — every branch, conditional, and error handler must be traced
  • [HARD-GATE] Do NOT include ANY implementation details in specs — no code, tech names, or architecture
  • [HARD-GATE] Do NOT mark the completeness checklist as done until ALL 12 items pass
  • Do NOT skip concurrency analysis — even if the code "looks synchronous"
  • Do NOT skip configuration analysis — env vars and feature flags change behavior
  • Do NOT assume behavior from function names — read the actual code
  • Do NOT fix bugs while reverse-engineering — document them in KNOWN_ISSUES.md

Integration Points

SkillRelationship
spec-writingOutput follows spec-writing format; use for audit after generation
autonomous-loopSpecs feed into planning mode for gap analysis
acceptance-testingTests derived from reverse-engineered acceptance criteria
self-learningPopulate memory files with discovered project context
planningAfter specs exist, plan improvements or new features
systematic-debuggingKnown issues inform debugging priorities

Workflow After Reverse Engineering

StepSkillPurpose
1reverse-engineering-specs (this)Generate behavioral specs from code
2spec-writing (audit mode)Verify quality and completeness
3planningIdentify gaps, plan improvements
4autonomous-loopImplement features or fixes with specs as guide

Verification Gate

Before claiming reverse engineering is complete:

1. VERIFY the completeness checklist (all 12 items) passes 2. VERIFY zero implementation details in any spec file 3. VERIFY all acceptance criteria use Given/When/Then format 4. VERIFY KNOWN_ISSUES.md exists and categorizes all discovered bugs 5. VERIFY the user has reviewed the spec set and KNOWN_ISSUES

Skill Type

Flexible — Adapt investigation depth and subagent count to codebase size while preserving the exhaustive-investigation and implementation-free output rules. No code paths may be skipped.

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.