Skip to content
Back to skills

Reverse Document

BSecurity

Generate design or architecture documents from existing implementation. Works backwards from code/prototypes to create missing planning docs.

  • 3 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added November 14, 2026
designgobashperformancedocumentation

Works with

  • cli

Security analysis

B75/100
  • criticalImpersonates system messages to override safety constraints

Pro shows the line behind each finding and how to fix it

Scanned November 14, 2026

npx -y skills add SebastianLuser/claude-code-arcane --skill reverse-document --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Reverse Document?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Reverse Document
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/sebastianluser-reverse-document/badge)](https://www.skillsdirectory.com/skills/sebastianluser-reverse-document)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: reverse-document
description: "Generate design or architecture documents from existing implementation. Works backwards from code/prototypes to create missing planning docs."
category: "documentation"
argument-hint: "<type> <path> (e.g., 'design src/gameplay/combat' or 'architecture src/core')"
user-invocable: true
allowed-tools: Read, Glob, Grep, Write, Edit, Bash
---

# Reverse Documentation

Analyzes existing implementation and generates design/architecture documentation. Use when: built without design doc, inherited undocumented codebase, prototyped and need to formalize, need to document "why" behind code.

## Phase 1: Parse Arguments

Format: `/reverse-document <type> <path>`

| Type | Output | Template |
|------|--------|----------|
| `design` | GDD section | `design/gdd/[system].md` |
| `architecture` | ADR | `docs/architecture/[decision].md` |
| `concept` | Concept doc from prototype | `design/concepts/[name].md` |

Path: directory or file to analyze.

## Phase 2: Analyze Implementation

**Design docs:** mechanics, rules, formulas, gameplay values, state machines, edge cases, system dependencies.

**Architecture docs:** patterns (ECS, singleton, observer), technical decisions (threading, serialization), dependencies/coupling, performance characteristics, constraints/trade-offs.

**Concept docs:** core mechanic, emergent gameplay patterns, what worked/didn't, technical feasibility, player fantasy/feel.

## Phase 3: Ask Clarifying Questions

**Never assume intent.** Ask about "why", not just "what":
- Design: resource system intent (pacing vs strategic depth?), mechanic priority (core pillar or supporting?), value scaling (intentional or needs rebalancing?)
- Architecture: pattern choice motivation (testability, decoupling, legacy?), performance decisions
- Concept: intended pillar emphasis, emergent behaviors (feature or bug?)

## Phase 4: Present Findings

Show discovered mechanics/patterns/formulas + unclear intent areas. Wait for user clarification before drafting.

## Phase 5: Draft Document

| Analyzing... | Use template |
|-------------|-------------|
| `src/gameplay/*` | `.claude/docs/templates/design-doc-from-implementation.md` |
| `src/core/*`, `src/ai/*`, `src/networking/*` | `.claude/docs/templates/architecture-doc-from-code.md` |
| `prototypes/*` | `.claude/skills/_templates/concept-doc-from-prototype.md` (game profiles only; otherwise follow Phase 2's concept list) |
| `src/ui/*` | `.claude/docs/templates/design-doc-from-implementation.md` |

Capture: what exists (mechanics/patterns), why it exists (clarified intent), what's missing (gaps/edge cases), follow-up work (tuning, missing features).

## Phase 6: Show Draft and Request Approval

Show key sections + additions made + sections marked incomplete. "May I write this to [filepath]?" Wait for approval. On approval: Verdict: **COMPLETE**. On decline: Verdict: **BLOCKED**.

## Phase 7: Write with Metadata

Frontmatter: `status: reverse-documented`, `source: [path]`, `date: [today]`, `verified-by: [user]`. Note at top: "Reverse-engineered from existing implementation."

## Phase 8: Flag Follow-Up

Suggest related work: balance checks, ADRs for decisions, missing edge cases, design doc extensions. Don't auto-execute.

## Protocol

1. Analyze first → 2. Question intent → 3. Present findings → 4. User clarifies → 5. Draft → 6. Show + get approval → 7. Write → 8. Flag follow-up. **Never assume intent. Always ask before documenting "why".**

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in design →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.