Generates and maintains a hierarchical .context/ directory with architecture overviews, coding conventions, domain glossaries, and dependency maps that give any LLM working in the project the right background. Use when setting up a new project for AI-assisted development, when the user asks to create or update context docs, when onboarding a new LLM tool to an existing codebase, or when the user says the AI doesn't understand their project.
Installation
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
Generates and maintains a hierarchical .context/ directory with architecture overviews, coding conventions, domain glossaries, and dependency maps that give any LLM working in the project the right background. Use when setting up a new project for AI-assisted development, when the user asks to create or update context docs, when onboarding a new LLM tool to an existing codebase, or when the user says the AI doesn't understand their project.
allowed-tools
Read Grep Glob Bash Write Edit Agent
Project Context
Build and maintain the .context/ directory — a set of markdown files that give any LLM (Claude, Cursor, Copilot, Windsurf, etc.) the background it needs to work effectively in this codebase. These files are tool-agnostic. Agent-specific files like CLAUDE.md or .cursorrules reference them.
Current context
Repo: !basename $(git rev-parse --show-toplevel)
Root: !git rev-parse --show-toplevel
Existing context: !ls .context/ 2>/dev/null || echo "no .context/ directory"
Decision tree
What are you doing?
Creating context for a new project (no .context/ exists) -> follow "Initial setup" below
Business terms, entity definitions, domain relationships
dependencies.md
Projects with >3 external deps
Key deps, why chosen, how configured, what for
<dirname>.md
Major subdirectories (src/, api/, lib/, etc.)
Subdirectory-specific architecture and conventions
Present the plan as a checklist and get user confirmation before generating.
3. Generate documents
For each document in the plan:
Read the relevant code thoroughly — don't guess, read the actual files
Write the document following the format in references/document-formats.md
Write it to .context/<name>.md
Generate overview.md first since other documents reference it.
4. Wire up agent files
After generating .context/, suggest additions to agent-specific files:
CLAUDE.md: add See .context/ for project architecture, conventions, and domain knowledge.
.cursorrules: add equivalent pointer
AGENTS.md: add equivalent pointer
Don't overwrite existing content — append the pointer or suggest where to add it.
Audit and update
1. Diff analysis
Compare the current .context/ files against the actual codebase:
Read each .context/*.md file
Scan the codebase for changes since the context was written — new directories, changed dependencies, new patterns
Identify: stale (info contradicts current code), missing (new areas with no context), accurate (still correct)
2. Report
Present a table:
| File | Status | What changed |
|---|---|---|
| overview.md | Stale | New api/ module added, auth rewritten |
| conventions.md | Accurate | — |
| glossary.md | Missing terms | "workspace" and "tenant" used but undefined |
3. Update
For each stale or missing item:
Read the relevant current code
Update the .context/ file with accurate information
Show the diff of what changed
Single document
When the user asks for a specific document:
Determine which document type from the table in "Initial setup"
Analyze the relevant part of the codebase
Write the document following references/document-formats.md
If .context/ doesn't exist yet, create it and also generate overview.md as a baseline
Writing principles
Context documents serve LLMs, not humans. This changes how you write:
Be explicit about relationships — "OrderService calls PaymentGateway.charge() which calls Stripe" is better than "OrderService handles payments"
Name the files — "authentication logic lives in src/auth/ with the main entry point at src/auth/index.ts" beats "the auth module"
State the non-obvious — skip things any LLM can infer from reading the code (function signatures, import paths). Focus on why decisions were made and how modules interact
Keep it current or delete it — wrong context is worse than no context. If something is stale and you can't verify it, remove it rather than leaving potentially wrong information