원클릭으로
exporting-conversation
// Synthesizes raw wizard session JSON into structured documentation. Use when the user runs /codebase-wizard-export, says "export session", "generate docs", "create CODEBASE.md", or "turn the session into docs".
// Synthesizes raw wizard session JSON into structured documentation. Use when the user runs /codebase-wizard-export, says "export session", "generate docs", "create CODEBASE.md", or "turn the session into docs".
| name | exporting-conversation |
| description | Synthesizes raw wizard session JSON into structured documentation. Use when the user runs /codebase-wizard-export, says "export session", "generate docs", "create CODEBASE.md", or "turn the session into docs". |
| version | 1.0.0 |
Synthesizes one or more raw session JSON files into structured documentation.
--latest (default) | --session <filename> | --all
--latest — synthesize the most recent session file in {resolved_storage}/sessions/--session <filename> — synthesize a specific session file by name--all — synthesize every session file independently; each gets its own output directoryFind config.json by checking both storage locations in order:
.code-wizard/config.json.claude/code-wizard/config.jsonRead resolved_storage from the config. If neither file exists, tell the user:
"No wizard storage found. Run /codebase-wizard-setup first."
--latest: list files in {resolved_storage}/sessions/, sort by name (ISO date prefix),
take the most recent.--session <filename>: read {resolved_storage}/sessions/<filename> directly.--all: collect all .json files in {resolved_storage}/sessions/.If no session files exist:
"No sessions found in {resolved_storage}/sessions/. Run /codebase-wizard to start a session first."
For each selected session file, read and parse the JSON. Expected schema:
{
"version": 1,
"session_id": "YYYY-MM-DD-{repo}",
"repo": "...",
"artifact": "...",
"mode": "describe | explore | file",
"created": "...",
"turns": [
{
"ts": "...",
"question": "...",
"anchor": "...",
"code_shown": "...",
"explanation": "...",
"connections": { "calls": [], "called_by": [] },
"next_options": []
}
]
}
If version field is missing or higher than 1, warn:
"Session file uses an unrecognized version. Attempting synthesis anyway — some fields may be missing."
Output directory: {resolved_storage}/docs/{session_id}/
Create the directory if it does not exist.
Format each turn as:
## Q: {question}
*{ts}*
// {anchor}
{code_shown}
{explanation}
→ calls: {connections.calls joined with newlines}
→ called by: {connections.called_by joined with newlines}
**Next options explored:**
1. {next_options[0]}
2. {next_options[1]}
3. {next_options[2]}
---
Omit connections block if both calls and called_by are empty.
Omit next options block if next_options is empty.
mode == "describe")# Codebase: {repo}
## Overview
## Entry Points
## Auth
## Data Layer
## Key Concepts
## Traced Call Chains
## Constraints
## Open Questions
Each section extracted from the relevant turns.
mode == "explore")# Tour: {repo}
## What the App Does
## Entry Point
## Auth Flow
## Data Flow
## Where to Start
## Q&A Detours
mode == "file")One section per turn, with anchor and code block preserved.
"Export complete. Files written to {resolved_storage}/docs/{session_id}/:"
- SESSION-TRANSCRIPT.md
- CODEBASE.md (if describe mode)
- TOUR.md (if explore mode)
- FILE-NOTES.md (if file mode)
One-time setup for the Codebase Wizard. Use when the user runs /codebase-wizard-setup, says "set up the wizard", "install wizard", or "configure codebase wizard". Installs Agent Rulez hooks, creates storage directories, writes config.json, and sets scoped write permissions.
Universal explainer for codebases, specs, design docs, and markdown files. Activates when a user wants to understand how their code works, explore a new codebase, document an existing one, or get walked through any markdown artifact (specs, roadmaps, design docs, milestone plans). Trigger on: "explain this codebase", "walk me through this", "describe this code", "I'm new to this repo", "how does X work", "what calls this", "where does this get used", "explain this spec", "walk me through this roadmap", "what does this milestone mean", "explain this design doc", "--describe", "--explore", "--file <path>". Also triggers when user pastes code or a markdown file and asks questions about it — treat as a micro-artifact. Produces (written to {resolved_storage}/docs/{session_id}/): - SESSION-TRANSCRIPT.md (all modes — always generated) - CODEBASE.md (describe mode) - TOUR.md (explore mode) - FILE-NOTES.md (file mode)
Universal explainer for codebases, specs, design docs, and markdown files. Activates when a user wants to understand how their code works, explore a new codebase, document an existing one, or get walked through any markdown artifact (specs, roadmaps, design docs, milestone plans). Trigger on: "explain this codebase", "walk me through this", "describe this code", "I'm new to this repo", "how does X work", "what calls this", "where does this get used", "explain this spec", "walk me through this roadmap", "what does this milestone mean", "explain this design doc", "--describe", "--explore", "--file <path>". Also triggers when user pastes code or a markdown file and asks questions about it — treat as a micro-artifact. Produces (written to {resolved_storage}/docs/{session_id}/): - SESSION-TRANSCRIPT.md (all modes — always generated) - CODEBASE.md (describe mode) - TOUR.md (explore mode) - FILE-NOTES.md (file mode)