---
name: write-codebase-wiki-prompt
description: "A prompt that writes a wiki for a codebase: each module, how requests flow, and how to extend a module, with a file named on every claim. Use when the user wants a WIKI.md, wiki pages for modules, or docs on how to extend the code."
license: CC0-1.0
metadata:
  category: writing-prompts
  tags: "writing,docs"
  author: johnny-bravo
  version: "1.0"
  updated: "2026-11-12"
  status: published
  aliases: "codebase wiki, WIKI.md, module docs"
  source_url: "https://github.com/f/prompts.chat/blob/b09880e229d2f091ffa2254bc187532fb8980f9b/prompts.csv"
  source_license: CC0-1.0
  copyright: "Public domain (CC0 1.0) - prompt contributed to prompts.chat by s-celles"
  original_author: "s-celles (prompts.chat, 'Codebase WIKI Documentation Skill')"
  modified: "Adapted by TheSkillVault: kept wiki sections for modules, request flow and how to extend, dropped the required language-server setup, added a cite-a-file rule, steps and done-when. Queue name document-codebase-wiki-prompt; document is not a house verb."
  imported_on: "2026-11-12"
---

# Write a codebase wiki (prompt)

This prompt writes wiki pages for a codebase you can point at. It is not a short README and not a design doc for a system that does not exist yet.

## When to use
- You want a WIKI.md for a repo.
- You need wiki pages for the modules.
- Someone asked how to extend the code.

## When not to use
- You need a README with a quick start. Use write-readme-prompt.
- You only need a map before a small edit. Use research-repo-onboarding-prompt.

## Steps
1. Paste a directory tree, or the paths of the main files. Skip dependency folders.
2. Paste the entry file and one or two modules. Remove secrets first.
3. Say which module a new teammate would extend.
4. Read the wiki. Drop any claim that names no file.

## Prompt
```text
Write a wiki for this codebase. Use only the files and tree I paste.

TREE AND FILES:
{{TREE AND FILES}}

MODULE TO EXTEND:
{{MODULE}}

Write these sections:

# Project overview
What the code does, in a few sentences. Name the stack only if a file shows it.

# Modules
One short subsection per main module. Say what it owns. Name the file.

# Request flow
How a request, job or command moves through the modules. Name the files in order. If you cannot see the path, write "unknown".

# How to extend
Steps to add a feature in {{MODULE}}. Each step names the file to open.

# Config
Settings a developer must set. If none are in the files, write "none shown".

Rules:
- Every claim names a file path, or says "unknown".
- Do not invent APIs, tables or folders.
- Skip dependency folders such as node_modules, vendor, .git, dist and build.
- A language server is optional. Pasted files are enough.
- One diagram is fine. A short numbered list is also fine.
```

## How to adapt
- A huge repo? Ask for one module's wiki page, not the whole tree.
- You want a page per folder? Ask for one page per top-level folder under the source directory.

## Gotchas
- Do not paste API keys, passwords or private data into a public AI.
- A wiki that cites no files is a guess. Check the paths before you commit it.

## Portability
Works with any AI chat and any language. No tool lock-in.

## Done when
- Modules, a request flow and how to extend are all present.
- Every claim names a file or says unknown.

## Example prompt
"Write a WIKI.md for this codebase: modules, how requests flow, and how to extend the billing module."

---
Adapted from the "Codebase WIKI Documentation Skill" prompt by s-celles on prompts.chat (CC0 1.0, public domain).
