description: Context system manager - harvest summaries, extract knowledge, organize context tags:
Files MUST be <200 lines. Extract core concepts only (1-3 sentences), 3-5 key points, minimal example, reference link.
ALWAYS present approval UI before deleting/archiving files. Letter-based selection (A B C or 'all'). NEVER auto-delete.
ALWAYS organize by function: concepts/, examples/, guides/, lookup/, errors/ (not flat files).
ALWAYS read required context files from .opencode/context/core/context-system/ BEFORE executing operations.
- Files <200 lines (@critical_rules.mvi_strict)
- Show approval before cleanup (@critical_rules.approval_gate)
- Function-based structure (@critical_rules.function_structure)
- Load context before operations (@critical_rules.lazy_load)
- Harvest (default), Extract, Organize, Update workflows
- Cross-references, validation, navigation
Tier 1 always overrides Tier 2/3.
Arguments: $ARGUMENTS
When invoked without arguments: /context
Scan workspace for summary files:
- *OVERVIEW.md, *SUMMARY.md, SESSION-*.md, CONTEXT-*.md
- Files in .tmp/ directory
- Files >2KB in root directory
Show what was found:
```
Quick scan results:
Found 3 summary files:
📄 CONTEXT-SYSTEM-OVERVIEW.md (4.2 KB)
📄 SESSION-auth-work.md (1.8 KB)
📄 .tmp/NOTES.md (800 bytes)
Recommended action:
/context harvest - Clean up summaries → permanent context
Other options:
/context extract {source} - Extract from docs/code
/context organize {category} - Restructure existing files
/context help - Show all operations
```
Purpose: Quick tidy-up. Default assumes you want to harvest summaries and compact workspace.
/context harvest [path] ⭐ Most Common
operations/harvest.md + standards/mvi.md/context compact {file}
guides/compact.md + standards/mvi.md/context extract from {source}
operations/extract.md + standards/mvi.md + guides/compact.md/context organize {category}
operations/organize.md + standards/structure.md/context update for {topic}
operations/update.md + guides/workflows.md/context error for {error}
operations/error.md + standards/templates.md/context create {category}
guides/creation.md + standards/structure.md + standards/templates.md/context migrate
~/.config/opencode/context/) to local (.opencode/context/)standards/mvi.md/context map [category]
/context validate
/context help
Read: operations/harvest.md, standards/mvi.md
Read: operations/harvest.md, standards/mvi.md, guides/workflows.md
Read: guides/compact.md, standards/mvi.md
Read: operations/extract.md, standards/mvi.md, guides/compact.md, guides/workflows.md
Read: operations/organize.md, standards/structure.md, guides/workflows.md
Read: operations/update.md, guides/workflows.md, standards/mvi.md
Read: operations/error.md, standards/templates.md, guides/workflows.md
Read: guides/creation.md, standards/structure.md, standards/templates.md
Read: standards/mvi.md
All files located in: .opencode/context/core/context-system/
Pass: operation name, arguments, lazy load map
Subagent loads: Required context files from .opencode/context/core/context-system/
Subagent executes: Multi-stage workflow per operation
Pass: operation name, arguments
Subagent executes: Read-only analysis and reporting
.opencode/context/core/context-system/
├── operations/ # How to do things (harvest, extract, organize, update)
├── standards/ # What to follow (mvi, structure, templates)
└── guides/ # Step-by-step (workflows, compact, creation)
{category}/
├── navigation.md # Navigation
├── concepts/ # What it is
├── examples/ # Working code
├── guides/ # How to
├── lookup/ # Quick reference
└── errors/ # Common issues
/context
# Scans workspace, suggests harvest if summaries found
/context harvest
/context harvest .tmp/
/context harvest OVERVIEW.md
/context extract from docs/api.md
/context extract from https://react.dev/hooks
/context organize development/
/context organize development/ --dry-run
/context update for Next.js 15
/context update for React 19 breaking changes
/context migrate
# Copies project-intelligence from ~/.config/opencode/context/ to .opencode/context/
# Shows what will be copied, asks for approval before proceeding
After any operation:
Context System Location: .opencode/context/core/context-system/
Structure:
operations/ - Detailed operation workflowsstandards/ - MVI, structure, templatesguides/ - Interactive examples, creation standardsRead before using: standards/mvi.md (understand Minimal Viable Information principle)