opencode-config/AGENTS.md
Sergey f1b8ff94bf
feat(agents): enable create_issue and behavioral rules (#113)
* feat(agents): enable create_issue for subagents

* docs(agents): add bug discovery protocol and linear execution rule

* docs(handoff): add handoff and ADR

* docs(handoff): set PR number

* docs(project-map): update after structural changes

* fix(agents): revert create_issue for read-only subagents

* fix(agents): re-enable create_issue and update tests

---------

Co-authored-by: opencode-agent <agent@opencode.local>
2026-07-29 01:25:30 +03:00

52 lines
No EOL
2.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Global Rules
## Orchestrator Model (главное)
- Главный чат = ТОЛЬКО план. Все исследования, команды, edits, реализации — ТОЛЬКО через subagents.
- Никогда не делать самому: research файловой системы, grep/glob, bash-команды, file edits, тесты, git ops.
- Максимум: верхнеуровневый план + отчёты пользователю + делегирование `task` subagent'ам.
- Pipeline: каждую фазу (ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY) делегировать subagent'у.
- Subagent error → 1 retry, потом 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
Если в процессе работы найден баг вне scope текущей задачи:
1. Проверь `gh issue list` на дубликаты.
2. Создай GitHub issue через `create-issue` tool (НЕ raw `gh issue create`).
3. Title: `fix(scope): краткое описание` на английском.
4. Body: `## Контекст` / `## Задача` / `## Критерии приемки` (на русском).
5. Продолжай текущую задачу. НЕ исправляй баг сам.
6. В отчёте orchestrator'у укажи: "Создан issue #N: ...".
## Linear Execution
- В рамках одного репозитория — строго линейное выполнение pipeline.
- Нельзя запускать второй pipeline, пока не завершён первый (merge или close).
- Issues создаёт ОДИН агент за раз (batch creation), не параллельные агенты.
- Параллельные исследования (explore agents, 3-4 concurrently) — можно.
- Параллельное исполнение (implementation/review/docs) — ЗАПРЕЩЕНО.
- Причина: агенты прыгают между ветками → конфликты, потеря работы, хаос.
## Read Path
Перед началом задачи в репо: просмотри имена файлов в `docs/handoff/` (если есть) — открой релевантные по теме.
## 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
Используй tool вместо bash. При сбое tool — STOP + репорт, НЕ fallback на raw bash, НЕ обход через `gh api`. Deny-список — в `permission.bash` файла `opencode.json`.
## Language
- Always respond to the user in Russian.