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 <agent@slaid098.dev>
This commit is contained in:
parent
55a95140cd
commit
1bd541f172
15 changed files with 72 additions and 37 deletions
|
|
@ -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`:
|
||||
|
|
|
|||
|
|
@ -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).
|
||||
|
|
@ -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.
|
||||
5
.opencode/commands/run-pipeline.md
Normal file
5
.opencode/commands/run-pipeline.md
Normal file
|
|
@ -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.
|
||||
|
|
@ -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.
|
||||
5
.opencode/commands/spec.md
Normal file
5
.opencode/commands/spec.md
Normal file
|
|
@ -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.
|
||||
|
|
@ -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 "
|
||||
|
|
|
|||
|
|
@ -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. Скиллы авто-дискаверятся
|
||||
|
|
|
|||
|
|
@ -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 модель делегирования.
|
||||
См. `AGENTS.md` (Development Workflow) и `run-pipeline` skill — все три документа описывают одну и ту же full-subagent модель делегирования.
|
||||
|
|
@ -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)
|
||||
|
|
@ -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 в репо <cwd>.
|
||||
Контекст: запуск spec в репо <cwd>.
|
||||
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.
|
||||
- Стоп на issues — дальше юзер сам /run-pipeline.
|
||||
|
|
@ -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"),
|
||||
},
|
||||
|
|
|
|||
17
docs/decisions/009-pr-29-commands-rename.md
Normal file
17
docs/decisions/009-pr-29-commands-rename.md
Normal file
|
|
@ -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)
|
||||
18
docs/handoff/pr-29-commands-rename.md
Normal file
18
docs/handoff/pr-29-commands-rename.md
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue