extra pt2

This commit is contained in:
2026-03-09 17:34:14 +00:00
parent 457fb2068b
commit e0c4c2ed7b
14 changed files with 310 additions and 21 deletions

View File

@@ -0,0 +1,36 @@
# Conventions
## File Organization
```
~/.config/opencode/
├── opencode.jsonc # Main config (default agent, plugins, permissions)
├── AGENTS.md # Cross-tool instructions (single source of truth)
├── CLAUDE.md -> AGENTS.md # Symlink for Claude
├── .cursorrules -> AGENTS.md # Symlink for Cursor
├── agents/ # Agent definitions
│ ├── lead.md
│ ├── coder.md
│ ├── reviewer.md
│ └── ...
├── skills/ # Reusable skill modules
│ └── doc-coverage/
└── .memory/ # Persistent memory
```
## Naming Conventions
- Agent files: `{role}.md` (e.g., `coder.md`, `reviewer.md`)
- Plan files: `{feature}.md` (e.g., `memory-restructure.md`)
- Research files: `{topic}.md` (e.g., `micode-memory-system.md`)
- Gate files: `{feature}.md` (e.g., `auth-flow.md`)
## Memory Structure
See [Memory Structure](../manifest.yaml) for the canonical structure.
## Cross-Tool Instructions
- `AGENTS.md` is the single source of truth
- All other instruction files are symlinks to it
- Never edit symlinked files directly

View File

@@ -0,0 +1,35 @@
# Domain Concepts
## Agent Roles
| Role | Responsibility |
|------|----------------|
| Lead | Primary orchestrator — decomposes work, delegates, synthesizes |
| Coder | Implementation-focused coding |
| Reviewer | Code quality, correctness, security review |
| Tester | Functional and adversarial testing |
| Explorer | Fast codebase mapping and discovery |
| Researcher | Deep technical investigation |
| Librarian | Documentation coverage and accuracy |
| Critic | Pre-implementation gate and blocker resolution |
| SME | Domain-specific consultation |
| Designer | UI/UX interaction and visual guidance |
## Memory Categories
| Category | Purpose | Location |
|----------|---------|----------|
| Knowledge | Persistent project understanding | `.memory/knowledge/` |
| Decisions | Architecture Decision Records | `.memory/decisions.md` |
| Plans | Active implementation plans | `.memory/plans/` |
| Research | Technical investigations | `.memory/research/` |
| Gates | Quality gate records | `.memory/gates/` |
| Sessions | Session continuity | `.memory/sessions/` |
## Quality Pipeline Flow
Standard flow: `explorer/researcher → coder → reviewer → tester → librarian`
Exceptions:
- Tier 3: skips tester
- Tier 1: adds security reviewer and adversarial tester

View File

