.agents/skills/oat-project-subagent-implement/SKILL.md
Use when you need parallel execution across eligible plan phases/tasks using autonomous worktrees, review gates, and deterministic merge-back.
npx skillsauth add tkstang/open-agent-toolkit oat-project-subagent-implementInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Drive parallel, worktree-isolated execution of plan tasks with autonomous review gates and deterministic fan-in reconciliation.
Enable an orchestrator agent to:
oat-worktree-bootstrap-auto.All execution is non-interactive between configured HiLL checkpoints.
plan.md.oat-worktree-bootstrap-auto skill available.| Skill | Role in Orchestration |
| ----------------------------- | ------------------------------------------------------------------------ |
| oat-worktree-bootstrap-auto | Creates isolated worktrees per unit |
| oat-project-implement | Single-thread fallback; not used during orchestration |
| oat-project-review-provide | Manual review skill; autonomous gate is a parallel concept |
| oat-project-review-receive | Processes review findings; autonomous gate produces compatible artifacts |
When executing this skill, provide lightweight progress feedback so the user can tell what is happening:
Print a phase banner once at start:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OAT ▸ SUBAGENT IMPLEMENT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Before multi-step work, print concise indicators, for example:
[1/6] Reading plan + identifying units…[2/6] Bootstrapping worktrees…[3/6] Dispatching subagents…[4/6] Running autonomous review gates…[5/6] Reconciling merges…[6/6] Updating artifacts + reporting…plan.md
│
▼
┌─────────────────────────────────────┐
│ 1. Read Plan + Identify Units │
│ - Parse phases/tasks │
│ - Check parallel-safe markers │
│ - Respect HiLL checkpoint gates │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 2. Bootstrap Worktrees │
│ - Per-unit worktree via │
│ oat-worktree-bootstrap-auto │
│ - Branch naming convention │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 3. Dispatch Subagents (parallel) │
│ - Scoped objectives per unit │
│ - File boundary constraints │
│ - Implementation + self-review │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 4. Autonomous Review Gate │
│ - Spec compliance check │
│ - Code quality check │
│ - Fix-loop retry on failure │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 5. Fan-In Reconciliation │
│ - Merge units in task-ID order │
│ - Integration verification │
│ - Conflict classification │
└──────────────┬──────────────────────┘
│
▼
┌─────────────────────────────────────┐
│ 6. Report + Artifact Update │
│ - Update implementation.md │
│ - Update plan.md review rows │
│ - Pause at HiLL checkpoint │
└─────────────────────────────────────┘
Resolve active project via oat config get activeProject (stored in .oat/config.local.json) and read state.md.
Persist required runtime defaults in state.md frontmatter:
oat_execution_mode: subagent-drivenoat_project_state_updated: "{ISO 8601 UTC timestamp}"oat_orchestration_merge_strategy: mergeoat_orchestration_retry_limit: 2oat_orchestration_baseline_policy: strictoat_orchestration_unit_granularity: phaseRead plan.md and classify each phase/task:
Parallelization eligibility:
parallel-safe (or determined by orchestrator to have no file-level dependencies) are fanned out.oat-project-implement).Unit granularity:
HiLL checkpoint gating:
oat_plan_hill_phases from plan.md frontmatter.oat_plan_hill_phases: ["p04"], phases p01-p04 all execute, then orchestrator pauses after p04 completes. Phases p01-p03 have no checkpoint pause.oat_plan_hill_phases: ["p02", "p04"], orchestrator runs p01-p02, pauses after p02 completes, then after approval runs p03-p04 and pauses after p04 completes.For each eligible unit, invoke oat-worktree-bootstrap-auto:
Branch naming convention:
{project-name}/{unit-id}
Example: autonomous-orchestration/p02-t01
Base ref: The orchestration branch (the branch from which the orchestrator runs).
Baseline policy: Configurable per run (default: strict).
If any bootstrap fails under strict policy, exclude that unit and report the failure.
For each bootstrapped unit, dispatch a subagent via the Task tool with:
Scoped objective:
plan.md including steps, files, and verification commands.File boundaries:
Files: section).Context provided to subagent:
Expected deliverables from subagent:
After each implementer subagent completes, run a mandatory reviewer gate as a peer subagent and record the verdict map entry before any merge decision.
Reviewer dispatch mechanism (required):
oat-reviewer as a peer subagent (subagent_type: "oat-reviewer") against the same unit worktree.plan.md, spec.md, design.md when available).code.reviews/{unit-id}-gate-review.mdStage 1: Spec compliance
Stage 2: Code quality
Pass criteria:
Fail handling — fix-loop dispatch (required):
reviews/{unit-id}-gate-review.md)--retry-limit, default 2) is exhausted.failedexcludedVerdict map (source of truth for Step 5):
unit_id: '{unit-id}'
reviewer_stage: spec | quality
verdict: pass | fail
retry_count: N
review_artifact: 'reviews/{unit-id}-gate-review.md'
findings:
critical: []
important: []
medium: []
minor: []
disposition: merged | excluded | skipped
Merge passing units back into the orchestration branch. Before executing any merge, apply the hard pre-merge verdict gate.
Pre-merge verdict gate (required):
For each unit eligible for merge, check its verdict map entry:
skipped, reason review_gate_missing. Refuse merge. Log: "Unit {unit-id} skipped: no reviewer verdict recorded."pass → set disposition to excluded, reason review_gate_failed. Refuse merge. Log: "Unit {unit-id} excluded: reviewer verdict is {verdict}, not pass."pass → unit may proceed to merge.Only units with verdict == pass in the verdict map enter the merge loop below. All other units are reported in the orchestration run log with their disposition and reason.
Merge ordering: Deterministic by task ID (ascending). Example: p02-t01 before p02-t02.
Default strategy: merge
git checkout {orchestration-branch}
git merge --no-ff {unit-branch} -m "merge({unit-id}): {summary}"
Fallback strategy: cherry-pick If merge produces conflicts:
Integration verification (after each merge):
pnpm test
pnpm lint
pnpm type-check
If integration verification fails after a merge:
conflict and report.Conflict classification:
file-level: Same file modified by multiple units.semantic: Different files but conflicting behavior.integration: Individual units pass but combined result fails.Logging is append-only. Each orchestration run appends a new subsection inside implementation.md's ## Orchestration Runs section (between the <!-- orchestration-runs-start --> and <!-- orchestration-runs-end --> markers). Never overwrite or reorder prior run entries.
Template location: .oat/templates/implementation.md includes the ## Orchestration Runs section with sentinel markers. The orchestrator appends new entries before the <!-- orchestration-runs-end --> marker.
Append this block for each run:
### Run {N} — {YYYY-MM-DD HH:MM}
**Branch:** {orchestration-branch}
**Policy:** baseline={policy}, merge={strategy}, retry-limit={N}
**Units:** {N} dispatched, {N} passed, {N} failed, {N} conflicts
#### Unit Outcomes
| Unit | Status | Commits | Tests | Review | Disposition |
| ---- | ------ | ------- | ----- | ------------------------- | ----------- |
| {id} | pass | {sha} | pass | pass | merged |
| {id} | fail | {sha} | pass | fail (quality, retry 2/2) | excluded |
#### Review Interaction Log
**{unit-id}:**
- **Reviewer dispatch:** peer subagent (`oat-reviewer`)
- **Review artifact:** `reviews/{unit-id}-gate-review.md`
- **review_gate_executed:** true
- **Spec compliance:** pass (0 findings)
- **Code quality:** fail → fix → pass (1 Important fixed, retry 1/2)
- **Fix-loop iterations:** 1 of 2 — fixed: [finding-ids]; unresolved: none
- **Verdict:** pass
- **Disposition:** merged
#### Merge Outcomes
| Order | Unit | Strategy | Result | Integration |
| ----- | ---- | ----------- | ------ | ----------- |
| 1 | {id} | merge | clean | tests pass |
| 2 | {id} | cherry-pick | clean | tests pass |
#### Outstanding Items
- {conflict descriptions or manual follow-ups, or "None"}
Dispatch manifest logging: The dispatch script outputs a log_path field pointing to implementation.md so the orchestrator knows where to append run results. This field is informational — the orchestrator reads it and handles the actual write.
Update plan.md review table:
pending → received → fixes_added → fixes_completed → passed.passed with date and artifact reference.Update state.md:
oat_current_task to the next unprocessed task.oat_last_commit to the final merge commit.oat_project_state_updated: "{ISO 8601 UTC timestamp}"HiLL checkpoint pause:
All policies have sensible defaults. Override per-run via CLI flags or persist in state.md when subagent-driven mode is selected.
| Flag | Type | Default | Description |
| -------------------- | --------------------------- | -------- | ------------------------------------------------------------ |
| --merge-strategy | merge | cherry-pick | merge | Default merge strategy for fan-in reconciliation. |
| --retry-limit | integer (0-5) | 2 | Max fix-loop retries per unit before marking failed. |
| --baseline-policy | strict | allow-failing | strict | Passed to oat-worktree-bootstrap-auto for baseline checks. |
| --dry-run | boolean | false | Run plan analysis and unit identification without execution. |
| --unit-granularity | phase | task | phase | Fan-out granularity: phase-level or task-level units. |
| Strategy | Behavior | When to Use |
| ------------- | --------------------------------------------- | --------------------------------------------------------------- |
| merge | git merge --no-ff per unit in task-ID order | Default; clean parallel branches with no overlapping files |
| cherry-pick | Cherry-pick individual commits per unit | Fallback when merge conflicts; finer-grained conflict isolation |
Interaction: If merge fails for a unit, automatically falls back to cherry-pick regardless of the configured strategy. If cherry-pick also fails, the unit is classified as conflict and reported for manual resolution.
| Retry Limit | Behavior |
| ----------- | ---------------------------------------------------------------------- |
| 0 | No retries; first review failure marks unit as failed |
| 1-5 | Dispatch implementer to fix, re-run failed review stage, up to N times |
Interaction with review gate: Each retry dispatches a fresh implementer subagent with the review findings. The same review stage (spec or quality) re-runs. If the stage that previously passed is invalidated by fixes, both stages re-run.
Passed through to oat-worktree-bootstrap-auto. See that skill's policy documentation for details.
| Policy | Orchestration Behavior |
| --------------- | ----------------------------------------------------- |
| strict | Failed bootstrap excludes unit from dispatch |
| allow-failing | Failed bootstrap emits warning; unit still dispatched |
Source of truth: oat_plan_hill_phases in plan.md frontmatter.
Behavior:
oat_plan_hill_phases at the start of each run.oat_plan_hill_phases is empty, default behavior is to pause after every phase boundary (same as oat-project-implement).Key semantic: listed phases are where you stop AFTER completing them, not before. ["p03"] means "complete p03, then pause" — not "pause before starting p03."
Example:
oat_plan_hill_phases: ['p03']
Interaction with parallel execution: HiLL checkpoints partition the plan into "runs". Within each run, phases may execute in parallel if eligible. The checkpoint boundary fires after the listed phase completes — all units up to and including the checkpoint phase must complete before the pause.
When this skill is invoked, subagent-driven mode and orchestration defaults can be persisted in state.md frontmatter:
oat_execution_mode: subagent-driven
oat_orchestration_merge_strategy: merge
oat_orchestration_retry_limit: 2
oat_orchestration_baseline_policy: strict
oat_orchestration_unit_granularity: phase
CLI flags override persisted values for that run and also update the persisted value.
When --dry-run is specified:
The autonomous review gate (Step 4) operates alongside — not in place of — the existing manual review skills (oat-project-review-provide and oat-project-review-receive).
| Review Skill | Scope | Trigger |
| ---------------------------- | ----------------------------------------- | -------------------------------------------------- |
| Autonomous gate (Step 4) | Per-unit (phase or task level) | Automatic after subagent completion |
| oat-project-review-provide | Per-phase, final, or range | User-invoked or oat-project-implement final gate |
| oat-project-review-receive | Processes review findings into plan tasks | User-invoked after review artifact exists |
The autonomous gate is a fast, binary quality check (pass/fail per unit). It does not replace the richer manual review:
Critical/Important/Medium/Minor 4-tier severity model as receive skills, but are limited to what automated checks and spec-diffing can detect.oat-project-review-provide.Autonomous review results update the plan.md Reviews table using the same status lifecycle:
| Autonomous Outcome | plan.md Status |
| ---------------------------------- | ------------------------------------------- |
| All units in scope pass gate | passed (with date and artifact reference) |
| Some units fail, fixes dispatched | fixes_added |
| Fix loop exhausted, units excluded | fixes_completed (excluded units noted) |
Rules:
p01, p02) — not per-task rows.final review row is never set by the autonomous gate. The final row is reserved for the project-wide final review gate managed by oat-project-implement Step 14 or manual invocation of oat-project-review-provide code final.oat-project-review-provide code p02), it may update the same row — the manual review takes precedence.After orchestration completes all phases:
implementation.md and state.md with completion status.final review in plan.md remains pending.oat-project-implement Step 14) must invoke oat-project-review-provide code final separately.Autonomous review verdicts are logged in implementation.md ## Orchestration Runs sections (not as standalone review artifacts in reviews/). If manual follow-up review is needed:
oat-project-review-provide writes its artifact to reviews/ as usual.oat-project-review-receive processes that artifact into plan tasks as usual.implementation.md provides context but does not interfere.AskUserQuestion during execution between HiLL checkpoints.oat-reviewer), not nested or inline.plan.md review table semantics.final review row to passed from the autonomous gate.See examples/ for detailed walkthroughs with plan excerpts and expected artifact output:
| Pattern | File | Description |
| --------------- | ------------------------------------- | -------------------------------------------------------------------------------------- |
| Simple Parallel | examples/pattern-parallel-phases.md | Two independent phases run in parallel and merge cleanly |
| HiLL Checkpoint | examples/pattern-hill-checkpoint.md | Phases run through a checkpoint phase, user reviews after it completes, then continues |
implementation.md with full traceability.plan.md review table updated consistently with existing lifecycle.documentation
Use when OAT implementation changes and repository reference docs must be synchronized. Updates .oat/repo/reference to match current behavior.
business
Merge multiple analysis artifacts into a single coherent report with provenance tracking. Reads existing artifacts from /deep-research, /analyze, and /compare.
testing
Use when the user questions or suspects an agent claim is wrong. Adversarially gathers evidence to verify or refute the claim using the best sources available in the current environment.
tools
Use when prioritizing backlog work or evaluating a roadmap. Produces value-effort ratings, dependency mapping, and execution recommendations.