Skills library for reverse engineering codebases. Produces complete, machine-readable documentation and phased rebuild plans to reliably re-build the service or application in a new technology or modernised framework.
Generate documentation that enables an AI agent to rebuild your system in a different language or framework while maintaining:
- External API contract compatibility
- Business logic accuracy
- Data model integrity
/plugin install https://github.com/cliftonc/unwind
Restart Claude Code after installation.
1. Use unwind:start
2. Review docs/unwind/architecture.md
3. Use unwind:unwinding-codebase
4. Use unwind:synthesizing-findings
Output:
docs/unwind/REBUILD-PLAN.md- Strategic rebuild approachdocs/unwind/layers/*/- Detailed layer analysis (folder per layer)
See a complete example from the RealWorld Go API:
/plugin uninstall unwind
/plugin install https://github.com/cliftonc/unwind
┌─────────────────────────────────────────────────────────────────────────────┐
│ UNWIND WORKFLOW │
├─────────────────────────────────────────────────────────────────────────────┤
│ │
│ PHASE 1: DISCOVERY │
│ ┌──────────────────────────┐ │
│ │ start │ ──► architecture.md │
│ └────────────┬─────────────┘ (layers, entry points, repo info) │
│ │ │
│ ▼ │
│ PHASE 2: LAYER ANALYSIS │
│ ┌──────────────────────────┐ │
│ │ unwinding-codebase │ ──► Dispatches layer specialists │
│ └────────────┬─────────────┘ │
│ │ │
│ ┌───────┴───────┬───────────┬───────────┬───────────┐ │
│ ▼ ▼ ▼ ▼ ▼ │
│ ┌─────────┐ ┌──────────┐ ┌─────────┐ ┌─────────┐ ┌──────────┐ │
│ │database/│ │ domain- │ │service- │ │ api/ │ │frontend/ │ │
│ │ │ │ model/ │ │ layer/ │ │ │ │ │ │
│ └────┬────┘ └────┬─────┘ └────┬────┘ └────┬────┘ └────┬─────┘ │
│ │ │ │ │ │ │
│ └──────────────┴────────────┴───────────┴───────────┘ │
│ │ │
│ ▼ │
│ PHASE 3: GAP DETECTION │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ verifying-layer-documentation │ │
│ │ (Parallel agents compare docs to source) │ │
│ └─────────────────────────────┬─────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────┐ │
│ │ gaps.md │ (per layer - work list only) │
│ └────┬─────┘ │
│ │ │
│ ▼ │
│ PHASE 4: GAP COMPLETION │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ completing-layer-documentation │ │
│ │ (Parallel agents fix all gaps, delete gaps.md) │ │
│ └─────────────────────────────┬─────────────────────────────┘ │
│ │ │
│ ▼ │
│ PHASE 5: SYNTHESIS │
│ ┌──────────────────────────────────────────────────────────┐ │
│ │ synthesizing-findings │ │
│ │ (Generates strategic REBUILD-PLAN.md) │ │
│ └──────────────────────────────────────────────────────────┘ │
│ │ │
│ ▼ │
│ ┌──────────────────────┐ │
│ │ REBUILD-PLAN.md │ │
│ │ (Strategic rebuild) │ │
│ └──────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────────┘
Extracts repository info (for GitHub links), detects layers, identifies tech stack.
Dispatches specialist agents in dependency order:
- Database (no dependencies)
- Domain Model (needs database)
- Service Layer (needs domain)
- API + Messaging (parallel, need services)
- Frontend (needs API)
- Tests (parallel, no layer dependencies)
Each layer writes to a folder with incremental files to avoid token limits.
Compares documentation against source code. Outputs ONLY what's missing to gaps.md - no scores, no "what's correct" text.
Reads gaps.md work lists and adds all missing documentation. Deletes gaps.md when complete.
Aggregates all layer documentation into final deliverables.
All analysis follows these principles (see skills/analysis-principles.md):
| Principle | Description |
|---|---|
| Completeness | Document ALL items - exact counts, not "30+" |
| Machine-readable | Actual code, SQL, mermaid - not prose summaries |
| Link to source | Uses repo info for GitHub links, or local paths |
| No commentary | Facts only, no speculation or recommendations |
| Rebuild categorization | Tag items as MUST/SHOULD/DON'T keep |
| Incremental writes | Write each section immediately, don't buffer |
| Migrations: current state | Document final schema, not migration history |
| Skill | Purpose | Output |
|---|---|---|
start |
Initial codebase exploration | architecture.md |
unwinding-codebase |
Orchestrates all phases | Dispatches specialists |
verifying-layer-documentation |
Detects gaps in docs | gaps.md per layer |
completing-layer-documentation |
Fixes all gaps | Updated layer files |
synthesizing-findings |
Generates strategic rebuild plan | REBUILD-PLAN.md |
| Skill | Analyzes | Key Requirements |
|---|---|---|
analyzing-database-layer |
Schema, repositories | All tables, JSONB schemas, indexes |
analyzing-domain-model |
Entities, validation | Constraint tables, permission matrix |
analyzing-service-layer |
Services, calculations | Formulas with source refs, edge cases |
analyzing-api-layer |
Endpoints, auth, contracts | OpenAPI/TSRest specs, route inventory |
analyzing-messaging-layer |
Events, queues | AsyncAPI specs, event schemas |
analyzing-frontend-layer |
Components, state | User flows (WHAT), not implementation (HOW) |
| Skill | Analyzes |
|---|---|
analyzing-unit-tests |
Unit test coverage and patterns |
analyzing-integration-tests |
Integration test infrastructure |
analyzing-e2e-tests |
E2E tests and page objects |
docs/unwind/
├── architecture.md # Layer detection, tech stack, repo info
├── layers/
│ ├── database/
│ │ ├── index.md # Overview, links to sections
│ │ ├── schema.md # All tables, fields
│ │ ├── repositories.md # Data access patterns
│ │ └── jsonb-schemas.md # Complex field structures
│ ├── domain-model/
│ │ ├── index.md
│ │ ├── entities.md
│ │ ├── enums.md
│ │ └── validation.md
│ ├── service-layer/
│ │ ├── index.md
│ │ ├── services.md
│ │ ├── formulas.md # Business calculations [MUST]
│ │ └── dtos.md
│ ├── api/
│ │ ├── index.md
│ │ ├── endpoints.md
│ │ ├── contracts.md # OpenAPI/TSRest [CRITICAL]
│ │ └── auth.md
│ ├── frontend/
│ │ ├── index.md
│ │ ├── pages.md # User flows, not React code
│ │ └── state.md
│ └── [test layers...]
└── REBUILD-PLAN.md # Strategic rebuild approach
The REBUILD-PLAN.md provides:
- External Contract Compatibility - OpenAPI/AsyncAPI specs that MUST be preserved
- Phased Approach - Database → Domain → Services → API → Frontend
- Validation Checkpoints - Concrete tests for each phase
- Migration Strategy - Data migration and parallel running approach
Each documented item is tagged:
| Tag | Meaning | Action |
|---|---|---|
| MUST | Essential for comparable functionality | Implement exactly |
| SHOULD | Valuable but implementation-flexible | Preserve intent |
| DON'T | Tech-stack specific | Omit from rebuild |
MIT