agentleFS
CodePhobiiaCodePhobiia/claude-roblox-game-studio/.claude/skills/reverse-document/SKILL.md

reverse-document

Skill9 starsChanged 7 months agoMITView on GitHub

Generate design docs from existing code. Reverse-engineer GDDs from implementation when a project has code but no design docs.

16 other projects use a version of this.

Adopted by

Most recently taken up by

The file

We split this skill into the rules it gives an agent

5 rules. 0 are common, 1 is distinctive, and 4 are very specific to this project.

  • 0

    Common

    Most of the 15 edited versions we read keep these.

  • 1

    Distinctive

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Ask them to fill in sections marked [NEEDS USER INPUT]

    line 79
  2. Very specific:

    Ask them to correct any [INFERRED FROM CODE] that are wrong

    line 80
  3. Distinctive:

    Look for discrepancies (code says X, user says Y — which is authoritative?)

    line 81
  4. Very specific:

    Update or create design/gdd/systems-index.md

    line 86
  5. Very specific:

    Create design/gdd/master-gdd.md if missing (may need user input for vision/pillars)

    line 87

“Common” is measured: kept by at least 6 in 10 of the 15 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

/reverse-document — Reverse Engineering Design Docs

Delegate to: systems-designer (with lead-programmer for code analysis)

Use When

  • Joining a project with no design documentation
  • Code has diverged from original design docs
  • Need to produce docs for handoff or publishing
  • Preparing for /design-review on an unfinished codebase

Steps

1. Scan the Codebase

Identify major systems by:

  • Top-level directories in src/
  • Module names
  • Service files
  • Obvious feature clusters
ls src/ServerScriptService/
ls src/ServerStorage/
ls src/ReplicatedStorage/

2. For Each System, Extract Info

Purpose (from code inspection)

  • Module comments (if any)
  • File names
  • Public function names
  • Type definitions

Data Schema

  • Find DataStore keys
  • Find config tables
  • Find Attribute usage
  • Find persistent state
grep -rn "DataStore\|Attribute\|ValueObject" src/

Remotes

  • Find RemoteEvents / RemoteFunctions created
  • Find FireServer / FireClient / InvokeServer / InvokeClient
  • Find OnServerEvent / OnClientEvent handlers
grep -rn "RemoteEvent\|RemoteFunction\|OnServerEvent\|OnClientEvent" src/

Client-Server Split

  • What files are in ServerScriptService vs. StarterPlayer?
  • What's shared via ReplicatedStorage?

UI

  • What ScreenGuis exist?
  • What buttons/modals/HUDs?
  • Sketch the structure

Formulas

  • Find numeric operations in gameplay code
  • Extract the math into explicit formulas
  • Flag magic numbers that should be documented

3. Draft a GDD

For each system, generate a draft GDD using the template. Mark sections as:

  • [INFERRED FROM CODE] — extracted from implementation
  • [NEEDS USER INPUT] — couldn't determine from code

4. Present for Review

Show each drafted GDD to the user:

  • Ask them to fill in sections marked [NEEDS USER INPUT]
  • Ask them to correct any [INFERRED FROM CODE] that are wrong
  • Look for discrepancies (code says X, user says Y — which is authoritative?)

5. Save and Link

On approval:

  • Save each GDD to design/gdd/<system>-gdd.md
  • Update or create design/gdd/systems-index.md
  • Create design/gdd/master-gdd.md if missing (may need user input for vision/pillars)

6. Flag Discrepancies

Note anywhere the code doesn't match what the user says the design should be:

  • "Code implements X, but you said the design is Y — should we update the code or the design?"
  • Log these in production/decision-log.md

Output

# Reverse Documentation Results

## Systems Found
1. [System A] — GDD draft saved
2. [System B] — GDD draft needs user input for [sections]

## Discrepancies Found
1. [System X] — Code does Y, but that's not documented anywhere. Intentional?

## Missing Systems (code without doc)
1. [Module] — unclear what this is. User clarification needed.

## Docs Without Code (if master-gdd exists)
- [Planned system] — no code yet

## Recommendations
1. [Action item]

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.