Purpose: Function-based folder organization for easy discovery
Last Updated: 2026-01-06
ALWAYS organize by function (what info does), not just by topic.
Required folders:
.opencode/context/{category}/
├── navigation.md # Navigation map (REQUIRED)
├── concepts/ # What it is
│ └── {topic}.md
├── examples/ # Working code
│ └── {example}.md
├── guides/ # How to do it
│ └── {guide}.md
├── lookup/ # Quick reference
│ └── {reference}.md
└── errors/ # Common issues
└── {framework}.md
Purpose: Core ideas, definitions, "what is it?"
Contains:
Examples:
concepts/authentication.mdconcepts/state-management.mdconcepts/mvi-principle.mdPurpose: Minimal working code examples
Contains:
Examples:
examples/jwt-auth-example.mdexamples/react-hooks-example.mdexamples/api-call-example.mdRule: Examples should be <30 lines of code, fully functional
Purpose: Step-by-step workflows, "how to do X"
Contains:
Examples:
guides/setting-up-auth.mdguides/deploying-api.mdguides/migrating-to-v2.mdRule: Steps should be actionable (not theoretical)
Purpose: Quick reference tables, commands, paths
Contains:
Examples:
lookup/cli-commands.mdlookup/file-locations.mdlookup/api-endpoints.mdRule: Must be in table/list format (scannable)
Purpose: Common errors, gotchas, edge cases
Contains:
Examples:
errors/react-errors.mderrors/nextjs-build-errors.mderrors/auth-errors.mdRule: Group by framework/topic, not one file per error
Every context category MUST have navigation.md at its root with:
Example:
# Development Context
**Purpose**: Core development patterns, errors, and examples
---
## Quick Navigation
### Concepts
| File | Description | Priority |
|------|-------------|----------|
| [auth.md](concepts/auth.md) | Authentication patterns | critical |
### Examples
| File | Description | Priority |
|------|-------------|----------|
| [jwt.md](examples/jwt.md) | JWT auth example | high |
### Errors
| File | Description | Priority |
|------|-------------|----------|
| [react.md](errors/react.md) | Common React errors | high |
---
## Loading Strategy
**For auth work**:
1. Load concepts/auth.md
2. Load examples/jwt.md
3. Reference guides/setup-auth.md if needed
When organizing a file, ask:
| Question | Folder |
|---|---|
| Does it explain what something is? | concepts/ |
| Does it show working code? | examples/ |
| Does it explain how to do something? | guides/ |
| Is it quick reference data? | lookup/ |
| Does it document an error/issue? | errors/ |
development/
├── authentication.md
├── jwt-example.md
├── setting-up-auth.md
├── auth-errors.md
└── api-endpoints.md
Problem: Hard to discover. Is authentication.md a concept or guide?
development/
├── navigation.md
├── concepts/
│ └── authentication.md
├── examples/
│ └── jwt-example.md
├── guides/
│ └── setting-up-auth.md
├── lookup/
│ └── api-endpoints.md
└── errors/
└── auth-errors.md
Benefit: Instantly know file purpose by location
Before committing context structure: