You prompt. AI generates. Code works... sometimes.
Three months later, you open that codebase: "Why did we do this? What was the reasoning?"
The context is gone. The decisions are forgotten. You spend hours reconstructing what you already knew.
This isn't an AI model problem. It's a context problem.
Context Mesh is a simple 3-step framework that standardizes AI-assisted development by planning first and preserving context in your repo.
❌ Without Context Mesh:
"Create a login component"
→ AI generates generic code, no patterns, hard to maintain
✅ With Context Mesh:
"Implement login following @context/intent/feature-user-auth.md"
→ You planned first (intent + decision) before writing code
→ Feature defines WHAT and WHY
→ Feature references decision with HOW (tech approach)
→ AI generates code following YOUR patterns, YOUR decisions
Result: Even free models deliver quality code when they have structured context.
How it connects:
feature-user-auth.md → "What: User authentication"
↓ "Why: Secure access needed"
└── References: "See: decisions/002-auth.md"
↓
002-auth.md → "Decision: Use JWT"
"Rationale: Stateless, scalable"
One simple prompt loads all the context AI needs.
Tool-agnostic note: In Cursor you can reference files with
@path. In other AI tools, attach or paste the referenced files (intent/decisions) so the model can read them.
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ INTENT │ ──► │ BUILD │ ──► │ LEARN │
│ What & Why │ │ AI + Human │ │ Update │
└─────────────┘ └─────────────┘ └─────────────┘
│
◄────────────────────┘
Feedback Loop
- Intent - Define what to build and why (create context)
- Build - AI generates code, human supervises
- Learn - Update context with outcomes
That's it. Each step preserves context for the next.
You write down WHAT you're building, WHY it matters, and how you know it's done (acceptance criteria). If the feature needs a non-trivial approach, you also capture the Decision (ADR) before writing code.
This is the minimum viable Context Mesh: intent + decision (so AI stops guessing).
context/
├── intent/
│ ├── project-intent.md # high-level goals + constraints
│ └── feature-user-auth.md # what/why + acceptance criteria
└── decisions/
└── 002-auth.md # how (approach) + rationale (ADR)
Optional (recommended) full structure: Add more context as your project grows.
your-project/
├── context/
│ ├── intent/ # what + why (requirements)
│ │ ├── project-intent.md
│ │ ├── feature-*.md
│ │ └── bug-*.md
│ ├── decisions/ # how (ADRs)
│ │ └── 001-*.md
│ ├── knowledge/ # standards that make AI consistent
│ │ ├── patterns/
│ │ └── anti-patterns/
│ ├── agents/ # optional: reusable execution playbooks
│ │ └── agent-*.md
│ └── evolution/ # what changed over time
│ └── changelog.md
└── AGENTS.md # agent router (optional but recommended)
You implement by referencing the intent (and any relevant decisions/patterns). AI generates code that matches your standards; you review and ship.
After shipping, you update context with what actually happened (outcomes, gotchas, changes to approach). This prevents context drift over time.
Keep the 3 steps (Intent → Build → Learn), but feel free to adapt the structure to your reality:
- Rename folders/files, add fields, integrate with Scrum/Kanban, etc.
- The goal is consistent AI output via versioned context, not rigid file layouts.
- Open prompt-packs/context-mesh-core/1.1.0/new-project.md
- Copy the prompt (inside the ``` block)
- Paste into your AI assistant (Cursor, Copilot, Claude, etc.)
- Answer the questions
- Review generated files (
context/+AGENTS.md)
- Open prompt-packs/context-mesh-core/1.1.0/existing-project.md
- Copy the prompt (inside the ``` block)
- Paste into your AI assistant
- Let it analyze your codebase and generate living context
- Review generated files (
context/+AGENTS.md)
Use these prompts as you work:
| I want to... | Use this |
|---|---|
| Add a feature | add-feature.md |
| Fix a bug | fix-bug.md |
| Update a feature | update-feature.md |
| Update context (Learn step) | learn-update.md |
15 days to migrate the front-end of a React monolith into 10 micro front-ends (2 developers, real production work)
Breakdown: 4–5 days in Intent (planning) + remaining days in Build + Learn (continuous context updates during Build/Learn)
The monolith was an AI automation platform with 10 internal tools. The code was hard to understand and had no consistent standards.
What changed in the Build step:
- Migrated each tool to a newer React baseline
- Switched UI from Material UI → shadcn/ui
- Introduced React Query (previously not used)
- Adopted
@module-federation/vitefor micro front-end composition
Another example:
- Built
context-mesh.orgwith 2–3 hours in Intent planning and < 1 hour in Build, then Learn to keep context current
What teams report:
- ✅ Faster development cycles
- ✅ New developers onboard in days, not weeks
- ✅ Code remains understandable months later
- ✅ AI generates consistent code that follows your patterns
your-project/
├── context/
│ ├── intent/ # What and why
│ │ ├── project-intent.md
│ │ └── feature-*.md
│ ├── decisions/ # Technical decisions (ADR)
│ │ └── 001-*.md
│ ├── knowledge/ # Patterns to follow
│ │ ├── patterns/
│ │ └── anti-patterns/
│ └── evolution/ # Changes and learnings
│ └── changelog.md
└── AGENTS.md # AI agent router
That's all. Simple markdown files. Version controlled with Git.
Traditional:
Code → Documentation (often incomplete)
Context Mesh:
Context → Code (always complete)
When context is primary:
- AI understands your architecture
- Decisions preserve their "why"
- Code follows your patterns
- Knowledge evolves with your system
- You repeat less in prompts (less re-explaining), and the AI infers less
| I want to... | Read this |
|---|---|
| Start now | prompt-packs/context-mesh-core/1.1.0/ ⚡ |
| Understand the framework | FRAMEWORK.md |
| See examples | examples/ |
| Use with Scrum/Agile | INTEGRATION.md |
| Common questions | FAQ.md |
- ✅ Cursor
- ✅ GitHub Copilot
- ✅ Claude
- ✅ ChatGPT
- ✅ Any AI coding assistant
Context Mesh is in active development. Contributions, feedback, and use cases are welcome!
- Issues: GitHub Issues
- Discussions: GitHub Discussions
Ready to fix the context crisis?
Get Started → • See Examples → • Read Framework →
Made with ❤️ for the AI-First development community