opencode-config/AGENTS.md
Sergey c3efae6a30
fix(agents): enforce bug-discovery protocol across all subagent layers (#128)
* fix(agents): strengthen bug-discovery protocol in AGENTS.md to MANDATORY

* fix(skills): add bug-discovery triggers to run-pipeline templates A-E

* fix(agents): add bug-discovery section to subagent bodies

* fix(skill): strengthen bug-discovery description for semantic matching

* docs(handoff): scaffold handoff and ADR for bug-discovery protocol

* docs(handoff): set PR number

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-29 18:29:41 +03:00

2 KiB

Global Rules

Orchestrator Model

  • Main chat = planning ONLY. All research, commands, edits, implementation — ONLY via subagents.
  • Never do yourself: filesystem research, grep/glob, bash commands, file edits, tests, git ops.
  • Maximum: high-level plan + reports to user + delegation to task subagents.
  • Pipeline: delegate each phase (ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY) to a subagent.
  • Subagent error → 1 retry, then STOP + report.

Pipeline

Pipeline: ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY. pipeline-status = read-only oracle (NEXT action). merge-pr = orchestrator-safe merge wrapper. Execution via /run-pipeline skill.

Bug Discovery Protocol (MANDATORY)

If you find a bug outside current task scope — you MUST:

  1. Load skill bug-discovery via skill("bug-discovery") tool.
  2. Follow its protocol (check duplicates → create issue → continue task).
  3. Do NOT fix the bug yourself.
  4. Report to orchestrator: "Created issue #N: ...".

This applies to ALL subagents (general, reviewer, docs-reviewer, memory-syncer).

Linear Execution

  • Within a single repository — strictly linear pipeline execution.
  • Cannot start a second pipeline until the first is complete (merge or close).
  • Issues are created by ONE agent at a time (batch creation), not parallel agents.
  • Parallel research (explore agents, 3-4 concurrently) — allowed.
  • Parallel execution (implementation/review/docs) — PROHIBITED.
  • Reason: agents jump between branches → conflicts, lost work, chaos.

Read Path

Before starting a task in a repo: scan filenames in docs/handoff/ (if any) — open relevant ones by topic.

Code Style

  • Follow existing conventions in the repo
  • Load code-standards skill for detailed rules
  • No comments unless explicitly requested
  • Match surrounding code style (imports, naming, patterns)

Tools

Use tools instead of bash. On failure — STOP + report. Deny-list in permission.bash of opencode.json.

Language

  • Always respond to the user in Russian.