@@ -1,4 +1,4 @@
## Project Overview
# Project Overview
This is the OpenCode agentic configuration for a multi-agent coding workflow. It defines agent roles, permissions, quality pipelines, and project memory conventions used across all projects that load this config.
@@ -10,7 +10,7 @@ This is the OpenCode agentic configuration for a multi-agent coding workflow. It
## Agent Architecture
10 agents with distinct roles, models, and permission profiles. See [Agent Roster in AGENTS.md](../AGENTS.md#agent-roster) for the full table.
10 agents with distinct roles, models, and permission profiles. See [Agent Roster in AGENTS.md](../../AGENTS.md#agent-roster) for the full table.
### Permission Model
@@ -18,7 +18,7 @@ This is the OpenCode agentic configuration for a multi-agent coding workflow. It
- **Memory-only edit access:** `reviewer`, `tester`, `explorer`, `researcher`, `critic`, `sme`, `designer` — these agents have `permission.edit: allow` but are instructed to keep code/source edits read-only. Their edit permission exists solely to support `.memory/*` writes for recording duties (verdicts, discoveries, research, guidance, design decisions).
- **No edit access:** none (all agents can write `.memory/*`).
See [Decision: Agent Memory Write Access](decisions.md#agent-memory-write-access) for rationale and guardrails.
See [Decision: Agent Memory Write Access](../decisions.md#agent-memory-write-access) for rationale and guardrails.
### Memory Write Guardrails
@@ -37,10 +37,4 @@ Tiered pipeline (Tier 1/2/3) defined in `agents/lead.md`. Standard flow: `explor
- `skills/doc-coverage/SKILL.md` section `### 3. Instruction File` validates one canonical instruction file (`AGENTS.md`) plus symlink correctness for `CLAUDE.md`, `.cursorrules`, and `.github/copilot-instructions.md`, rather than treating all four as independently edited files.
- The checklist explicitly flags duplication of `.memory/` tracking content (plans/research) inside instruction files as an anti-pattern.
See [Cross-Tool Instruction Files](../AGENTS.md#cross-tool-instruction-files) and [Doc coverage checklist section 3](../skills/doc-coverage/SKILL.md#3-instruction-file).
## MCP Servers
- **Context7:** Remote documentation lookup (`https://mcp.context7.com/mcp`)
- **GitHub Grep:** Remote code search across public repos (`https://mcp.grep.app`)
- **Playwright:** Local headless Chromium for UI testing
See [Cross-Tool Instruction Files](../../AGENTS.md#cross-tool-instruction-files) and [Doc coverage checklist section 3](../skills/doc-coverage/SKILL.md#3-instruction-file).

View File

@@ -0,0 +1,21 @@
# Error Handling Patterns
## Agent-Level Error Handling
Agents follow the retry circuit breaker pattern defined in `agents/lead.md`:
- After 3 coder rejections on the same task: revisit design, simplify, or consult SME
- After 5 total failures: escalate to user (Tier-3 escalation)
## Memory Write Errors
Agents with memory-only edit access should:
1. Write to `.memory/*` files for their recording duties
2. If write fails, report to lead for escalation
3. Never attempt to modify non-memory files as a workaround
## Quality Gate Failures
- Reviewer `CHANGES-REQUESTED` is a hard block — do not advance to tester
- Reviewer `REJECTED` requires redesign — do not retry same approach
- Tester `PARTIAL` is not a pass — either fix blocker or escalate to user

View File

@@ -0,0 +1,27 @@
# Logging Patterns
## Agent Output Standards
Subagents must return actionable results, not status recaps:
| Agent | Expected Output |
|-------|-----------------|
| Explorer | File maps, edit points, dependency chains |
| Researcher | Specific findings, code patterns, API details |
| Tester | Test results with pass/fail counts and specific failures |
| Reviewer | Structured verdict with findings and resolution status |
## Recording Discipline
Memory files preserve *knowledge*, not *activity logs*:
- ✅ Record: outcomes, decisions, discoveries, patterns
- ❌ Don't record: phase transitions, status changes, ceremony checkpoints
## Verdict Tracking
All reviewer/tester findings must be tracked to resolution:
- Status flow: `OPEN → ASSIGNED → RESOLVED | WONTFIX`
- Findings must not be silently dropped
- Include unresolved findings in coder re-dispatch

View File

@@ -0,0 +1,25 @@
# Testing Patterns
## Verification Tiers
| Tier | Scope | Pipeline |
|------|-------|----------|
| Tier 1 | New features, security-sensitive, multi-file refactors | coder → reviewer:correctness → reviewer:security → tester:standard → tester:adversarial |
| Tier 2 | Moderate changes, UI updates, bug fixes | coder → reviewer:correctness → tester:standard |
| Tier 3 | Single-file fixes, config tweaks, copy changes | coder → reviewer:correctness |
## Functional Verification Requirements
Static analysis is NOT verification. Every feature must be functionally verified:
- **API endpoints**: Real HTTP requests with response verification
- **Frontend**: Browser-based or test-suite verification
- **Full-stack**: End-to-end UI → API → DB → response cycle
- **Bug fixes**: Reproduce bug, verify it no longer occurs
## What Does NOT Count as Verification
- ❌ Type checks (`tsc`, `bun run check`)
- ❌ Linting (`eslint`, `ruff`)
- ❌ Build succeeding
- ❌ Reading code and concluding "this looks correct"

View File

@@ -0,0 +1,22 @@
# Tech Stack
## Core Technologies
| Component | Technology | Notes |
|-----------|------------|-------|
| Runtime | OpenCode CLI | Agentic coding tool |
| Config format | JSONC | `opencode.jsonc` with comments |
| Agent definitions | Markdown + YAML frontmatter | `agents/*.md` |
| Memory system | Markdown + YAML | `.memory/` directory |
## MCP Servers
| Server | Purpose | Endpoint |
|--------|---------|----------|
| Context7 | Remote documentation lookup | `https://mcp.context7.com/mcp` |
| GitHub Grep | Remote code search across public repos | `https://mcp.grep.app` |
| Playwright | Local headless Chromium for UI testing | Local |
## Model Assignments
See [Agent Roster](../../AGENTS.md#agent-roster) for model assignments per agent role.

View File

@@ -0,0 +1,55 @@
name: opencode-config
version: 1
categories:
# System
- path: system.md
description: One-paragraph project overview and elevator pitch
group: system
# Knowledge
- path: knowledge/overview.md
description: Project architecture, agent roles, and quality pipeline
group: knowledge
- path: knowledge/tech-stack.md
description: Technologies, versions, dependencies, and MCP servers
group: knowledge
- path: knowledge/conventions.md
description: Coding style, naming patterns, and file organization
group: knowledge
- path: knowledge/patterns/error-handling.md
description: Error handling and recovery patterns
group: knowledge
- path: knowledge/patterns/testing.md
description: Testing strategies and patterns
group: knowledge
- path: knowledge/patterns/logging.md
description: Logging practices and conventions
group: knowledge
- path: knowledge/domain/concepts.md
description: Domain-specific terminology and workflows
group: knowledge
# Decisions
- path: decisions.md
description: Architecture Decision Records (ADRs)
group: decisions
# Gates
- path: gates/
description: Quality gate records (review and test outcomes per feature)
group: gates
# Plans
- path: plans/agent-memory-write-access.md
description: Plan for enabling memory write access for recording agents
group: plans
# Research
- path: research/
description: Research findings and technical investigations
group: research
# Sessions
- path: sessions/continuity.md
description: Rolling session continuity notes
group: sessions

View File

@@ -0,0 +1,34 @@
# Session Continuity
Rolling notes for maintaining context across sessions.
## Current Focus
<!-- Update this section at session start/end -->
-
## Recent Changes
<!-- Record significant changes with dates -->
| Date | Change |
|------|--------|
| 2026-03-09 | Restructured `.memory/` to nested structure with manifest.yaml index |
## Open Items
<!-- Items to address in future sessions -->
-
## Decisions Pending
<!-- Decisions that need user input or further investigation -->
-
## Notes
<!-- Free-form notes for next session -->

View File

@@ -0,0 +1 @@
OpenCode agentic configuration for multi-agent coding workflows. Defines 10 agent roles with distinct models and permissions, tiered quality pipelines (reviewer → tester), and a persistent memory system for knowledge, decisions, and plans. Used as a global template across all projects. Config lives in `~/.config/opencode/` with agent definitions in `agents/*.md` and cross-tool instructions in `AGENTS.md`.