docs(agents): restore Orchestrator Model section and slim tool policy
This commit is contained in:
parent
c1f3b4d519
commit
d8940de4f6
1 changed files with 12 additions and 29 deletions
41
AGENTS.md
41
AGENTS.md
|
|
@ -1,12 +1,17 @@
|
|||
# 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
|
||||
|
||||
Главный чат = только план. Все исследования, edits, git ops — через subagents.
|
||||
Pipeline: ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY — каждая
|
||||
фаза делегируется subagent'у. `pipeline-status` = read-only oracle (NEXT action).
|
||||
`merge-pr` = orchestrator-safe merge wrapper. Execution via `/run-pipeline` skill.
|
||||
Subagent error → 1 retry, потом STOP + report.
|
||||
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.
|
||||
|
||||
## Read Path
|
||||
|
||||
|
|
@ -19,31 +24,9 @@ Subagent error → 1 retry, потом STOP + report.
|
|||
- No comments unless explicitly requested
|
||||
- Match surrounding code style (imports, naming, patterns)
|
||||
|
||||
## Tool Usage Policy
|
||||
## Tools
|
||||
|
||||
Используй tool вместо raw bash. Raw bash-эквиваленты заблокированы deny
|
||||
(`opencode.json:311-314`). При сбое tool — STOP и репорт оркестратору, НЕ
|
||||
fallback на raw bash, НЕ импровизируй обход через `gh api`.
|
||||
|
||||
| Tool | Raw bash (заблокирован deny) | Когда использовать | При сбое — STOP, репорт, НЕ fallback |
|
||||
|---|---|---|---|
|
||||
| `commit({ message })` | `git commit *` | Коммит staged файлов (conventional format валидируется tool'ом) | Сообщи оркестратору, не `git commit` |
|
||||
| `create-pr({ title, body, issue_number })` | `gh pr create *` | Создание PR после push ветки | Сообщи оркестратору, не `gh pr create`, не `gh api repos/*/pulls` |
|
||||
| `create-issue({ title, body, labels })` | `gh issue create *` | Создание GitHub issue (валидация формата) | Сообщи оркестратору, не `gh issue create`, не `gh api repos/*/issues` |
|
||||
| `merge-pr({ pr_number })` | `gh pr merge *` | Merge PR (squash + delete branch, без `--admin`) | Сообщи оркестратору, не `gh pr merge` |
|
||||
| `post-review({ pr_number, verdict, body })` | `gh pr comment` для verdict | Code review verdict (heading `## Code Review Summary` + verdict) | Сообщи оркестратору, не `gh pr comment` |
|
||||
| `post-docs-review({ pr_number, verdict, body })` | `gh pr comment` для verdict | Docs review verdict (heading `## Docs Review Summary` + verdict) | Сообщи оркестратору, не `gh pr comment` |
|
||||
| `pipeline-status({ pr_number })` | `python3 .opencode/scripts/pipeline-status.py` | Read-only oracle: статус фаз PR + NEXT action | Сообщи оркестратору, не bash-запуск скрипта |
|
||||
| `spec-status({})` | `python3 .opencode/scripts/spec-status.py` | Read-only oracle: текущая фаза spec + NEXT action | Сообщи оркестратору, не bash-запуск скрипта |
|
||||
| `memory-doctor()` | — | Read-only диагностика памяти: ripgrep, Python src.memory, env vars, index | Сообщи оркестратору, не raw bash |
|
||||
| `memory-save()` | — | Commit + reindex opencode-memory после записи/редактирования (auto-setup: git init + hook если remote set) | Сообщи оркестратору, не raw bash |
|
||||
| `memory-search({ query, category? })` | — | Гибридный поиск (ripgrep keyword + Python semantic) по opencode-memory | Сообщи оркестратору, не raw bash |
|
||||
| `memory-list({ category? })` | — | Список категорий / файлов opencode-memory | Сообщи оркестратору, не raw bash |
|
||||
| `memory-access({ path })` | — | Отметить memory-файл как прочитанный (bump `last_accessed`/`access_count`) | Сообщи оркестратору, не raw bash |
|
||||
| `tunnel()` | `bash .opencode/scripts/tunnel.sh` | Cloudflare tunnel toggle (1-й вызов — start, 2-й — stop) | Сообщи оркестратору, не bash-запуск скрипта |
|
||||
|
||||
`gh pr comment*` остаётся в allow-list для обратной совместимости (ADR-019
|
||||
отклонил strict-deny). Промпт запрещает fallback при сбое tool.
|
||||
Используй tool вместо bash. При сбое tool — STOP + репорт, НЕ fallback на raw bash, НЕ обход через `gh api`. Deny-список — в `permission.bash` файла `opencode.json`.
|
||||
|
||||
## Language
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue