Loading...
Take your Context Mesh skills to the next level with these advanced patterns and techniques.
Orchestrate multiple agents to implement complex features.
123456789101112131415161718192021222324252627# Agent: Full Feature Implementation ## PurposeOrchestrate multiple sub-agents to implement a complete feature. ## Sub-Agents1. @context/agents/agent-database.md - Schema changes2. @context/agents/agent-api.md - API endpoints3. @context/agents/agent-ui.md - Frontend components4. @context/agents/agent-tests.md - Test coverage ## Execution Order1. Execute agent-database first (creates schema)2. Execute agent-api second (needs schema)3. Execute agent-ui third (needs API)4. Execute agent-tests last (needs all components) ## Dependencies- agent-api depends on agent-database- agent-ui depends on agent-api- agent-tests depends on all above ## Rollback PlanIf any agent fails:1. Document the failure in evolution/2. Revert database migrations if needed3. Reset to last known good stateBuild hierarchical context structures for complex projects.
1234567891011121314context/├── intent/│ ├── project-intent.md # Root intent│ ├── feature-auth.md # Inherits from project│ └── feature-auth-oauth.md # Inherits from feature-auth├── decisions/│ ├── 001-architecture.md # Project-level decision│ └── 001a-auth-architecture.md # Extends 001├── knowledge/│ ├── patterns/│ │ ├── _base-component.md # Base pattern│ │ └── form-component.md # Extends base│ └── anti-patterns/│ └── prop-drilling.md # References patterns/Use Prefixes for Naming
Use prefixes like 001a- to show relationship to parent decisions.
Reference Parent Context
Always reference parent documents using @ syntax.
Create agents that adapt based on project configuration.
12345678910111213141516171819202122232425262728293031# Agent: Setup Authentication ## Conditional Execution ### If using NextAuth.js1. Install next-auth and @auth/prisma-adapter2. Create app/api/auth/[...nextauth]/route.ts3. Configure providers in lib/auth.ts ### If using Clerk1. Install @clerk/nextjs2. Add ClerkProvider to layout3. Configure middleware ### If using Supabase Auth1. Install @supabase/ssr2. Create lib/supabase/client.ts and server.ts3. Set up auth middleware ## Environment Variables Required### NextAuth.js- NEXTAUTH_SECRET- NEXTAUTH_URL ### Clerk- NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY- CLERK_SECRET_KEY ### Supabase- NEXT_PUBLIC_SUPABASE_URL- NEXT_PUBLIC_SUPABASE_ANON_KEYTrack how your context evolves over time with detailed changelogs.
1234567891011121314151617181920212223# Evolution Changelog ## [2024-01-15] Sprint 3 Retrospective ### What Worked- Agent-based development increased velocity by 40%- Decision records prevented 3 architectural mistakes- Pattern library reduced code review time ### What Didn't Work- Some agents had too broad scope- Knowledge patterns needed more examples- Missing anti-patterns caused repeated mistakes ### Changes Made- Split large agents into smaller, focused ones- Added code examples to all patterns- Created anti-pattern: "Mixing server/client state" ### Updated Files- Modified: context/agents/agent-feature.md- Created: context/knowledge/anti-patterns/state-mixing.md- Updated: context/knowledge/patterns/state-management.mdHow to scale Context Mesh for different project sizes.
Small Projects (1-2 developers)
Keep it simple: project intent, key decisions, and a few patterns.
Medium Projects (3-10 developers)
Add feature intents, more detailed patterns, and specialized agents.
Large Projects (10+ developers)
Use domain-specific context directories and shared pattern libraries.
Have questions? Check out these resources.