opencode-config/AGENTS.md
Sergey e954284ec3
docs(config): add Config Edits rule to AGENTS.md, expand configure-opencode (#181)
* docs(agents): add Config Edits rule linking configure-opencode skill

* docs(configure-opencode): expand scope rule to AGENTS, skills, agents, commands

* docs(handoff): scaffold handoff and ADR-078 for config-edits rule

* docs(handoff): set PR number 181 in handoff and ADR-078

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-31 22:01:56 +03:00

56 lines
No EOL
2.4 KiB
Markdown

# 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)
## Config Edits
All opencode config edits (`opencode.json`, `AGENTS.md`, `skills/`, `agents/`, `commands/`) go ONLY in workspace clone `/root/workspace/opencode-config/`, NEVER in `~/.config/opencode/` (bind-mount → edits bypass git → `git pull` conflicts on host). See skill `configure-opencode` for full sync procedure.
## 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.