* feat: add root AGENTS.md with orchestrator directive * feat(docker): add AGENTS.md bind-mount for global config * docs(handoff): add pr-10 handoff + ADR-011 * docs(handoff): rename pr-10 to pr-31 in filenames * docs(project-map): add root AGENTS.md entry (PR#31) --------- Co-authored-by: opencode-agent <agent@slaid098.dev>
4.2 KiB
4.2 KiB
Global Rules
Orchestrator Model (главное)
- Главный чат = ТОЛЬКО план. Все исследования, команды, edits, реализации — ТОЛЬКО через subagents.
- Никогда не делать самому: research файловой системы, grep/glob, bash-команды, file edits, тесты, git ops.
- Максимум: верхнеуровневый план + отчёты пользователю + делегирование
tasksubagent'ам. - Pipeline: каждую фазу (ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY) делегировать subagent'у.
- Subagent error → 1 retry, потом STOP + report.
Commits
- Language: English only — type, scope, and description all in English
- Format:
type(scope): description— ≤72 chars - Types:
feat,fix,chore,docs,refactor,test,style,perf - Before ANY commit: load
commitskill (skill("commit")), rungit log --oneline -20, match existing style - Break large changes into multiple short commits by logical parts
- No period at end, no body unless necessary
Pull Requests
- Title: на английском, формат
type(scope): what changed— same principle as commits - Body: на русском, в Markdown — сначала что сделано, затем почему (мотивация, контекст)
- Reference issues if applicable
- Before creating PR: load
commitskill, inspectgit difffrom base branch
Development Workflow
All PR work runs through /run-pipeline (7 phases: ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY). Load the run-pipeline skill for the protocol.
- Plan — discuss requirements in chat, understand scope
- Issue — create self-contained GitHub issue (full context, file list, exact content, acceptance criteria, dependencies). Load
issueskill. Via subagent. - Subagent — delegate to
tasksubagent (general type):- Reads issue via
gh issue view N - Branches off default branch, implements per spec, commits, pushes, creates PR with
Closes #N - Creates handoff
docs/handoff/pr-<N>-<slug>.mdand ADR if architectural decision - Follows issue spec exactly — if spec has errors, report them, don't deviate
- Reads issue via
- Review — run docs-reviewer (
@docs-reviewer, pre-merge) then reviewer (@reviewer):- docs-reviewer: updates project map + validates/fixes handoff + ADR, commits to PR branch
- reviewer: posts
## Code Review Summarycomment with verdict APPROVE|REQUEST_CHANGES (does NOT merge)
- Merge or Repeat:
- APPROVE →
merge_prtool (orchestrator-safe, viarun-pipelineskill, after CI ✅) - Issues found → fix subagent (same branch, new commit) → re-loop → merge
- REQUEST_CHANGES → fix subagent → re-review → merge
- APPROVE →
- Memory-sync — run memory-syncer (
@memory-syncer):- Distills gotchas + ADR pointers from merged handoff into
app_data/opencode-memory/repos/{host}/{org}/{repo}.md - Format:
- [YYYY-MM-DD, PR#N] <summary>, receipt always (even if empty) - Calls
memory_save, then guards against accidental commits to main repo
- Distills gotchas + ADR pointers from merged handoff into
Pipeline
Основной pipeline для любой задачи — /run-pipeline в UI opencode. Skill выполняет 7 фаз (ISSUE → IMPLEMENT → DOCS → CI → REVIEW → MERGE → MEMORY) автономно, не импровизируя порядок. merge_pr tool — после CI ✅ (transitive guard в pipeline-status.py).
- Tool
pipeline_status— read-only oracle, возвращает статус + NEXT action. - Tool
merge_pr— orchestrator-safe merge wrapper (replaces rawgh pr merge). - Execution — через
/run-pipeline(command.opencode/commands/run-pipeline.md).
Read Path
Перед началом задачи в репо: просмотри имена файлов в docs/handoff/ (если есть) — открой релевантные по теме.
Code Style
- Follow existing conventions in the repo
- Load
code-standardsskill for detailed rules - No comments unless explicitly requested
- Match surrounding code style (imports, naming, patterns)
Language
- Always respond to the user in Russian.