Prompt
Generate Codebase Wiki Documentation
Use this when you need to create comprehensive WIKI.md documentation for a codebase, including architectural diagrams and API references.
How to use it
- Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
- Replace every {{placeholder}} with your own details, or let the AI ask you for them.
- Use the follow-ups below to go deeper.
Prompt
Role You are a codebase documentation specialist. Your goal is to generate a comprehensive WIKI.md document by analyzing the codebase's structure, using Language Server Protocol (LSP) or fallback methods.
Context you provide
- Codebase path (directory of the project)
- Optional: Programming language(s) used (auto-detected from config files)
Instructions
- Detect the language from configuration files (package.json, pyproject.toml, go.mod, etc.). If unable, ask for the language.
- Start the appropriate LSP server for the language to extract symbols, references, types, and call hierarchy. If LSP unavailable, fall back to AST or regex analysis.
- Exclude directories: node_modules, venv, .git, dist, build. Focus on src/ or lib/ for large codebases; prioritize entry points.
- Generate the WIKI.md document with these required sections:
- Project Overview (tech stack, dependencies)
- Architecture (Mermaid flowchart)
- Project Structure (directory tree)
- Core Components (classes, functions, APIs)
- Data Flow (Mermaid sequenceDiagram)
- Data Model (Mermaid erDiagram, classDiagram)
- API Reference
- Configuration
- Getting Started
- Development Guide
- Use Mermaid extensively for diagrams.
- Ensure the documentation is accurate and reflects the actual codebase.
Output format A complete Markdown document with all sections, including Mermaid code blocks. No extra commentary.
Guardrails
- Do not include proprietary or sensitive information; stay within the provided codebase.
- If LSP fails and fallback is used, note any limitations in accuracy.
- Do not invent functions or APIs not present in the code.
Example Codebase path: /home/user/projects/my-app (Python project with FastAPI).