From d06a5262567f3c7109f4223317b5f348499a5fbc Mon Sep 17 00:00:00 2001 From: Paul O'Reilly Date: Wed, 29 Jul 2026 09:09:52 +1200 Subject: [PATCH] feat(templates): sync 4 workflow templates from agent-runtimes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add direct-impl-sonnet@1, plan-review-loop@1, spec-review-loop@1, test-write-review-loop@1 — present in agent-runtimes but missing here. These are needed before agent-runtimes drops its baked-in copies and the CP loads workflow templates exclusively from this CRS repo. --- .../workflow/direct-impl-sonnet@1.yaml | 47 ++++++ .../workflow/plan-review-loop@1.yaml | 128 ++++++++++++++++ .../workflow/spec-review-loop@1.yaml | 137 ++++++++++++++++++ .../workflow/test-write-review-loop@1.yaml | 68 +++++++++ 4 files changed, 380 insertions(+) create mode 100644 task-templates/workflow/direct-impl-sonnet@1.yaml create mode 100644 task-templates/workflow/plan-review-loop@1.yaml create mode 100644 task-templates/workflow/spec-review-loop@1.yaml create mode 100644 task-templates/workflow/test-write-review-loop@1.yaml diff --git a/task-templates/workflow/direct-impl-sonnet@1.yaml b/task-templates/workflow/direct-impl-sonnet@1.yaml new file mode 100644 index 0000000..b4e6818 --- /dev/null +++ b/task-templates/workflow/direct-impl-sonnet@1.yaml @@ -0,0 +1,47 @@ +name: direct-impl-sonnet +version: 1 +description: | + Direct Sonnet implementation for items with a well-defined scope that skip + the spec/test/scaffold pipeline. The item description IS the spec; the agent + implements all scope items, runs the project build to verify, and commits. + Use for design-coherence, refactoring, or clearly-scoped multi-file tasks. +runtime: sonnet-impl-narrow +input: + state: ready + tags_required: [] + tags_forbidden: [security-sensitive, algorithmic-large] + required_artifacts: [] +output: + state: impl-complete +scope_budget: + files_modified_max: 20 + lines_diff_max: 500 + wall_clock_seconds_max: 3600 +nodes: + - id: agent + kind: agent + template: code-sonnet-tdd-repo + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + Implement the scope described in this work item. The description lists + exactly what needs to be done — treat it as the authoritative spec. + + Work item title: ${item.title} + Work item UUID: ${item.uuid} + + Steps: + 1. Read the work item description carefully — each numbered point is a + required change. + 2. Implement every change in the repository. For dashboard changes, run + `cd dashboard && npm run build` after each logical group to verify. + 3. Fix any build or lint errors before moving on. + 4. When all changes are in place and the build is green, commit everything + with a clear message referencing the work item title. + + Do not skip items. Do not add unrelated changes. Commit only when the + build is clean. +escalation: + scope_exceeded: replan-spec-opus + agent_bailed: direct-impl-sonnet diff --git a/task-templates/workflow/plan-review-loop@1.yaml b/task-templates/workflow/plan-review-loop@1.yaml new file mode 100644 index 0000000..1f43956 --- /dev/null +++ b/task-templates/workflow/plan-review-loop@1.yaml @@ -0,0 +1,128 @@ +name: plan-review-loop +version: 1 +description: Opus + MiniMax review a plan, Sonnet revises, Haiku judges clean/rework +runtime: code-sonnet-tdd-repo +input: + state: plan-drafted + tags_required: [] + tags_forbidden: [] + required_artifacts: [plan_doc] +output: + state: plan-reviewed +scope_budget: + wall_clock_seconds_max: 7200 # WF-ITER-7: run-level ceiling across ALL iterations — + # must be >= iterations_max * per_iteration_seconds_max + # (5 * 1200 = 6000) plus slack; NOT a per-iteration value + iterations_max: 5 # WF-SCH-19: required whenever loop is set + per_iteration_seconds_max: 1200 +nodes: + - id: review-opus + kind: agent + role: plan-review # M36 v0.6 (bug 69370eda fix) + model: claude-opus-4 + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the plan document for the following concept. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find and read the plan document referenced by this item completely + 3. Review it for CRITICAL and HIGH severity issues: wrong architecture, + missing requirements, unaddressed security implications, unworkable + sequencing + 4. Write your findings to /workspace/.agent-output/review-opus.md + - id: review-minimax + kind: agent + role: plan-review + model: minimax-m2 + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the plan document for the following concept. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find and read the plan document referenced by this item completely + 3. Review it for CRITICAL and HIGH severity issues: wrong architecture, + missing requirements, unaddressed security implications, unworkable + sequencing + 4. Write your findings to /workspace/.agent-output/review-minimax.md + - id: improve-sonnet + kind: agent + role: plan-review + tier: coding + depends_on: [review-opus, review-minimax] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Revise the plan document for the following concept to address both + reviews left on this branch. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Read /workspace/.agent-output/review-opus.md and + /workspace/.agent-output/review-minimax.md + 3. Revise the plan document in place to address every CRITICAL/HIGH + finding from both reviews + 4. Commit the revised plan on this branch + - id: judge-haiku + kind: agent + role: plan-review + model: claude-haiku-4 + depends_on: [improve-sonnet] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Judge the revised plan document for the following concept. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Read the revised plan document + 3. Check whether every CRITICAL/HIGH finding from + /workspace/.agent-output/review-opus.md and + /workspace/.agent-output/review-minimax.md has been addressed + 4. Write exactly CLEAN or NEEDS_REWORK (nothing else, no trailing + punctuation or explanation) to /workspace/.workflow/verdict + - id: judge-gate + kind: script + cmd: scripts/workflow/verdict-gate + depends_on: [judge-haiku] +loop: + body: [review-opus, review-minimax, improve-sonnet, judge-haiku, judge-gate] + condition_node: judge-gate + on_max_reached: escalate +escalation: + scope_exceeded: replan-spec-opus + loop_max_reached: replan-spec-opus # WF-SCH-19/WF-ITER-5: required whenever + # on_max_reached is "escalate" (the default) diff --git a/task-templates/workflow/spec-review-loop@1.yaml b/task-templates/workflow/spec-review-loop@1.yaml new file mode 100644 index 0000000..f653d7c --- /dev/null +++ b/task-templates/workflow/spec-review-loop@1.yaml @@ -0,0 +1,137 @@ +name: spec-review-loop +version: 1 +description: > + Opus + MiniMax review a spec draft, Sonnet revises, Haiku judges clean/rework. + Additive alternative to review-spec-arch-opus@1 / review-spec-arch-airouter@1 — + those single-pass templates remain the default for the spec-draft state; a + project opts into this loop instead via its own triggers.yaml, it does not + replace them. +runtime: code-sonnet-tdd-repo +input: + state: spec-draft + tags_forbidden: [security-sensitive] + required_artifacts: [spec_file] +output: + state: spec-reviewed-arch +scope_budget: + wall_clock_seconds_max: 7200 # must be >= iterations_max * per_iteration_seconds_max + # (5 * 1200 = 6000) plus slack + iterations_max: 5 + per_iteration_seconds_max: 1200 +nodes: + - id: review-opus + kind: agent + role: spec-review # M36 v0.6 (bug 69370eda fix): per-node role replaces + # the ungrounded top-level `runtime: review-loop-repo`. + # Harness resolution: (role, model) → composite. + model: claude-opus-4 + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the spec draft for the following concept. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find the spec file: ls spec/ and look for a file matching the concept title slug + 3. Read the spec file completely + 4. Review it against architectural best practices: + - Are requirements testable and unambiguous? + - Are there security implications not addressed? + - Are interfaces and data contracts clearly defined? + - Are edge cases and failure modes covered? + 5. Write your findings to /workspace/.agent-output/review-opus.md + - id: review-minimax + kind: agent + role: spec-review + model: minimax-m2 + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the spec draft for the following concept. + + **Title**: ${item.title} + + **Original concept**: + ${item.body} + + Steps: + 1. cd /workspace/project + 2. Find the spec file: ls spec/ and look for a file matching the concept title slug + 3. Read the spec file completely + 4. Review it against architectural best practices: + - Are requirements testable and unambiguous? + - Are there security implications not addressed? + - Are interfaces and data contracts clearly defined? + - Are edge cases and failure modes covered? + 5. Write your findings to /workspace/.agent-output/review-minimax.md + - id: improve-sonnet + kind: agent + role: spec-review + tier: coding + depends_on: [review-opus, review-minimax] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Revise the spec file for the following concept to address both reviews + left on this branch. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Find the spec file: ls spec/ and look for a file matching the concept title slug + 3. Read /workspace/.agent-output/review-opus.md and + /workspace/.agent-output/review-minimax.md + 4. Revise the spec file in place to address every finding from both reviews + 5. Commit the revised spec on this branch + - id: judge-haiku + kind: agent + role: spec-review + model: claude-haiku-4 + depends_on: [improve-sonnet] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "spec/auto-draft" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Judge the revised spec file for the following concept. + + **Title**: ${item.title} + + Steps: + 1. cd /workspace/project + 2. Find the spec file: ls spec/ and look for a file matching the concept title slug + 3. Check whether every finding from /workspace/.agent-output/review-opus.md + and /workspace/.agent-output/review-minimax.md has been addressed + 4. Write exactly CLEAN or NEEDS_REWORK (nothing else, no trailing + punctuation or explanation) to /workspace/.workflow/verdict + - id: judge-gate + kind: script + cmd: scripts/workflow/verdict-gate + depends_on: [judge-haiku] +loop: + body: [review-opus, review-minimax, improve-sonnet, judge-haiku, judge-gate] + condition_node: judge-gate + on_max_reached: escalate +escalation: + contract_ambiguous: review-spec-opus + loop_max_reached: review-spec-opus diff --git a/task-templates/workflow/test-write-review-loop@1.yaml b/task-templates/workflow/test-write-review-loop@1.yaml new file mode 100644 index 0000000..2e9b3bb --- /dev/null +++ b/task-templates/workflow/test-write-review-loop@1.yaml @@ -0,0 +1,68 @@ +name: test-write-review-loop +version: 1 +description: > + MiniMax writes tests from skeletons, Sonnet reviews AND judges in one node + (writes its own verdict file — no separate judge node), loop until clean. +runtime: code-sonnet-tdd-repo +input: + state: needs-tests + tags_required: [test-needed] + required_artifacts: [test_file] +output: + state: test-write-pending +scope_budget: + wall_clock_seconds_max: 7200 # must be >= iterations_max * per_iteration_seconds_max + # (5 * 1200 = 6000) plus slack + iterations_max: 5 + per_iteration_seconds_max: 1200 +nodes: + - id: write-minimax + kind: agent + role: test-write-review # M36 v0.6 (bug 69370eda fix): role + model replaces + # the ungrounded `template: minimax-test-writer` + # (a composite that never existed in the catalog). + model: minimax-m2 + runtime_env: + # WF-COMP-15: stage agents share one per-item work branch so their work + # accumulates across iterations. + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + - id: review-sonnet + kind: agent + role: test-write-review + tier: coding + depends_on: [write-minimax] + runtime_env: + AGENT_REPO_URL: "git@gitea.oreillyit.nz-ai-enablement:skynet/agent-runtimes-agents.git" + AGENT_BRANCH: "task/${item.uuid}" + prompt: | + The agent-runtimes project repo is cloned at /workspace/project. + Change to that directory before doing any work. + + Review the tests just written for the following task. + + **Title**: ${artifacts.item_title} + + Steps: + 1. cd /workspace/project + 2. Review the newly-written test file(s) against the task's spec + requirements and the test skeleton they were written from: + - Do the tests actually exercise the required behaviour, not just + call the code? + - Are edge cases and failure modes covered? + - Are assertions specific (not just "no exception raised")? + - Do the tests pass against the current implementation? + 3. If the tests are inadequate, fix them directly on this branch — + you are both reviewer and judge for this loop + 4. Write exactly CLEAN or NEEDS_REWORK (nothing else, no trailing + punctuation or explanation) to /workspace/.workflow/verdict + - id: review-gate + kind: script + cmd: scripts/workflow/verdict-gate + depends_on: [review-sonnet] +loop: + body: [write-minimax, review-sonnet, review-gate] + condition_node: review-gate + on_max_reached: escalate +escalation: + loop_max_reached: fix-test-fixture-sonnet