Purpose: Minimal, concern-based knowledge organization for AI agents
Last Updated: 2026-01-08
Extract only core concepts (1-3 sentences), key points (3-5 bullets), minimal example, and reference link. Goal: Scannable in <30 seconds. Reference full docs, don't duplicate them.
Organize by what you're doing (concern), then by how you're doing it (approach/tech):
Two organizational patterns:
category/
├── navigation.md
├── concepts/ # What it is
├── examples/ # Working code
├── guides/ # How to do it
├── lookup/ # Quick reference
└── errors/ # Common issues
Use when: Content is repository-specific (e.g., openagents-repo/)
category/
├── navigation.md
├── {concern}/ # Organize by what you're doing
│ ├── navigation.md
│ ├── {approach}/ # Then by approach/tech
│ │ ├── navigation.md
│ │ └── {files}.md
Use when: Content spans multiple technologies (e.g., development/)
Examples:
development/backend/api-patterns/ - Concern: backend, Approach: API patternsdevelopment/backend/nodejs/ - Concern: backend, Tech: Node.jsdevelopment/frontend/react/ - Concern: frontend, Tech: ReactEvery category/subcategory has navigation.md with:
Why: Faster loading, less cost, quicker AI decisions
For cross-cutting concerns, create specialized navigation:
development/ui-navigation.md - Spans frontend/ + ui/development/backend-navigation.md - Covers APIs, auth, middlewaredevelopment/fullstack-navigation.md - Common tech stacksWhy: Real workflows don't fit neat categories
Filenames should tell you what's inside:
code.md → ✅ code-quality.mdtests.md → ✅ test-coverage.mdreview.md → ✅ code-review.mdWhy: No need to open files to understand content
Extract valuable context from AI summaries/overviews, then delete them. Workspace stays clean, knowledge persists.
Purpose: Ensure consistent placement of new technologies (frameworks, libraries, tools) to maintain discoverability.
Frameworks vs Architectural Layers:
development/frameworks/{tech}/. These are "meta-frameworks" that span multiple layers.development/{concern}/{tech}/.development/{frontend|backend}/{tech}/.Decision Process:
development/frameworks/development/{domain}/development/{frontend|backend}/Use for: Repository-specific context (e.g., openagents-repo/)
.opencode/context/{category}/
├── navigation.md # Fast, token-efficient navigation
├── quick-start.md # Optional: 2-minute orientation
│
├── core-concepts/ # Foundational concepts (optional)
│ ├── navigation.md
│ └── {concept}.md
│
├── concepts/ # What it is
│ ├── navigation.md
│ └── {concept}.md
│
├── examples/ # Working code
│ ├── navigation.md
│ └── {example}.md
│
├── guides/ # How to do it
│ ├── navigation.md
│ └── {guide}.md
│
├── lookup/ # Quick reference
│ ├── navigation.md
│ └── {lookup}.md
│
└── errors/ # Common issues
├── navigation.md
└── {error}.md
Use for: Multi-technology development context (e.g., development/)
.opencode/context/{category}/
├── navigation.md # Main navigation
├── {concern}-navigation.md # Specialized navigation (optional)
│
├── principles/ # Universal principles (optional)
│ ├── navigation.md
│ └── {principle}.md
│
├── {concern}/ # Organize by concern
│ ├── navigation.md
│ │
│ ├── {approach}/ # Then by approach
│ │ ├── navigation.md
│ │ └── {pattern}.md
│ │
│ └── {tech}/ # Or by tech
│ ├── navigation.md
│ └── {pattern}.md
Example:
development/
├── navigation.md
├── ui-navigation.md # Specialized
├── backend-navigation.md # Specialized
├── fullstack-navigation.md # Specialized
│
├── principles/ # Universal
│ ├── clean-code.md
│ └── api-design.md
│
├── frontend/ # Concern
│ ├── react/ # Tech
│ │ ├── hooks-patterns.md
│ │ └── tanstack/ # Sub-tech
│ │ ├── query-patterns.md
│ │ └── router-patterns.md
│ └── vue/ # Tech
│
├── backend/ # Concern
│ ├── api-patterns/ # Approach
│ │ ├── rest-design.md
│ │ └── graphql-design.md
│ ├── nodejs/ # Tech
│ └── authentication/ # Functional concern
│
└── data/ # Concern
├── sql-patterns/ # Approach
└── orm-patterns/ # Approach
# {Category} Navigation
**Purpose**: [1 sentence]
---
## Structure
{category}/ ├── navigation.md ├── {subcategory}/ │ ├── navigation.md │ └── {files}.md
---
## Quick Routes
| Task | Path |
|------|------|
| **{Task 1}** | `{path}` |
| **{Task 2}** | `{path}` |
---
## By {Concern/Type}
**{Section 1}** → {description}
**{Section 2}** → {description}
Target: 200-300 tokens
Location: .opencode/context/core/standards/
Purpose: Universal standards that apply to ALL development
Content:
Used by: All agents, all projects
Effect on other categories:
development/principles/| Location | Scope | Examples |
|---|---|---|
core/standards/ |
Universal (all projects, all languages) | Code quality, testing, docs, security |
development/principles/ |
Development-specific (software engineering) | Clean code, API design, error handling |
Both exist: Core standards are universal, development principles are domain-specific
Decision: Data patterns live in development/data/ (not top-level)
Rationale: Data layer is part of development workflow
Structure:
development/data/
├── navigation.md
├── sql-patterns/
├── nosql-patterns/
└── orm-patterns/
Top-level data/ category: Reserved for data engineering/analytics (different concern)
Full-stack navigation includes:
Example:
## Quick Routes
| Task | Path |
|------|------|
| **Frontend** | `ui-navigation.md` |
## Common Stacks
### MERN Stack
Frontend: development/frontend/react/
Backend: development/backend/nodejs/
Data: development/data/nosql-patterns/mongodb.md
/context harvest)Purpose: Extract knowledge from summary files → permanent context, then clean up.
Process:
*OVERVIEW.md, *SUMMARY.md, SESSION-*.md, CONTEXT-*.mdconcepts/examples/guides/errors/lookup/A B C or all)/context extract)Purpose: Extract context from docs/code/URLs.
Process:
Output: Follow MVI template
/context organize)Purpose: Restructure existing files into appropriate pattern.
Process:
/context update)Purpose: Update context when APIs/frameworks change.
Process:
navigation.md - Main navigation for category/subcategory{domain}-navigation.md - Specialized cross-cutting navigationcode-quality.md not code.mdrest-design.md, jwt-patterns.mdscroll-linked-animations.md✅ Minimal - Core info only, <200 lines per file ✅ Navigable - navigation.md at every level ✅ Organized - Appropriate pattern (function-based or concern-based) ✅ Token-efficient - Navigation files ~200-300 tokens ✅ Self-describing - Filenames tell you what's inside ✅ Referenceable - Links to full docs ✅ Searchable - Easy to find via navigation ✅ Maintainable - Easy to update
context-system/guides/navigation-design.md - How to create navigation filescontext-system/guides/organizing-context.md - How to choose organizational patterncontext-system/examples/navigation-examples.md - Good navigation examplescontext-system/standards/templates.md - File templates/context # Quick scan, suggest actions
/context harvest # Clean up summaries → permanent context
/context extract {source} # From docs/code/URLs
/context organize {category} # Restructure flat files → function folders
/context update {what} # When APIs/frameworks change
/context migrate # Move global project-intelligence → local project
/context create {category} # Create new context category
/context error {error} # Add recurring error to knowledge base
/context compact {file} # Minimize verbose file to MVI format
/context map [category] # View context structure
/context validate # Check integrity, references, sizes
All operations show a preview of what will be created/moved/deleted before asking for approval.