reverse-document
Skill5 starsChanged 4 months agoMITView on GitHub
Use when existing implementation needs a design or architecture document reconstructed from evidence.
We split this skill into the rules it gives an agent
17 rules. 8 are common, 7 are distinctive, and 2 are very specific to this project.
8
Common
Most of the 14 edited versions we read keep these.
7
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 9
Before default delegation, run python3 ../../../tools/codex_studio/agent_delegation.py resolve --project-root <project-root> --role <role> …
- Distinctive: line 13
Ask one decision question per turn and wait for the answer before asking another.
- Very specific: line 14
Use request_user_input for structured choices when it is available.
- Distinctive: line 15
Use Codex custom agents by role and profile when delegation is useful.
- Distinctive: line 16
Treat any approved write as one complete proposed changeset.
- Common: line 80
Document player fantasy / feel
- Distinctive: line 84
Do not merely describe the code.
- Distinctive: line 86
Ask the first unresolved intent question and wait for the answer.
- Common: line 90
Before drafting, show what you discovered:
- Distinctive: line 113
Wait for the answer, update the queue, and return to Phase 3 for the next single question before drafting.
- Common: line 127
Document why it exists (intent clarified with user)
- Distinctive: line 151
Wait for approval. User may request changes before writing.
- Common: line 155
When approved, write the file with special markers:
- Common: line 176
After writing, suggest next steps:
- Common: line 232
Analyze First: Read code, understand implementation
- Common: line 233
Question Intent: Ask about "why", not just "what"
- Common: line 236
Draft Document: Create doc based on reality + intent
“Common” is measured: kept by at least 6 in 10 of the 14 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.
Files
<!-- codex-studio-delegation: governed -->Resolve every role through ../../../.codex/docs/plugin-agent-delegation.md;
do not require a repository-local .codex/agents/ or .codex/agent-packs/ tree.
Before default delegation, run python3 ../../../tools/codex_studio/agent_delegation.py resolve --project-root <project-root> --role <role> and use only its returned role contract.
Codex Interaction Contract
- Ask one decision question per turn and wait for the answer before asking another.
- Use
request_user_inputfor structured choices when it is available; otherwise ask the same concise question directly. - Use Codex custom agents by role and profile when delegation is useful.
- Treat any approved write as one complete proposed changeset. Before writing, present every target path and material edit together; do not add unlisted files or behavior.
- A new path, expanded scope, or material change requires a revised complete proposed changeset and fresh approval.
Documentation Changeset Boundary
Analyze read-only, then show the evidence summary and artifact outline before drafting. Present the draft and complete proposed changeset before writing the selected document path.
Reverse Documentation
This skill analyzes existing implementation (code, prototypes, systems) and generates appropriate design or architecture documentation. Use this when:
- You built a feature without writing a design doc first
- You inherited a codebase without documentation
- You prototyped a mechanic and need to formalize it
- You need to document "why" behind existing code
Workflow
Phase 1: Parse Arguments
Format: $reverse-document <type> <path>
Type options:
design→ Generate a game design document (GDD section)architecture→ Generate an Architecture Decision Record (ADR)concept→ Generate a concept document from prototype
Path: Directory or file to analyze
src/gameplay/combat/→ All combat-related codesrc/core/event-system.cpp→ Specific fileprototypes/stealth-mech/→ Prototype directory
Examples:
$reverse-document design src/gameplay/magic-system
$reverse-document architecture src/core/entity-component
$reverse-document concept prototypes/vehicle-combatPhase 2: Analyze Implementation
Read and understand the code/prototype:
For design docs (GDD):
- Identify mechanics, rules, formulas
- Extract gameplay values (damage, cooldowns, ranges)
- Find state machines, ability systems, progression
- Detect edge cases handled in code
- Map dependencies (what systems interact?)
For architecture docs (ADR):
- Identify patterns (ECS, singleton, observer, etc.)
- Understand technical decisions (threading, serialization, etc.)
- Map dependencies and coupling
- Assess performance characteristics
- Find constraints and trade-offs
For concept docs (prototype analysis):
- Identify core mechanic
- Extract emergent gameplay patterns
- Note what worked vs what didn't
- Find technical feasibility insights
- Document player fantasy / feel
Phase 3: Ask Clarifying Questions
Do not merely describe the code; identify unresolved intent such as resource purpose, pillar status, scaling intent, architecture trade-offs, or emergent prototype behavior.
Ask the first unresolved intent question and wait for the answer. Record that answer. Then ask the next unresolved intent question and wait again. Continue sequentially until every material uncertainty is resolved or explicitly marked unknown. Never batch multiple intent decisions into one prompt.
Phase 4: Present Findings
Before drafting, show what you discovered:
I've analyzed [path]/. Here's what I found:
MECHANICS IMPLEMENTED:
- [mechanic-a] with [property] (e.g. timing windows, cooldowns)
- [mechanic-b] (e.g. interaction between two states)
- [resource] system (depletes on [action], regens on [condition])
- [state] system (builds up, triggers [effect])
FORMULAS DISCOVERED:
- [Output] = [formula using discovered variables]
- [Secondary output] = [formula]
UNRESOLVED INTENT QUEUE:
- [Resource] system purpose
- [Mechanic] pillar status
- [Value] scaling intent
Next question (one only): [first unresolved intent question]Wait for the answer, update the queue, and return to Phase 3 for the next single question before drafting.
Phase 5: Draft Document Using Template
Based on type, use appropriate template:
| Type | Template | Output Path |
design | ../../../.codex/docs/templates/design-doc-from-implementation.md | design/gdd/[system-name].md |
architecture | ../../../.codex/docs/templates/architecture-doc-from-code.md | docs/architecture/[decision-name].md |
concept | ../../../.codex/docs/templates/concept-doc-from-prototype.md | prototypes/[name]/CONCEPT.md or design/concepts/[name].md |
Draft structure:
- Capture what exists (mechanics, patterns, implementation)
- Document why it exists (intent clarified with user)
- Identify what's missing (edge cases not handled, gaps in design)
- Flag follow-up work (balance tuning, missing features)
Phase 6: Show Draft and Request Approval
Collaborative protocol:
I've drafted the [system-name] design doc based on your code and clarifications.
[Show key sections: Overview, Mechanics, Formulas, Design Intent]
ADDITIONS I MADE:
- Documented [mechanic] as "[intent]" per your clarification
- Added edge cases not in code (e.g., what if [resource] hits 0 mid-[action]?)
- Flagged balance concern: [scaling type] scaling at [boundary condition]
SECTIONS MARKED AS INCOMPLETE:
- "[System] interaction with [other-system]" (not fully implemented yet)
- "[Variant or feature]" (only [subset] implemented so far)
Proposed complete changeset: `design/gdd/[system-name].md`. Approve this draft and exact path?Wait for approval. User may request changes before writing.
Phase 7: Write Document with Metadata
When approved, write the file with special markers:
---
status: reverse-documented
source: [path/]
date: [today]
verified-by: [User name]
---
# [System Name] Design
> **Note**: This document was reverse-engineered from the existing implementation.
> It captures current behavior and clarified design intent. Some sections may be
> incomplete where implementation is partial or intent was unclear.
[Rest of document...]Phase 8: Flag Follow-Up Work
After writing, suggest next steps:
✅ Written to design/gdd/combat-system.md
FOLLOW-UP RECOMMENDED:
1. Run $balance-check on combat formulas (exponential scaling concern)
2. Create ADR for stamina system architecture decision
3. Implement missing edge cases:
- Stamina depletion mid-combo behavior
- Stagger state during dodge
4. Extend design doc when weapon variety is implemented
Next decision (one only): Should I prepare the `$balance-check` handoff first?Template Selection Logic
| If analyzing... | Use template... | Because... |
src/gameplay/* | ../../../.codex/docs/templates/design-doc-from-implementation.md | Gameplay mechanics → GDD |
src/core/*, src/ai/* | ../../../.codex/docs/templates/architecture-doc-from-code.md | Core systems → ADR |
prototypes/* | ../../../.codex/docs/templates/concept-doc-from-prototype.md | Experiments → concept doc |
src/networking/* | ../../../.codex/docs/templates/architecture-doc-from-code.md | Technical systems → ADR |
src/ui/* | ../../../.codex/docs/templates/design-doc-from-implementation.md | UI/UX → design spec |
Example Session: Sequential Intent Clarification
User: $reverse-document design src/gameplay/[system]
Agent: I found three unresolved intent areas. First question: Is the resource system primarily for pacing or strategic management?
User: Pacing; it should prevent repeated high-power actions.
Agent: Recorded. Next question: Is the central mechanic a core pillar or a supporting feature?
User: Core pillar.
Agent: Recorded. Next question: Should the current exponential scaling remain, or should the document mark it for tuning?
User: Mark it for linear tuning.
Agent: All material intent questions are resolved. Here is the draft and its one complete proposed changeset.Collaborative Protocol
This skill follows the collaborative design principle:
- Analyze First: Read code, understand implementation
- Question Intent: Ask about "why", not just "what"
- Present Findings: Show discoveries, highlight unclear areas
- User Clarifies: Separate intent from accidents
- Draft Document: Create doc based on reality + intent
- Show Draft: Display key sections, explain additions
- Get Approval: Present
[filepath]and the full draft as one complete proposed changeset. On approval: Verdict: COMPLETE — document generated. On decline: Verdict: BLOCKED — user declined write. - Flag Follow-Up: Suggest related work, don't auto-execute
Never assume intent. Always ask before documenting "why".
Other versions15 projects use a version of this.
Word for word · 0
None found.
Edited · 11
- Donchitos/Claude-Code-Game-Studios★ 27k29% same
- striderZA/OpenCodeGameStudios★ 9361% same
- tranhieutt/software_development_department★ 7137% same
- CoralGame/Claude-Code-Game-Studios★ 1948% same
- dawn840705/codex-code-studios★ 1763% same
- lilangMax/ClaudeCodeGameStudios★ 861% same
- SebastianLuser/claude-code-arcane★ 211% same
- dawn840705/claude-code-studios★ 161% same
- HunLuanZhiZhu/Game-Studios-Plugin★ 161% same
- scotidev/GameDevStudio★ 148% same
1 more not listed
Wrote their own version · 4
- pixel-cellar/Claude-Code-Game-Studios★ 324same name
- cenconq25/claude-code-app-studio★ 40same name
- CodePhobiia/claude-roblox-game-studio★ 9same name
- timjrobinson/Claude-Code-Construction-Manager★ 4same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository76 other files it gives its agents.
- AGENTS.mdAGENTS.md
- Codex Studio Testing Framework/AGENTS.mdAGENTS.md
- prototypes/AGENTS.mdAGENTS.md
- tests/AGENTS.mdAGENTS.md
- adoptSkill
- architecture-decisionSkill
- architecture-reviewSkill
- art-bibleSkill
- asset-auditSkill
- asset-specSkill
- balance-checkSkill
- brainstormSkill
- bug-reportSkill
- bug-triageSkill
- changelogSkill
- code-reviewSkill
- consistency-checkSkill
- content-auditSkill
- create-architectureSkill
- create-control-manifestSkill
- create-epicsSkill
- create-storiesSkill
- day-one-patchSkill
- design-reviewSkill
- design-systemSkill
- dev-storySkill
- estimateSkill
- gate-checkSkill
- helpSkill
- hotfixSkill
- launch-checklistSkill
- localizeSkill
- map-systemsSkill
- milestone-reviewSkill
- onboardSkill
- patch-notesSkill
- perf-profileSkill
- playtest-reportSkill
- project-stage-detectSkill
- propagate-design-changeSkill
- prototypeSkill
- qa-planSkill
- quick-designSkill
- regression-suiteSkill
- release-checklistSkill
- retrospectiveSkill
- review-all-gddsSkill
- scope-checkSkill
- security-auditSkill
- setup-engineSkill
- skill-improveSkill
- skill-testSkill
- smoke-checkSkill
- soak-testSkill
- sprint-planSkill
- sprint-statusSkill
- startSkill
- story-doneSkill
- story-readinessSkill
- team-audioSkill
- The first 60 shown.
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
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.

