Memory

Project Context Generator For AI

Try it

Generates .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...

What it does

A reusable skill for creating project knowledge bases that help coding agents work faster and smarter.

The skill document

AI Context Generator

A reusable skill for creating project knowledge bases that help coding agents work faster and smarter.


🎯 When to Use This Skill

Activate when:

  • Setting up a new project for AI-assisted development
  • User requests: "create ai-context", "setup project knowledge", "generate .ai-context"
  • Existing .ai-context is outdated and needs regeneration
  • After major project restructuring

Do NOT activate when:

  • Project already has fresh .ai-context (check SKILL.md date)
  • User asks for unrelated documentation
  • Simple code tasks with clear existing context

📋 What This Skill Generates

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

Stability Tiers

TierFileUpdate FrequencyToken Budget
0PROJECT-ESSENCE.mdQuarterly / Major version~500 tokens
1ARCHITECTURE.mdMonthly / Sprint~1000 tokens
2DECISIONS.mdPer decision change~800 tokens
3DYNAMICS.mdAs needed (issues)~600 tokens

🔧 Generation Process

Step 1: Gather Project Intelligence

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

Step 2: Extract Knowledge

For PROJECT-ESSENCE.md:

  • What is this project? (one sentence)
  • Why does it exist? (problem/solution)
  • Who is it for? (target users)
  • What does it provide? (key features)
  • Core constraints? (security, compatibility)

For ARCHITECTURE.md:

  • System diagram (ASCII or Mermaid)
  • Component responsibilities
  • Data flow between components
  • Key dependencies
  • Important patterns

For DECISIONS.md:

  • Non-obvious design choices
  • Trade-offs made
  • Constraints accepted
  • Decisions that might be revisited

For DYNAMICS.md:

  • Current blockers
  • Known workarounds
  • Temporary constraints
  • Recently resolved issues (brief)

Step 3: Generate Files

Use templates from templates/ directory:

  1. Start with SKILL.md — entry point with activation rules
  2. Generate references/PROJECT-ESSENCE.md — core identity
  3. Generate references/ARCHITECTURE.md — component map
  4. Generate references/DECISIONS.md — design rationale
  5. Generate DYNAMICS.md — active issues
  6. Generate meta/MAINTENANCE.md — upkeep guide

Step 4: Validate Quality

□ 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

📝 Writing Principles

Do:

  • ✅ Write for someone who knows nothing about the project
  • ✅ Use diagrams over paragraphs
  • ✅ Focus on "why" not "how"
  • ✅ Keep files under 150 lines each
  • ✅ Link between related sections
  • ✅ Include "Last updated" dates

Don't:

  • ❌ Copy-paste code snippets (link to files instead)
  • ❌ Document every file/function
  • ❌ Include details that change frequently
  • ❌ Duplicate content across files
  • ❌ Use jargon without context

🔄 Integration with AGENTS.md

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.


📚 Template Reference

Templates are provided in templates/:

TemplatePurpose
skill.md.tmplSKILL.md with placeholder prompts
essence.md.tmplPROJECT-ESSENCE.md structure
architecture.md.tmplARCHITECTURE.md with diagram prompts
decisions.md.tmplDECISIONS.md with ADR format
dynamics.md.tmplDYNAMICS.md with status tracking
maintenance.md.tmplMAINTENANCE.md guide

🛠️ Automation Scripts

Scripts in scripts/ can help with:

ScriptPurpose
generate.tsInteractive generation from templates
check-drift.tsCompare documented vs actual structure
audit-dynamics.tsFlag stale issues (>30 days)

💡 Example Usage

User: "Setup ai-context for my project"

Agent:

  1. Activate this skill
  2. Read AGENTS.md, README.md, package.json
  3. Scan directory structure
  4. Generate each file using templates
  5. Ask clarifying questions if needed:
    • "What's the main problem this project solves?"
    • "Any non-obvious design decisions I should know about?"
    • "Current blockers or workarounds?"

⚠️ Important Notes

  • Generated knowledge is a starting point, not final truth
  • Agent should verify against actual code during first session
  • User should review generated content for accuracy
  • Schedule regular audits (monthly recommended)

📖 References


This skill creates knowledge bases optimized for AI agents. For questions or improvements, see MAINTENANCE.md.

Related skills

Generate and edit Draw.io, Mermaid, and Excalidraw diagrams from natural language using a structured JSON spec.

by nssa.io1.0k installs47 stars

Join a video meeting as an AI bot with voice, avatar, and screenshare across four operating modes.

by johnpatternai21 installs8 stars

Stores durable facts in a categorized, plain-markdown vault on disk, alongside your agent's built-in memory.

by Iván1 installs

Find why your productivity system keeps failing, then apply the smallest fix — capacity math, bottleneck routing, durable local notes.

by Iván2 installs

Fetch raw ad creative, app, ranking, and revenue data from AdMapix as structured JSON.

by fly0pants

More from sopaco

Browse all skills

Track your portfolio, monitor market sentiment, and generate rebalancing suggestions through a local ledger CLI.

by sopaco25 installs

MemClaw — High-performance memory plugin for OpenClaw. Outperforms native and other memory-solutions in complex scenarios with superior AI memory management,...

by sopaco51 installs2 stars

MemClaw Maintenance Guide — Installation, configuration, and maintenance guidance. For daily usage and tool operations, use the [`memclaw` skill](https://cla...

by sopaco24 installs1 stars

Personal AI chief-of-staff for technical managers. Use when the user wants a persistent workspace-based system for daily logs, decision support, upward-manag...

by sopaco13 installs

Persistent memory enhancement for AI agents. Store conversations, search memories with semantic retrieval, and recall context across sessions. Use this skill...

by sopaco13 installs

This skill should be used when the user asks to "generate project documentation", "analyze codebase architecture", "create C4 architecture diagrams", "docume...

by sopaco11 installs