Vuexy Next.js — Codebase Documentation and SKILL.md Strategy
A method for using Claude Code to systematically document any large template codebase and produce a persistent context file (SKILL.md) that Claude can load before every development task.
Why / When to Use
When you have a large, complex template codebase (e.g. Vuexy Next.js) and want Claude Code to work inside it confidently — reusing existing components rather than reinventing them, following codebase conventions, and knowing where everything lives.
Core Concept
Run Claude Code through a 4-phase analysis that produces 12 documentation files in claude-docs/. The final file — SKILL.md — is a dense, verified context anchor Claude loads at the start of every session.
Phase 1 — Codebase Discovery
# Start Claude Code in the Vuexy project root
cd ~/projects/vuexy-next.js
claudeAsk Claude Code to scan:
- Full directory structure and key config files
- Routing strategy (App Router vs Pages Router)
- Where branding/colors/navigation configs live
- Where mock/fake data lives
Phase 2 — Systematic Deep Read
Claude Code reads all source files in this order:
- Config & Setup (
next.config.js,tailwind.config.js, MUI theme) - Layouts — every variant, slots, when each is used
- Navigation — menu config, route→nav mapping
- UI Components — every component with props, variants, usage
- Pages & Routes — every page, data requirements
- Pre-built Apps — Email, Chat, Calendar, Kanban, eCommerce, Invoice
- Data Fetching — SWR/React Query/axios patterns, mock data locations
- Charts — ApexCharts vs Chart.js usage, data shapes
- Authentication — JWT, Auth Guards, login flow, session handling
- ACL — role definitions, permission checks, route and UI restriction patterns
- Forms — form library, validation patterns, reusable form components
- State Management — Redux/Zustand/Context, store structure
- Theming — MUI theme customisation, Tailwind config, dark mode
- Types & Interfaces — key TypeScript types
- Utilities & Hooks — every custom hook and utility
Phase 3 — claude-docs/ File Inventory
| File | Contents |
|---|---|
CODEBASE_MAP.md | Directory tree, tech stack, routing strategy, key config files |
COMPONENTS.md | Every component: location, props, variants, usage example |
LAYOUTS.md | All layout variants, slots, when to use each |
PAGES_AND_APPS.md | Every pre-built page/app: route, data needs, how to adapt |
DATA_AND_CHARTS.md | Fetch patterns, mock data locations, chart components |
AUTH_AND_ACL.md | JWT/Auth Guard/session flow, role definitions, ACL patterns |
THEMING_AND_STYLING.md | MUI theme, Tailwind config, dark mode, design tokens |
FORMS_AND_VALIDATION.md | Form library, validation patterns, reusable form components |
STATE_MANAGEMENT.md | Redux/Zustand/Context usage, store structure |
HOOKS_AND_UTILS.md | Every custom hook and utility with usage examples |
TYPESCRIPT_TYPES.md | Core types/interfaces and where they are used |
SKILL.md | Crown jewel — dense context anchor Claude loads before every task |
Phase 4 — SKILL.md Structure
The SKILL.md contains 21 sections:
- Codebase Identity (one paragraph)
- Absolute Rules (15–20 must-follow conventions)
- Directory Map (compact, one line per folder)
- Layout System (variants, how to apply)
- Navigation & Menu (config file, how to add items)
- Component Reference (table + full entry for top 15–20)
- Page & Route Patterns (new page boilerplate)
- Authentication (login flow, protecting routes, connecting real backend)
- Access Control (roles, permission checks, route restriction)
- Data Fetching (patterns, mock→real swap)
- Charts & Data Visualization (reusable chart components)
- Forms & Validation (standard form pattern, form+API submission)
- State Management (store structure, how to add state)
- Theming & Styling (MUI tokens, dark mode, how to style new components)
- Custom Hooks Reference
- Utility Functions Reference
- TypeScript Types Reference
- Task Playbook (10 most common tasks step-by-step)
- Anti-Patterns (what NOT to do with correct alternatives)
- Quick-Start Checklist
- File Finder
How to Use After Generation
# Every new Claude Code session:
"Read claude-docs/SKILL.md first, then [your task here]"The SKILL.md becomes smarter over time — when Claude finds something undocumented or wrong, update the SKILL.md in place.
Gotchas
- Every file path in SKILL.md must be real and verified from source — never guessed
- Code examples must use actual imports from this codebase, not generic Next.js code
- Run Phase 1 (codebase scan) before Phase 2 (SKILL.md creation) — SKILL.md relies on the 11 prior docs
Source
Conversation: “Next.js template framework contents” — 2026-05-13