A reusable skill for creating project knowledge bases that help coding agents work faster and smarter.
Activate when:
.ai-context is outdated and needs regenerationDo NOT activate when:
.ai-context (check SKILL.md date)Creates a .ai-context/ directory with:
text
.ai-context/
├── SKILL.md # Entry point with activation rules
├── DYNAMICS.md # Active issues & constraints (Dynamic)
├── references/
│ ├── PROJECT-ESSENCE.md # What & why (High stability)
│ ├── ARCHITECTURE.md # Component relationships (Medium stability)
│ └── DECISIONS.md # Design decisions (Update on change)
└── meta/
├── MAINTENANCE.md # How to maintain this knowledge
├── templates/ # (Optional) Custom templates
└── scripts/ # (Optional) Maintenance scripts
TierFileUpdate FrequencyToken Budget0PROJECT-ESSENCE.mdQuarterly / Major version500 tokens1ARCHITECTURE.mdMonthly / Sprint1000 tokens2DECISIONS.mdPer decision change~800 tokens3DYNAMICS.mdAs needed (issues)~600 tokens
Before generating, collect:
text
□ Read AGENTS.md (if exists) — operational rules
□ Read README.md — user-facing description
□ Read package.json — dependencies, scripts, entry points
□ Scan directory structure — identify components
□ Read docs/ or litho.docs/ — existing documentation
□ Identify key source files — main entry points
□ Note technology stack — frameworks, languages, platforms
For PROJECT-ESSENCE.md:
For ARCHITECTURE.md:
For DECISIONS.md:
For DYNAMICS.md:
Use templates from templates/ directory:
SKILL.md — entry point with activation rulesreferences/PROJECT-ESSENCE.md — core identityreferences/ARCHITECTURE.md — component mapreferences/DECISIONS.md — design rationaleDYNAMICS.md — active issuesmeta/MAINTENANCE.md — upkeep guidetext
□ SKILL.md has clear activation triggers
□ PROJECT-ESSENCE.md readable in 2 minutes
□ ARCHITECTURE.md shows big picture (no code)
□ DECISIONS.md justified with rationale
□ DYNAMICS.md only contains current issues
□ All files dated at top
□ Total token budget < 4000 tokens
text
AGENTS.md = "How to work" (commands, style, rules)
.ai-context = "What the project is" (architecture, decisions, issues)
Both should be read at session start. They serve different purposes and should not overlap.
Templates are provided in templates/:
TemplatePurposeskill.md.tmplSKILL.md with placeholder promptsessence.md.tmplPROJECT-ESSENCE.md structurearchitecture.md.tmplARCHITECTURE.md with diagram promptsdecisions.md.tmplDECISIONS.md with ADR formatdynamics.md.tmplDYNAMICS.md with status trackingmaintenance.md.tmplMAINTENANCE.md guide
Scripts in scripts/ can help with:
ScriptPurposegenerate.tsInteractive generation from templatescheck-drift.tsCompare documented vs actual structureaudit-dynamics.tsFlag stale issues (>30 days)
User: "Setup ai-context for my project"
Agent:
This skill creates knowledge bases optimized for AI agents. For questions or improvements, see MAINTENANCE.md.