A sophisticated task planning, memory guidance, and governance system for OpenCode. Meridian provides structured workflows, persistent project memory, and strict coding standards enforcement across AI coding sessions.
Meridian addresses critical challenges in AI-assisted development:
- Context Loss: AI conversations get compacted, losing critical project knowledge
- Inconsistency: Different sessions produce different approaches to similar problems
- Memory Gaps: Important architectural decisions and lessons learned disappear
- Lack of Continuity: No persistent understanding of project state and ongoing work
- JSONL-based memory: Timestamped architectural decisions and lessons learned
- Structured entries: Tagged, searchable, and linked to tasks and files
- Append-only audit trail: Never lose historical context
- Formal task briefs: YAML-based task definitions with clear objectives and acceptance criteria
- Approved plans: Frozen plans that require re-approval for changes
- Progress tracking: Timestamped context logs for each task
- Task backlog: Single source of truth for all project tasks
- Baseline guide: 120 rules for frontend/backend development
- Project-specific addons: Hackathon, Production, and TDD modes
- Dynamic loading: Rules adapt based on project configuration
- Immutable rules: File-based governance prevents accidental changes
- Context preservation: Automatic reload of critical files after compaction
- Guardrails: Blocks tool usage until context review is complete
- Workflow enforcement: Cannot exit plan mode without creating formal tasks
- Pre-stop validation: Ensures project state is updated before session ends
-
Copy the
.meridiandirectory to your project root:cp -r .meridian /path/to/your/project/
-
Copy the
.opencodedirectory to your project root:cp -r .opencode /path/to/your/project/
-
Install plugin dependencies:
cd /path/to/your/project/.opencode/plugin npm install # or bun install
-
Configure your project by editing
.meridian/config.yaml:# Project type affects which code guide add-on is loaded: # - hackathon → use CODE_GUIDE_ADDON_HACKATHON.md # - standard → baseline only # - production → use CODE_GUIDE_ADDON_PRODUCTION.md project_type: standard # Optional: Test-Driven Development mode. # When true, inject CODE_GUIDE_ADDON_TDD.md and follow its rules. tdd_mode: false
.meridian/
├── config.yaml # Project configuration
├── memory.jsonl # Persistent memory entries
├── task-backlog.yaml # Task index and status
├── relevant-docs.md # Additional documentation to review
├── CODE_GUIDE.md # Baseline coding standards (120 rules)
├── CODE_GUIDE_ADDON_HACKATHON.md # Hackathon mode overrides
├── CODE_GUIDE_ADDON_PRODUCTION.md # Production mode enhancements
├── CODE_GUIDE_ADDON_TDD.md # TDD workflow rules
├── prompts/
│ └── agent-operating-manual.md # Agent behavior and responsibilities
├── tasks/
│ ├── TASK-000-template/ # Template for new tasks
│ │ ├── TASK-000.yaml
│ │ ├── TASK-000-plan.md
│ │ └── TASK-000-context.md
│ └── TASK-001/ # Example task
│ ├── TASK-001.yaml
│ ├── TASK-001-plan.md
│ └── TASK-001-context.md
└── docs/ # Project-specific documentation
.opencode/
├── agent/
│ └── meridian-plan.md # Meridian Plan agent definition
└── plugin/
├── package.json
├── tsconfig.json
├── meridian.ts # Main plugin with hooks
└── tools.ts # Custom tools (memory-curator, task-manager)
When you start OpenCode in a project with Meridian:
- The plugin automatically loads project context
- OpenCode reads all coding guides, memory, and tasks
- You're prompted to specify what you'd like to work on
Meridian ships with a specialized meridian-plan agent for structured planning:
To switch to Meridian Plan agent:
# In OpenCode, cycle through agents with Tab
# Or select "meridian-plan" from the agent menuIn meridian-plan agent:
- ✅ Read and analyze code (read, grep, glob, list)
- ✅ Research documentation (webfetch, websearch)
- ✅ Plan with TodoWrite
- ❌ Cannot modify code (write, edit, bash disabled)
- ✅ Prompts for task creation when exiting
- 🎯 Uses OpenCode's default model (configurable in
.opencode/agent/meridian-plan.md)
Workflow:
- Switch to
meridian-planagent - Discuss requirements and analyze codebase
- OpenCode creates a detailed plan
- Approve the plan
- Exit plan mode → Meridian prompts for task creation
- Switch back to
buildagent for implementation
Customizing the Agent:
Edit .opencode/agent/meridian-plan.md to override model, temperature, or tools:
---
# Uncomment to use specific model instead of default:
# model: claude-sonnet-4
# model: gpt-4o
# model: gemini-2.5-flash
temperature: 0.2 # Adjust between 0.0-1.0
tools:
# Customize which tools are available
---You can also use OpenCode's built-in plan and build agents:
planagent: Planning mode with standard restrictionsbuildagent: Full implementation mode- Any custom agent: Full Meridian features (memory, tasks, context)
Note: The task creation reminder only triggers when exiting meridian-plan agent. Other agents have full Meridian features without planning workflow enforcement.
Tasks are created using the task-manager tool:
- Plan your work (in
meridian-planor any agent) - Get user approval for the plan
- Call
task-managertool (or let Meridian prompt you) - Meridian scaffolds task files and updates backlog
When you make architectural decisions or learn important lessons:
Use the memory-curator tool to document this decision:
- Decision: We chose to use Server Components by default
- Problem: Client components were causing unnecessary hydration overhead
- Alternatives: Considered client-only approach (rejected: performance)
- Trade-offs: Slightly more complex data fetching patterns
- Impact/Scope: All new routes in /app/*
- Pattern: Default to Server Components; add "use client" only when needed
OpenCode will use the memory-curator tool to add a structured entry to memory.jsonl.
Query memory entries using jq:
# All architecture decisions
jq -s '.[] | select(.tags != null and (.tags | index("architecture")))' .meridian/memory.jsonl
# Entries mentioning a task
jq -s '.[] | select(.links != null and (.links | index("TASK-090")))' .meridian/memory.jsonl
# Most recent 5 entries
tail -5 .meridian/memory.jsonl | jq -s '.'
# Security-related
jq -s '.[] | select(.tags != null and (.tags | index("security")))' .meridian/memory.jsonl- Baseline coding standards only
- Balanced approach for most projects
- 120 rules covering frontend and backend
- Relaxed standards for rapid prototyping
- Faster iteration, minimal testing
- Security floor still enforced
- Set
project_type: hackathonin config.yaml
- Stricter standards for robust systems
- Enhanced security, observability, and resilience
- Comprehensive testing requirements
- Set
project_type: productionin config.yaml
- Test-Driven Development workflow enforced
- Red → Green → Refactor cycle
- Can be combined with any project type
- Set
tdd_mode: truein config.yaml
Adds structured memory entries to memory.jsonl.
When to use:
- Architectural decisions that affect future features
- Patterns to repeat across the codebase
- Lessons that prevent future mistakes
Arguments:
summary: Markdown summary with Decision, Problem, Alternatives, Trade-offs, Impact/Scope, Patterntags: Array of kebab-case tags (architecture, security, performance, etc.)links: Array of TASK IDs, file paths, or URLs
Creates formal task folders with YAML definitions, plans, and context logs.
When to use:
- Immediately after user approves a plan
- For any non-trivial code changes
What it does:
- Creates
TASK-###folder from template - Scaffolds YAML, plan, and context files
- Updates task backlog
- Loads agent operating manual
- Injects coding guides based on project type
- Prompts to review memory and tasks
- Creates context review flag
- Reloads critical project files
- Prompts to synchronize current work
- Ensures no context is lost
- Blocks tools until context review is complete
- Reminds to create tasks when exiting plan mode
- Prompts to update task files and memory
- Ensures tests/lint/build pass before stopping
- Prevents incomplete work
- Only add entries that pass the triage test (affects future features, repeatable pattern, prevents mistakes)
- Keep summaries concise (6-10 lines)
- Use consistent formatting with bolded labels
- Tag appropriately for easy retrieval
- Create tasks for all non-trivial changes
- Freeze approved plans (amendments require re-approval)
- Update context logs with timestamped progress
- Mark tasks as
doneonly when Definition of Done is met
- Read the baseline guide first
- Understand which addons are active
- Follow the security floor (never relaxed)
- Document exceptions in task context
If the .needs-context-review flag isn't cleared:
rm .meridian/.needs-context-reviewThe system auto-generates sequential IDs. If they're wrong, check for malformed JSON in memory.jsonl.
Ensure the TASK-000-template directory exists with all three files:
TASK-000.yamlTASK-000-plan.mdTASK-000-context.md
If you're migrating from the original Meridian for Claude Code:
- Copy your existing
.meridiandirectory - Install the OpenCode plugin
- Your memory, tasks, and guides are preserved
- The workflow remains identical
Meridian is designed to be customized for your team's needs:
- Edit coding guides to match your standards
- Modify the agent operating manual for your workflow
- Adjust task templates for your process
- Add project-specific documentation to
.meridian/docs/
This is a port of the Meridian system for OpenCode. Original concept and design by the Meridian project.
For issues or questions:
- Check the
.meridian/prompts/agent-operating-manual.mdfor agent behavior - Review the coding guides for standards
- Examine existing memory entries for patterns
- Read task context logs for historical decisions