A 3-prompt workflow for generating comprehensive documentation, running a codebase audit, and updating AI context files across a multi-repo project.
See it in action — two example outputs generated with these prompts: Sample Audit Report · Sample Documentation · overview page
gh) — Install and authenticate with gh auth logingh) must have read access to every repo you want in scopemkdir ~/projects/my-platform && cd ~/projects/my-platform
Use gh to clone every repo from your org/user:
# Clone all repos from an org
gh repo list <org-name> --limit 200 --json nameWithOwner -q '.[].nameWithOwner' | while read -r repo; do
gh repo clone "$repo"
done
Tip: If you only need a subset, clone them individually:
gh repo clone <org>/repo-a gh repo clone <org>/repo-b
Make sure every repo is on its main/master branch and recently pulled.
Create a new, empty repo to hold all cross-repo documentation and audit output:
gh repo create <org>/documentation --private --clone
This documentation repo is where all generated docs, audit reports, and architecture diagrams will live.
Run the prompts in order — each one builds on the output of the previous.
| Step | Prompt | What It Does |
|---|---|---|
| 1 | prompt-documentation.md | Scans all repos, generates platform docs in the documentation repo |
| 2 | prompt-audit.md | Reads generated docs + source code, produces audit reports in documentation/audit/ |
| 3 | prompt-context-update.md | Uses docs + audit to update .cursorrules and CLAUDE.md in each repo |
prompt-documentation.md → let it completeprompt-audit.md → let it completeprompt-context-update.md → let it completeAfter running all three prompts, your documentation repo will look like this:
documentation/
├── architecture/
│ └── architecture_current.jpg # System architecture diagram
├── audit/
│ ├── executive-summary-action-plan.md
│ ├── security-audit.md
│ ├── code-quality-architecture.md
│ ├── performance-audit.md
│ ├── error-documentation.md
│ ├── third-party-integrations.md
│ ├── infrastructure-ci-cd.md
│ ├── testing-coverage.md
│ └── documentation-audit.md
├── operations/
│ ├── technical-architecture-api-reference.md
│ ├── database-schema-documentation.md
│ ├── aws-operations-runbook.md
│ └── background-jobs-task-guide.md
├── CLAUDE.md
├── README.md # Platform overview with repo table
└── handover-checklist.md
Here’s an example of what a completed documentation repo looks like on GitHub:

After documentation is generated, ask your AI session to create an architecture diagram prompt. For example:
“Based on the documentation you just generated, write me a prompt I can paste into Google Gemini (with image generation) to create a visual system architecture diagram showing all services, databases, external integrations, and how they connect.”
This produces a detailed prompt you can use with Gemini to generate a diagram like this:

Save the generated diagram as architecture/architecture_current.jpg in your documentation repo.