From 1bd541f172e24c3257268a8e076d105abf42a712 Mon Sep 17 00:00:00 2001 From: Sergey <93754860+slaid098@users.noreply.github.com> Date: Fri, 24 Jul 2026 00:46:00 +0300 Subject: [PATCH] refactor: commands rename /run-pipeline + /spec (#29) * refactor: rename /pipeline-driver to /run-pipeline + /spec-driver to /spec - Rename command + skill dir + skill() ref for both - Update cross-references in .opencode/ .md files - pipeline_status / spec_status tool names unchanged (independent) - Update project-map README * docs(handoff): add pr-14 handoff + ADR-009 * docs(handoff): set PR number 29 --------- Co-authored-by: opencode-agent --- .opencode/agents/docs-reviewer.md | 2 +- .opencode/agents/reviewer.md | 8 ++++---- .opencode/commands/pipeline-driver.md | 5 ----- .opencode/commands/run-pipeline.md | 5 +++++ .opencode/commands/spec-driver.md | 5 ----- .opencode/commands/spec.md | 5 +++++ .opencode/scripts/check-permissions.py | 2 +- .opencode/skills/add-skill/SKILL.md | 4 ++-- .opencode/skills/issue/SKILL.md | 8 ++++---- .../{pipeline-driver => run-pipeline}/SKILL.md | 6 +++--- .../skills/{spec-driver => spec}/SKILL.md | 14 +++++++------- .opencode/tools/spec-status.ts | 2 +- docs/decisions/009-pr-29-commands-rename.md | 17 +++++++++++++++++ docs/handoff/pr-29-commands-rename.md | 18 ++++++++++++++++++ docs/project-map/README.md | 8 ++++---- 15 files changed, 72 insertions(+), 37 deletions(-) delete mode 100644 .opencode/commands/pipeline-driver.md create mode 100644 .opencode/commands/run-pipeline.md delete mode 100644 .opencode/commands/spec-driver.md create mode 100644 .opencode/commands/spec.md rename .opencode/skills/{pipeline-driver => run-pipeline}/SKILL.md (98%) rename .opencode/skills/{spec-driver => spec}/SKILL.md (97%) create mode 100644 docs/decisions/009-pr-29-commands-rename.md create mode 100644 docs/handoff/pr-29-commands-rename.md diff --git a/.opencode/agents/docs-reviewer.md b/.opencode/agents/docs-reviewer.md index 7063941..f466334 100644 --- a/.opencode/agents/docs-reviewer.md +++ b/.opencode/agents/docs-reviewer.md @@ -117,7 +117,7 @@ After updating project map, validate handoff and ADR files: ## Spec cleanup (post-merge, опционально) -Если `docs/spec/roadmap.md` существует в репо (spec-driver был запущен): +Если `docs/spec/roadmap.md` существует в репо (spec был запущен): 1. Извлеки все `#N` номера issues из `docs/spec/roadmap.md` (regex `#(\d+)`). 2. Для каждого `#N`: `gh issue view N --json state --jq .state`. 3. Если ВСЕ issues имеют `state=CLOSED`: diff --git a/.opencode/agents/reviewer.md b/.opencode/agents/reviewer.md index d6ea000..a4dbe4d 100644 --- a/.opencode/agents/reviewer.md +++ b/.opencode/agents/reviewer.md @@ -1,5 +1,5 @@ --- -description: Global code reviewer. Reviews PRs against project skills and universal code standards. Invoke via @reviewer. Uses gh pr comment to approve or request changes. Does NOT merge — merge is done by main agent via pipeline-driver. +description: Global code reviewer. Reviews PRs against project skills and universal code standards. Invoke via @reviewer. Uses gh pr comment to approve or request changes. Does NOT merge — merge is done by main agent via run-pipeline. mode: subagent temperature: 0.1 steps: 100 @@ -86,7 +86,7 @@ permission: "tail *": allow --- -You are a global code reviewer. Your job: review PRs against project skills and universal code standards, leave GitHub PR reviews as comments. You do NOT merge — merge is done by the main agent via pipeline-driver after CI ✅. +You are a global code reviewer. Your job: review PRs against project skills and universal code standards, leave GitHub PR reviews as comments. You do NOT merge — merge is done by the main agent via run-pipeline after CI ✅. ## Setup @@ -231,7 +231,7 @@ Review body format: ### Verdict: APPROVE ``` -Do NOT attempt merge. Stop. Main agent merges via pipeline-driver after CI ✅. +Do NOT attempt merge. Stop. Main agent merges via run-pipeline after CI ✅. After this command, you MUST respond with your review text only. Do NOT call any more tools. ### If requesting changes (critical issues found): @@ -304,7 +304,7 @@ After this command, you MUST respond with your review text only. Do NOT call any 6. If unsure about something → NEEDS_DISCUSSION, don't guess. 7. After `gh pr comment` (APPROVE or REQUEST_CHANGES), STOP. Respond with final text only. ANY further tool call is a protocol violation. - Main agent merges via pipeline-driver. + Main agent merges via run-pipeline. 8. After `gh pr comment` with REQUEST_CHANGES, STOP. Do not merge. 9. Для получения login автора PR используй `gh pr view --json author` (НЕ `gh api user` — broad API call, не в allow-list, вызывает doom-loop). 10. Для debug-вывода используй `pwd`/`ls`/`cat` — НЕ `echo` (не в allow-list). \ No newline at end of file diff --git a/.opencode/commands/pipeline-driver.md b/.opencode/commands/pipeline-driver.md deleted file mode 100644 index 533d494..0000000 --- a/.opencode/commands/pipeline-driver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -description: Run pipeline-driver — autonomous 7-phase PR pipeline -agent: build ---- -Load the `pipeline-driver` skill via `skill({name: "pipeline-driver"})` and follow its ПРОТОКОЛ strictly. Each iteration: call `pipeline_status` tool, execute the `NEXT:` action it returns, repeat until COMPLETE or STOP. Полностью автономно — 1 строка прогресса после каждой фазы, STOP на AMBIGUOUS/error. \ No newline at end of file diff --git a/.opencode/commands/run-pipeline.md b/.opencode/commands/run-pipeline.md new file mode 100644 index 0000000..602801f --- /dev/null +++ b/.opencode/commands/run-pipeline.md @@ -0,0 +1,5 @@ +--- +description: Run pipeline — autonomous 7-phase PR pipeline +agent: build +--- +Load the `run-pipeline` skill via `skill({name: "run-pipeline"})` and follow its ПРОТОКОЛ strictly. Each iteration: call `pipeline_status` tool, execute the `NEXT:` action it returns, repeat until COMPLETE or STOP. Полностью автономно — 1 строка прогресса после каждой фазы, STOP на AMBIGUOUS/error. \ No newline at end of file diff --git a/.opencode/commands/spec-driver.md b/.opencode/commands/spec-driver.md deleted file mode 100644 index af7d7cc..0000000 --- a/.opencode/commands/spec-driver.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -description: Run spec-driver — interactive spec generation for new project -agent: build ---- -Load the `spec-driver` skill via `skill({name: "spec-driver"})` and follow its ПРОТОКОЛ strictly. Главный агент — оркестратор: `spec_status` tool (read-only) + вопрос юзеру + task(general) делегирование. Не делает edit/memory_search/gh сам. Каждая фаза = 1 subagent. Стоп на issues — дальше юзер сам /pipeline-driver. \ No newline at end of file diff --git a/.opencode/commands/spec.md b/.opencode/commands/spec.md new file mode 100644 index 0000000..0f44002 --- /dev/null +++ b/.opencode/commands/spec.md @@ -0,0 +1,5 @@ +--- +description: Run spec — interactive spec generation for new project +agent: build +--- +Load the `spec` skill via `skill({name: "spec"})` and follow its ПРОТОКОЛ strictly. Главный агент — оркестратор: `spec_status` tool (read-only) + вопрос юзеру + task(general) делегирование. Не делает edit/memory_search/gh сам. Каждая фаза = 1 subagent. Стоп на issues — дальше юзер сам /run-pipeline. \ No newline at end of file diff --git a/.opencode/scripts/check-permissions.py b/.opencode/scripts/check-permissions.py index 09506e2..a26b083 100755 --- a/.opencode/scripts/check-permissions.py +++ b/.opencode/scripts/check-permissions.py @@ -29,7 +29,7 @@ DANGEROUS_PATTERNS = [ ), ( r"^gh pr merge\*?$", - "merge is done by main agent via pipeline-driver, not subagents. " + "merge is done by main agent via run-pipeline, not subagents. " "Use 'gh pr merge' from primary build/plan agent only (global " "opencode.json:195 has 'gh pr merge*: allow'). Per-agent 'gh pr " "merge*: deny' is the defense (see ADR-016). See ADR-006 for " diff --git a/.opencode/skills/add-skill/SKILL.md b/.opencode/skills/add-skill/SKILL.md index 8582566..4df9f1d 100644 --- a/.opencode/skills/add-skill/SKILL.md +++ b/.opencode/skills/add-skill/SKILL.md @@ -47,11 +47,11 @@ description: <когда загружать. Триггеры на русско ├── get-project-map/SKILL.md ├── issue/SKILL.md ├── memory/SKILL.md -├── pipeline-driver/SKILL.md +├── run-pipeline/SKILL.md ├── python-development/SKILL.md ├── repo-init/SKILL.md ├── run-tests/SKILL.md -└── spec-driver/SKILL.md +└── spec/SKILL.md ``` ## 3. Скиллы авто-дискаверятся diff --git a/.opencode/skills/issue/SKILL.md b/.opencode/skills/issue/SKILL.md index fd3c688..98128c8 100644 --- a/.opencode/skills/issue/SKILL.md +++ b/.opencode/skills/issue/SKILL.md @@ -83,7 +83,7 @@ Issue создаёт **subagent** (general type), а не основной аг 4. Запусти `gh issue create --title "..." --body "..."` (labels — см. guidance ниже) 5. Верни URL созданного issue основному агенту -Main agent НЕ пишет body и НЕ запускает `gh issue create` — всё через subagent. Это согласовано с `pipeline-driver` skill (Phase 0: "через subagent с `issue` skill") и `AGENTS.md` (Dev Workflow, step 2: "delegate to `task` subagent"). +Main agent НЕ пишет body и НЕ запускает `gh issue create` — всё через subagent. Это согласовано с `run-pipeline` skill (Phase 0: "через subagent с `issue` skill") и `AGENTS.md` (Dev Workflow, step 2: "delegate to `task` subagent"). ## Пример хорошего issue @@ -146,12 +146,12 @@ Label выбирай по типу задачи (совпадает с commit `t ## Полный workflow -После создания issue, цикл продолжается (см. `pipeline-driver` skill для деталей PR процесса): +После создания issue, цикл продолжается (см. `run-pipeline` skill для деталей PR процесса): -1. **Subagent** — `task(general)` читает issue, реализует, коммитит, push, создаёт PR. Оркестрация — через `pipeline-driver` skill. +1. **Subagent** — `task(general)` читает issue, реализует, коммитит, push, создаёт PR. Оркестрация — через `run-pipeline` skill. 2. **Docs review** — `@docs-reviewer` subagent валидирует handoff + ADR, обновляет project map (pre-merge). 3. **Code review** — `@reviewer` subagent ревьюит PR (diff, skills, standards), постит `## Code Review Summary` комментарий. 4. **Merge or Repeat** — APPROVE → `gh pr merge N --squash --delete-branch` (после CI ✅); замечания → fix subagent → re-review → merge. 5. **Memory-sync** — `@memory-syncer` дистиллирует handoff + ADR в `app_data/opencode-memory/repos/{host}/{org}/{repo}.md`. -См. `AGENTS.md` (Development Workflow) и `pipeline-driver` skill — все три документа описывают одну и ту же full-subagent модель делегирования. \ No newline at end of file +См. `AGENTS.md` (Development Workflow) и `run-pipeline` skill — все три документа описывают одну и ту же full-subagent модель делегирования. \ No newline at end of file diff --git a/.opencode/skills/pipeline-driver/SKILL.md b/.opencode/skills/run-pipeline/SKILL.md similarity index 98% rename from .opencode/skills/pipeline-driver/SKILL.md rename to .opencode/skills/run-pipeline/SKILL.md index e0b7190..45dc77c 100644 --- a/.opencode/skills/pipeline-driver/SKILL.md +++ b/.opencode/skills/run-pipeline/SKILL.md @@ -1,9 +1,9 @@ --- -name: pipeline-driver +name: run-pipeline description: Автономный исполнитель PR-пайплайна. Делегирует 7 фаз subagent'ам, не импровизирует порядок, не мержит при красном CI. --- -# Pipeline Driver +# Run Pipeline Автономная процедура-loop для проведения PR через 7 фаз. Source of truth для порядка и действий — `pipeline_status` tool. @@ -98,7 +98,7 @@ Review PR#M в текущем репо. 5. Оставь review как PR comment (НЕ `gh pr review --approve` — GitHub блокирует self-approve): `gh pr comment M --body "## Code Review Summary\n...\n### Verdict: APPROVE|REQUEST_CHANGES"`. -6. НЕ МЕРДЖИТЬ — merge делает основной агент через pipeline-driver. + 6. НЕ МЕРДЖИТЬ — merge делает основной агент через run-pipeline. ``` ### Template D (fix_ci) diff --git a/.opencode/skills/spec-driver/SKILL.md b/.opencode/skills/spec/SKILL.md similarity index 97% rename from .opencode/skills/spec-driver/SKILL.md rename to .opencode/skills/spec/SKILL.md index f884fc1..033aa87 100644 --- a/.opencode/skills/spec-driver/SKILL.md +++ b/.opencode/skills/spec/SKILL.md @@ -1,13 +1,13 @@ --- -name: spec-driver +name: spec description: Автономный исполнитель spec-генерации для нового проекта. Детерминированно ведёт агента по 9 фазам через spec_status tool. Главный агент — оркестратор, делегирует ВСЮ работу subagent'ам. Also when user says "создай спеку", "новый проект", "спецификация проекта", "spec", "project spec". --- -# Spec Driver +# Spec Автономная процедура-loop для генерации спецификации нового проекта. Source of truth для порядка и действий — `spec_status` tool. На выходе — `docs/spec/` -(директория с файлами по фазам) + N GitHub issues, готовых для `/pipeline-driver`. +(директория с файлами по фазам) + N GitHub issues, готовых для `/run-pipeline`. ## ПРОТОКОЛ (ЖЁСТКО) @@ -29,7 +29,7 @@ truth для порядка и действий — `spec_status` tool. На в - Главному агенту: edit/write/read файлов (всё через subagent), memory_search (через subagent), gh issue create (через subagent). - Формулировать вопросы не из question templates ниже. - Предлагать стек вне hardcoded default stack по типу проекта. -- Запускать /pipeline-driver (стоп на issues — дальше юзер сам). +- Запускать /run-pipeline (стоп на issues — дальше юзер сам). ### Остановы @@ -188,7 +188,7 @@ Prompt template I (см. ниже, create issues). ``` Spec complete. Issues: #N1, #N2, ... -Запусти /pipeline-driver для issue #<первый> чтобы начать реализацию. +Запусти /run-pipeline для issue #<первый> чтобы начать реализацию. ``` ## Prompt templates @@ -196,7 +196,7 @@ Spec complete. Issues: #N1, #N2, ... ### Template A (detect / Phase 0) ``` -Контекст: запуск spec-driver в репо . +Контекст: запуск spec в репо . 1. `git rev-parse --show-toplevel` → repo root. 2. Если docs/spec/meta.md существует → прочитай frontmatter, верни phase/status. 3. Если нет → создай docs/spec/meta.md с frontmatter: @@ -321,4 +321,4 @@ Default stack для типа (хардкод, добавить всегда): - После каждой фазы → 1 строка прогресса юзеру. - Если subagent error → 1 retry, потом STOP + report пользователю. - Главный агент = оркестратор: `spec_status` tool + вопрос юзеру + task(general) делегирование. Не делает edit/memory_search/gh сам. -- Стоп на issues — дальше юзер сам /pipeline-driver. \ No newline at end of file +- Стоп на issues — дальше юзер сам /run-pipeline. \ No newline at end of file diff --git a/.opencode/tools/spec-status.ts b/.opencode/tools/spec-status.ts index 5a7aa60..4033418 100644 --- a/.opencode/tools/spec-status.ts +++ b/.opencode/tools/spec-status.ts @@ -3,7 +3,7 @@ import path from "path" import { tool } from "@opencode-ai/plugin" export default tool({ - description: "Spec status oracle. Returns current phase + NEXT action for spec-driver. Call BEFORE any spec action. Read-only. Returns DONE on phase complete, NOT_DONE on missing section, AMBIGUOUS on parse error.", + description: "Spec status oracle. Returns current phase + NEXT action for the spec command. Call BEFORE any spec action. Read-only. Returns DONE on phase complete, NOT_DONE on missing section, AMBIGUOUS on parse error.", args: { validate: tool.schema.boolean().optional().describe("If true, show all phases detail"), }, diff --git a/docs/decisions/009-pr-29-commands-rename.md b/docs/decisions/009-pr-29-commands-rename.md new file mode 100644 index 0000000..76b3602 --- /dev/null +++ b/docs/decisions/009-pr-29-commands-rename.md @@ -0,0 +1,17 @@ +# ADR-009: Commands rename to verbs (PR #29) + +## Статус +Accepted + +## Контекст +Commands /pipeline-driver and /spec-driver — nouns, should be verbs (imperative). /opencode-config → /configure-opencode done in #12. + +## Решение +- /pipeline-driver → /run-pipeline +- /spec-driver → /spec +- Cross-references updated +- Tool names unchanged (independent) + +## Альтернативы +- Keep noun names — отклонено (commands should be verbs per convention) +- Rename tools too — отклонено (tools independent, renaming breaks pipeline_status oracle) \ No newline at end of file diff --git a/docs/handoff/pr-29-commands-rename.md b/docs/handoff/pr-29-commands-rename.md new file mode 100644 index 0000000..b8dcce9 --- /dev/null +++ b/docs/handoff/pr-29-commands-rename.md @@ -0,0 +1,18 @@ +# PR #29: Commands rename /run-pipeline + /spec + +## Что сделано +- Rename: /pipeline-driver → /run-pipeline (command + skill dir + skill() ref) +- Rename: /spec-driver → /spec (command + skill dir + skill() ref) +- Updated cross-references in .opencode/ .md files +- pipeline_status / spec_status tool names NOT changed (independent) + +## Почему +Commands should be verbs (imperative), not nouns. /run-pipeline, /spec — clearer user actions. + +## Pending +- AGENTS.md references to /pipeline-driver — обновляется в #10 (orchestrator AGENTS.md) +- pipeline-driver skill content rewrite — в #16 + +## Watch out +- Tool names (pipeline_status, spec_status) unchanged — independent of command names +- Cross-references updated in .opencode/ .md files \ No newline at end of file diff --git a/docs/project-map/README.md b/docs/project-map/README.md index 72a309c..f9a4254 100644 --- a/docs/project-map/README.md +++ b/docs/project-map/README.md @@ -19,8 +19,8 @@ opencode-config/ │ │ └── reviewer.md # Code review subagent (verdict APPROVE|REQUEST_CHANGES) │ ├── commands/ │ │ ├── configure-opencode.md # /configure-opencode — edit opencode.json -│ │ ├── pipeline-driver.md # /pipeline-driver — 7-phase PR pipeline -│ │ └── spec-driver.md # /spec-driver — 9-phase spec generation +│ │ ├── run-pipeline.md # /run-pipeline — 7-phase PR pipeline +│ │ └── spec.md # /spec — 9-phase spec generation │ ├── skills/ │ │ ├── add-skill/SKILL.md # Create new opencode skill │ │ ├── branch/SKILL.md # Branch naming conventions @@ -30,12 +30,12 @@ opencode-config/ │ │ ├── issue/SKILL.md # GitHub issue creation │ │ ├── memory/SKILL.md # opencode-memory usage guide │ │ ├── configure-opencode/SKILL.md # Canonical rule: write to .opencode/ -│ │ ├── pipeline-driver/SKILL.md # 7-phase pipeline orchestration +│ │ ├── run-pipeline/SKILL.md # 7-phase pipeline orchestration │ │ ├── python-development/SKILL.md # Python dev patterns │ │ ├── release/SKILL.md # Tag + GitHub Release │ │ ├── repo-init/SKILL.md # New repository bootstrap │ │ ├── run-tests/SKILL.md # Test runner guide -│ │ └── spec-driver/SKILL.md # 9-phase spec generation +│ │ └── spec/SKILL.md # 9-phase spec generation │ ├── tools/ │ │ ├── pipeline-status.ts # pipeline_status tool wrapper │ │ └── spec-status.ts # spec_status tool wrapper