Install
openclaw skills install ai-context-generatorGenerates .ai-context knowledge base for coding agents. Activate when: (1) setting up a new project for AI-assisted development, (2) user asks to "create pro...
openclaw skills install ai-context-generatorA 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:
.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
| Tier | File | Update Frequency | Token Budget |
|---|---|---|---|
| 0 | PROJECT-ESSENCE.md | Quarterly / Major version | ~500 tokens |
| 1 | ARCHITECTURE.md | Monthly / Sprint | ~1000 tokens |
| 2 | DECISIONS.md | Per decision change | ~800 tokens |
| 3 | DYNAMICS.md | As needed (issues) | ~600 tokens |
Before generating, collect:
□ 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 guide□ 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
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/:
| Template | Purpose |
|---|---|
skill.md.tmpl | SKILL.md with placeholder prompts |
essence.md.tmpl | PROJECT-ESSENCE.md structure |
architecture.md.tmpl | ARCHITECTURE.md with diagram prompts |
decisions.md.tmpl | DECISIONS.md with ADR format |
dynamics.md.tmpl | DYNAMICS.md with status tracking |
maintenance.md.tmpl | MAINTENANCE.md guide |
Scripts in scripts/ can help with:
| Script | Purpose |
|---|---|
generate.ts | Interactive generation from templates |
check-drift.ts | Compare documented vs actual structure |
audit-dynamics.ts | Flag 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.