name: doc-gen description: > Generate and maintain project documentation — README files, CLAUDE.md guides, docs/ architecture guides, Playwright screenshots, and ASCII/Mermaid diagrams for the AllOnFire monorepo. Use when asked to "generate docs", "create README", "update documentation", "refresh screenshots", "audit docs", "document this feature", "add docs", or "doc-gen".
Doc-Gen Skill
Generate and maintain documentation for the AllOnFire monorepo. Read references/doc-standards.md before generating any documentation — it contains all visual rules, templates, and preferences learned from past sessions.
Prerequisites
- Target app running for screenshot capture: Social on
:3100, Laura on:3200 - Playwright MCP tools available for browser automation
- Read references/doc-standards.md for visual formatting rules
- Read references/doc-map.md for the full inventory of documentation targets
Scope Argument
| Scope | What it does |
|---|---|
audit |
Scan and report which docs are missing/stale (default, dry-run) |
root |
Generate root README.md |
packages |
Generate README.md for each package missing one |
features |
Generate README.md + CLAUDE.md for each feature |
screenshots |
Capture Playwright screenshots of all app pages |
diagrams |
Generate architecture diagrams and docs/ guides |
memory |
Update .claude memory files |
all |
Execute all phases in priority order |
If no scope is provided, default to audit.
Critical Style Rules
These were learned from user feedback and MUST be followed:
Structure
<h1 align="center">for all README page titles — NOT<h3>, NOT markdown#- Exception: root README uses
<h3>to avoid GitHub h1 underline - Centered header block — title + badges + description all in
<p align="center"> - Left-aligned section headings — standard markdown
##with emoji prefix - Consistent layout — every README follows the same header → screenshots → sections pattern
Badges
- Always HTML
<img>tags inside<p align="center">— NEVER markdown![]() - Default
flatstyle — neverflat-square - Root badges = monorepo stack only — pnpm, Turborepo, TypeScript, Biome, Node
- App/feature/package badges = their specific stack
Screenshots
- 2-column grid — desktop + mobile side by side in ONE
<p>, never separate blocks - Feature READMEs: desktop
600, mobile200 - App README gallery: desktop
550, mobile180 - Hide Next.js dev tools before every screenshot capture (see doc-standards.md for the JS snippet)
- Path depth matters — features are 5 levels deep (
../../../../../docs/screenshots/)
Content
- No box-drawing characters — use plain
──>,+--,|only - Plain indentation for directory trees — NOT
├──and└── - Actual Unicode emoji — 📸 not
:camera_flash:, 📁 not:file_folder: - Brief descriptions between heading and content
- Root README is generic — describes monorepo, NOT specific apps
Files & Assets
.pngfor logos in READMEs (better preview than.svg)docs/assets/for logos/icons copied from apppublic/folders/screenshots/in gitignore (root-only slash) — NOTscreenshots/which blocksdocs/screenshots/- No sensitive infra details — no machine types, IPs, SSH info
- LICENSE (MIT) at repo root
Workflow
Phase 0: Consistency Audit (Regression Detection)
Always run this before any generation. Detects drift between docs and code.
Route drift — Glob all
page.tsxfiles under each app'sapp/directory. Compare against routes listed in the app's README. Flag: added routes not in README, removed routes still in README.Environment variable drift — Parse
env.tsfiles (app-level + package-levelextends). Compare against env vars table in README. Flag: new vars not documented, removed vars still listed.Screenshot path validation — Parse every
<img src="..."in all READMEs. Verify the referenced file exists on disk. Flag: broken image references.Feature directory sync — List actual feature directories under each app's
src/features/. Compare against documented features in doc-map. Flag: new features without docs, removed features with stale docs.Package export audit — Read each package's
src/index.tsexports. Compare against API Reference table in package README. Flag: new exports not documented, removed exports still listed.Badge version check — Parse
package.jsonfor each app/package. Compare major versions against badge values in README. Flag: version mismatches (e.g., badge says React 18 but package.json has React 19).
Output: Status table with pass/warn/fail for each check, grouped by app/package.
Phase 1: Audit Existing Documentation
Always run this first, regardless of scope.
- Scan for all
README.md,CLAUDE.md, anddocs/directories - Compare against references/doc-map.md
- Report a status table
- If scope is
audit, stop here
Phase 2: Screenshots (scope: screenshots)
Save to docs/screenshots/ (NOT /screenshots/ which is gitignored).
For each page: browser_resize → browser_navigate → hide dev tools (see snippet in doc-standards.md) → browser_take_screenshot.
Social App (port 3100)
Desktop (1440x900): dashboard, discover, generate, publish-compose, admin-users, admin-providers, settings. Mobile (390x844): mobile-dashboard, mobile-discover, mobile-generate, mobile-publish, mobile-admin, mobile-settings.
Laura App (port 3200)
Desktop (1440x900): laura-gallery, laura-upload, laura-games, laura-memory, laura-quiz, laura-settings. Mobile (390x844): mobile-laura-gallery, mobile-laura-upload, mobile-laura-games, mobile-laura-memory, mobile-laura-quiz, mobile-laura-settings.
Laura-specific: Wait for Framer Motion animations to settle (2s delay) before capture. Laura uses Italian locale by default — screenshots show /en routes for English.
Phase 3: Root README (scope: root)
Follow the structure in references/doc-standards.md Section 6 exactly:
- Logo (centered, 80px) from
docs/assets/ - Title as
<h3 align="center">— no tagline <br />spacer- Root badges (monorepo stack only)
---divider- About section (1-2 generic sentences about the monorepo)
- Apps section — each app vertical: logo → title → app-specific badges → description → docs link
---divider- Packages — emoji table with brief description above
- Project Structure — badges for infra tech + description + plain-indentation folder tree
- Infrastructure — emoji table with brief description above. No sensitive details.
---divider- Footer — centered casual sign-off
Phase 4: Package READMEs (scope: packages)
Use the template in references/doc-standards.md Section 8.
Read the package's src/index.ts to discover the API surface. Read consuming files in apps/social/ for usage examples.
Phase 5: Feature Documentation (scope: features)
Use sidebar-layout/ as the template — read both its README.md and CLAUDE.md, then replicate that structure.
Templates in references/doc-standards.md Sections 9 and 10.
Important: Read every file in the feature directory before writing. Document what actually exists.
Phase 6: Docs Guides (scope: diagrams)
Create numbered guides in docs/:
| File | Content |
|---|---|
docs/00-overview.md |
Project goals, links to all docs |
docs/01-architecture.md |
System architecture diagrams, data flow, package dependencies |
docs/02-database.md |
Prisma schema reference, ER diagram (Mermaid), service API |
docs/03-deployment.md |
Deployment setup (no sensitive details) |
docs/04-development.md |
Local setup, prerequisites, env vars, testing, linting |
Phase 7: Memory Update (scope: memory)
- Update
project_structure.mdif feature names have changed - Add
project_documentation.mddescribing where docs live - Update
MEMORY.mdindex
Phase 8: Full Run (scope: all)
Execute phases 1-7 in priority order. Present audit first, ask for confirmation.
Rules
- Read before writing — always read actual source code before generating docs
- Conservative updates — only modify sections with actual discrepancies
- No bloat — no extra comments or explanations beyond the template
- Match style — follow references/doc-standards.md exactly
- No speculation — do not document planned features
- sidebar-layout is the template — all feature docs match its structure