.agents/skills/oat-project-implement/SKILL.md
Use when plan.md is ready for execution. Implements plan tasks sequentially with TDD discipline and state tracking.
npx skillsauth add tkstang/open-agent-toolkit oat-project-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.
Execute the implementation plan task-by-task with full state tracking.
Required: Complete implementation plan. If missing, run the oat-project-plan skill first.
OAT MODE: Implementation
Purpose: Execute plan tasks with TDD discipline, track progress, handle blockers.
CRITICAL — Bookkeeping commits are mandatory, not optional.
After every code commit and after every phase/review-fix completion, you MUST commit the OAT tracking files (implementation.md, state.md, plan.md) as a separate bookkeeping commit. Do not defer, batch, or skip these commits under the reasoning that they "aren't related to the implementation." Skipping a bookkeeping commit is the primary cause of cross-session state drift and will cause the next implementation run to fail bookkeeping cross-checks. If bookkeeping commits feel frequent, that is the intended design — they are cheap and they prevent drift.
When executing this skill, provide lightweight progress feedback so the user can tell what’s happening after they confirm.
Print a phase banner once at start using horizontal separators, e.g.:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ OAT ▸ IMPLEMENT ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For each task, announce a compact header before doing work:
OAT ▸ IMPLEMENT {task_id}: {task_name}Before multi-step “bookkeeping” work (updating artifacts/state, verification, committing, dashboard refresh), print 2–5 short step indicators, e.g.:
[1/4] Updating implementation.md + state.md…[2/4] Running verification…[3/4] Committing…[4/4] Refreshing dashboard…For long-running operations (tests/lint/type-check/build, reviews, large diffs), print a start line and a completion line (duration optional).
Keep it concise; don’t print a line for every shell command.
BLOCKED Activities:
ALLOWED Activities:
Self-Correction Protocol: If you catch yourself:
Recovery:
OAT stores active project context in .oat/config.local.json (activeProject, local-only).
PROJECT_PATH=$(oat config get activeProject 2>/dev/null || true)
PROJECTS_ROOT="${OAT_PROJECTS_ROOT:-$(oat config get projects.root 2>/dev/null || echo ".oat/projects/shared")}"
PROJECTS_ROOT="${PROJECTS_ROOT%/}"
If PROJECT_PATH is missing/invalid:
{project-name}PROJECT_PATH to ${PROJECTS_ROOT}/{project-name}mkdir -p .oat
oat config set activeProject "$PROJECT_PATH"
If PROJECT_PATH is valid: derive {project-name} as the directory name (basename of the path).
Read execution mode from "$PROJECT_PATH/state.md" frontmatter:
EXEC_MODE=$(grep "^oat_execution_mode:" "$PROJECT_PATH/state.md" 2>/dev/null | awk '{print $2}')
EXEC_MODE="${EXEC_MODE:-single-thread}"
If EXEC_MODE is subagent-driven:
Execution mode is subagent-driven. Use oat-project-subagent-implement instead.cat "$PROJECT_PATH/plan.md" | head -10 | grep "oat_status:"
Required frontmatter:
oat_status: completeoat_ready_for: oat-project-implementIf not complete: Block and ask user to finish plan first.
Read "$PROJECT_PATH/plan.md" completely to understand:
Read oat_plan_hill_phases from "$PROJECT_PATH/plan.md" frontmatter when present and validate it.
["p01","p03"])Determine whether this is a first implementation run:
"$PROJECT_PATH/implementation.md" does not exist, treat as first run.Before presenting the checkpoint prompt to the user, check if a workflow preference has been configured:
HILL_DEFAULT=$(oat config get workflow.hillCheckpointDefault 2>/dev/null || true)
HILL_DEFAULT is every: Skip the prompt. Write oat_plan_hill_phases: [] to plan.md frontmatter. Print: HiLL checkpoints: every phase (from workflow.hillCheckpointDefault). Continue to Touchpoint A.HILL_DEFAULT is final: Skip the prompt. Determine the final phase ID from plan.md (e.g., p05) and write oat_plan_hill_phases: ["<final_phase_id>"] to plan.md frontmatter. Print: HiLL checkpoints: final phase only (from workflow.hillCheckpointDefault). Continue to Touchpoint A.This preference check only applies on first runs — resuming implementations should trust the existing oat_plan_hill_phases value in plan.md (or repair as bookkeeping drift).
Prompt behavior:
oat_plan_hill_phases value is the normal unconfirmed state; if a value is already present, treat it as a provisional value to confirm rather than as final.oat_plan_hill_phases is valid: do not re-ask; print active checkpoint config and continue.oat_plan_hill_phases is missing/invalid: treat this as bookkeeping drift, because implementation should already have written the confirmed value before prior task execution. Ask the user to repair the checkpoint configuration before continuing.Required prompt shape for first-run confirmation:
This plan has {phase_count} phases. Final phase: {final_phase_id}.p01 — {short phase summary}p02 — {short phase summary}oat_plan_hill_phases already contains a provisional value.Which checkpoint behavior do you want?1. Stop after each phase (default)2. Stop after specific phases, e.g. p02, p053. Stop only after the final phase is completed1 -> []2 -> user-specified array such as ["p02","p05"]3 -> ["p07"] (replace p07 with the actual final phase ID for this plan)oat_plan_hill_phases value already exists, mention it after presenting the three options, but still require the user to choose or confirm one of them.When user confirms/changes:
"$PROJECT_PATH/plan.md" frontmatter oat_plan_hill_phases to the confirmed value before executing tasks.After checkpoint behavior is confirmed, resolve auto-review preference:
.oat/config.json autoReviewAtCheckpoints (default: false)true: Skip the prompt. Write oat_auto_review_at_checkpoints: true to plan.md frontmatter. Print: "Auto-review at checkpoints: enabled (from config)."false or absent: Add one question after the checkpoint choice:
4. Auto-review at checkpoints?
- yes: automatically spawn a subagent code review when a checkpoint phase completes
- no (default): manual review triggering (current behavior)
oat_auto_review_at_checkpoints: true|false to plan.md frontmatter alongside oat_plan_hill_phases.On resume: If oat_auto_review_at_checkpoints is already present in plan.md frontmatter, skip Touchpoint A entirely — do not re-ask, do not re-read config, do not print the auto-review note. The stored value is authoritative.
Check if implementation already started:
cat "$PROJECT_PATH/implementation.md" 2>/dev/null | head -20
If exists and has progress:
oat_current_task_id from frontmatter (e.g., "p01-t03" or "prev1-t01")p-revN phases and prevN-tNN task IDs are treated identically to standard pNN phases and pNN-tNN tasks for execution purposes. The implement skill does not need special handling — it just follows the plan sequentially.oat_current_task_id points at a task already marked completed in the body, advance to the next incomplete task (first pending / in_progress / blocked entry).Resuming from {task_id}. Do not prompt.fresh=true (argument), warn Starting fresh — this will overwrite implementation.md. Any draft logs will be lost. and proceed with fresh initialization. Do not offer fresh start interactively; it is a rare edge case reserved for corrupt state or deliberate plan rewrites.Stale-state reconciliation (approval required):
plan.md Reviews status with implementation.md + state.md.plan.md shows a scope as passed but implementation.md / state.md still says "awaiting re-review" (or leaves oat_current_task_id / oat_current_task as null while future plan tasks are still incomplete), treat this as bookkeeping drift.implementation.md frontmatter oat_current_task_id: {next_task_id}state.md frontmatter oat_current_task: {next_task_id} and refresh stale "awaiting re-review" wordingIf doesn't exist:
Important: Never overwrite an existing implementation.md without explicit user confirmation (and warn that draft logs will be lost).
Copy template: .oat/templates/implementation.md → "$PROJECT_PATH/implementation.md"
Update frontmatter:
---
oat_status: in_progress
oat_ready_for: null
oat_blockers: []
oat_last_updated: { today }
oat_current_task_id: p01-t01 # Stable task ID from plan
---
Initialize project state so other skills (e.g., oat-project-progress) reflect that implementation has started:
"$PROJECT_PATH/state.md" frontmatter:
oat_phase: implementoat_phase_status: in_progressoat_current_task: p01-t01oat_project_state_updated: "{ISO 8601 UTC timestamp}"For the current task in plan.md:
5a. Announce task:
Starting {task_id}: {Task Name}
Files: {file list}
5b. Follow steps exactly:
5c. Apply TDD discipline:
5d. Handle issues:
After task verification passes:
git add {files from plan}
git commit -m "{commit message from plan}"
Store commit SHA for implementation.md.
After each task:
Update frontmatter:
oat_current_task_id: { next_task_id } # e.g., p01-t02
oat_last_updated: { today }
Update task entry:
### Task {task_id}: {Task Name}
**Status:** completed
**Commit:** {sha}
**Outcome (required):**
- {2-5 bullets describing what materially changed}
**Files changed:**
- `{path}` - {why}
**Verification:**
- Run: `{command(s)}`
- Result: {pass/fail + notes}
**Notes / Decisions:**
- {gotchas, trade-offs, design deltas}
Update progress overview table.
Keep project state in sync after each task (recommended source of truth for “where are we?” across sessions):
"$PROJECT_PATH/state.md" frontmatter:
oat_phase: implementoat_phase_status: in_progressoat_current_task: {next_task_id}oat_last_commit: {sha}oat_project_state_updated: "{ISO 8601 UTC timestamp}"Bookkeeping commit (required):
DO NOT SKIP. This commit prevents state drift across sessions.
After the code commit (Step 6) and state updates above, commit all modified OAT tracking files:
git add "$PROJECT_PATH/implementation.md" "$PROJECT_PATH/state.md" "$PROJECT_PATH/plan.md"
git diff --cached --quiet || git commit -m "chore(oat): update tracking artifacts for {task_id}"
Do not use git add -A or glob patterns. Only commit the three OAT project files listed above.
If executing review-generated tasks (task title prefixed with (review)):
implementation.md stays accurate:
plan.md internally consistent:
## Implementation Complete contains phase/task totals, update totals when review fix tasks are added (via oat-project-review-receive) or removed.fixes_added.fixes_completed (not passed).passed after a re-review is run and processed via oat-project-review-receive with no Critical/Important findings.Review-fix completion bookkeeping (required):
When you complete the last outstanding review-fix task:
plan.md ## Reviews row from fixes_added → fixes_completed and set Date to {today}.
fixes_added, ask the user which scope you just addressed (or choose the matching phase if obvious).plan.md ## Implementation Complete totals (phase counts + total tasks) so summaries reflect the additional fix work.implementation.md so it’s unambiguous that tasks are complete and the project is awaiting re-review:
oat_current_task_id: null (reviews are not tasks){PROJECT_PATH}/state.md to reflect the correct “awaiting re-review” posture:
oat_phase: implementoat_phase_status: in_progress (until the re-review passes)oat_current_task: nulloat_project_state_updated: “{ISO 8601 UTC timestamp}”Bookkeeping commit (required):
DO NOT SKIP. This commit prevents state drift across sessions.
After completing the review-fix checklist above, commit all modified OAT tracking files:
git add "$PROJECT_PATH/implementation.md" "$PROJECT_PATH/state.md" "$PROJECT_PATH/plan.md"
git diff --cached --quiet || git commit -m "chore(oat): update tracking artifacts for {task_id}"
Do not use git add -A or glob patterns. Only commit the three OAT project files listed above.
When all tasks in current plan phase complete (e.g., all p01-* tasks done):
Update frontmatter:
oat_current_task_id: { first_task_of_next_phase } # e.g., p02-t01
Plan phase checkpoint:
At the end of each plan phase (p01, p02, etc.), check oat_plan_hill_phases in plan.md to decide whether to pause:
oat_plan_hill_phases is empty ([]): Pause after every phase (default behavior after confirmation).oat_plan_hill_phases has values: Pause only after completing a listed phase.
["p01", "p04"] → pause after p01 completes and after p04 completes; skip p02, p03.["p03"] where p03 is the last phase → run all phases without pausing, then pause after p03 (end of implementation).oat_plan_hill_phases is missing at a phase boundary: treat this as bookkeeping drift and stop to repair it before continuing, because the confirmation should already have been written during the first implementation run.Key semantic: listed phases are where you stop AFTER completing them, not before. ["p03"] means "complete p03, then pause" — not "pause before starting p03."
Auto-review at checkpoints (Touchpoint B):
Before pausing at a checkpoint, check if auto-review is enabled:
Read oat_auto_review_at_checkpoints from plan.md frontmatter. If not present, fall back to .oat/config.json autoReviewAtCheckpoints (default: false).
If enabled and this is a checkpoint phase:
a. Determine review scope: Find the highest completed implementation phase already covered by a passed code-review row in plan.md Reviews table. Count only whole-phase scopes: pNN or pNN-pMM. Ignore task scopes (pNN-tNN) and rows with fixes_added or fixes_completed because those reviews did not pass and must be re-covered. Scope = every implementation phase after that passed coverage through the current phase, inclusive. If no earlier passed whole-phase review exists, start from the first implementation phase. Use pNN-pMM when the scope spans multiple phases. If this is the final implementation phase checkpoint, use scope final.
p01, current checkpoint p03 → review p02-p03p03 → review p01-p03final
b. Spawn subagent review: oat-project-review-provide code {scope} — instruct it to include oat_review_invocation: auto in the review artifact frontmatter.
c. Auto-invoke review-receive: oat-project-review-receive — operates in auto-disposition mode when oat_review_invocation: auto is present:If disabled: skip directly to the checkpoint pause.
When pausing:
Restart safety (required):
implementation.md is persisted and internally consistent:
oat_current_task_id points at the next task to do (or null when complete)Phase summaries (required):
implementation.md for that phase:
Bookkeeping commit (required):
DO NOT SKIP. This commit prevents state drift across sessions.
After phase summary and task pointer advancement, commit all modified OAT tracking files:
git add "$PROJECT_PATH/implementation.md" "$PROJECT_PATH/state.md" "$PROJECT_PATH/plan.md"
git diff --cached --quiet || git commit -m "chore(oat): update tracking artifacts for {phase} completion"
Do not use git add -A or glob patterns. Only commit the three OAT project files listed above.
Note on HiLL types:
oat_hill_checkpoints in state.md): Gates between workflow phases (discovery → spec → design → plan → implement). Checked by oat-project-progress router.oat_plan_hill_phases in plan.md): Gates at plan phase boundaries during implementation. [] means pause after every phase; a populated array pauses only after listed phases. The field may be absent only before the first implementation-run confirmation. Listed phases are where you stop AFTER completing them.Revision phase completion handling:
When all tasks in a p-revN phase complete (revision phases created by oat-project-revise):
oat_phase_status: pr_open (not complete — the PR is still open for further review)oat_current_task: nulloat-project-summary to update summary.md if it exists (implement owns summary re-generation at revision phase completion, not the revise skill)oat-project-revise for more feedback or oat-project-complete when approved."This is different from regular phase completion — revision phases return to pr_open instead of continuing to the next phase, because the user needs to decide whether more revisions are needed.
Continue Steps 5-8 until all plan phases complete.
Batch execution:
If a task cannot be completed:
Mark as blocked:
oat_blockers:
- task_id: { task_id } # e.g., p01-t03
reason: '{description}'
since: { date }
Update task status:
### Task {task_id}: {Task Name}
**Status:** blocked
**Blocker:** {description}
Notify user:
Task {task_id} blocked: {reason}
Options:
1. Resolve blocker and continue
2. Skip task (mark as deferred)
3. Modify plan to address blocker
When all plan tasks are complete (i.e., there is no next incomplete pNN-tNN task):
Update “Final Summary” (required):
oat-project-pr-final, update the ## Final Summary (for PR/docs) section in "$PROJECT_PATH/implementation.md":
Update frontmatter:
---
oat_status: complete
oat_ready_for: null
oat_blockers: []
oat_last_updated: { today }
oat_current_task_id: null
---
Important: oat_current_task_id should never point at an already-completed task. If all tasks are done, set it to null and proceed to the final review gate.
Update "$PROJECT_PATH/state.md" so other skills reflect task completion and review gating:
Frontmatter updates:
oat_current_task: nulloat_last_commit: {final_commit_sha}oat_blockers: []oat_phase: implementoat_phase_status: in_progress (until final review passes)oat_project_state_updated: "{ISO 8601 UTC timestamp}""implement" is in oat_hill_checkpoints: append "implement" to oat_hill_completed arrayNote: Only append to oat_hill_completed when the phase is configured as a HiLL gate.
Update content:
## Current Phase
Implementation - Tasks complete; awaiting final review.
## Progress
- ✓ Discovery complete
- ✓ Specification complete
- ✓ Design complete
- ✓ Plan complete
- ✓ Implementation tasks complete
- ⧗ Awaiting final review
Bookkeeping commit (required):
DO NOT SKIP. This commit prevents state drift across sessions.
After updating state.md to reflect implementation completion, commit all modified OAT tracking files:
git add "$PROJECT_PATH/implementation.md" "$PROJECT_PATH/state.md" "$PROJECT_PATH/plan.md"
git diff --cached --quiet || git commit -m "chore(oat): update tracking artifacts for implementation complete"
Do not use git add -A or glob patterns. Only commit the three OAT project files listed above.
Run project-wide verification:
# Run tests
pnpm test
# Run lint
pnpm lint
# Run type check
pnpm type-check
# Run build
pnpm build
All must pass before proceeding.
At the final plan phase boundary, a code review is required before PR.
Check if final review already completed (preferred source of truth: plan.md Reviews table):
FINAL_ROW=$(grep -E "^\\|\\s*final\\s*\\|" "$PROJECT_PATH/plan.md" 2>/dev/null | head -1)
echo "$FINAL_ROW"
If final review row exists and status is passed:
| final | code | passed | 2026-01-28 | reviews/final-review-2026-01-28.md |echo "$FINAL_ROW" | grep -qE "^\\|\\s*final\\s*\\|.*\\|\\s*passed\\s*\\|" && echo "passed"
If final review is not marked passed:
Workflow preference check (before prompting):
REVIEW_MODEL=$(oat config get workflow.reviewExecutionModel 2>/dev/null || true)
REVIEW_MODEL is subagent: Print Review execution: subagent (from workflow.reviewExecutionModel). Dispatch the review subagent directly via the Task tool. No prompt.REVIEW_MODEL is inline: Print Review execution: inline (from workflow.reviewExecutionModel). Run the review in-context per oat-project-review-provide skill. No prompt.REVIEW_MODEL is fresh-session: This is a soft preference with escape hatch because the agent cannot run the review in a fresh session on the user's behalf. Print the guidance block below, then handle the user's response per the three outcomes listed after it.Fresh-session guidance block (print when REVIEW_MODEL is fresh-session):
Per your config (workflow.reviewExecutionModel: fresh-session), your
preference is to run the review in a fresh session.
Run `oat-project-review-provide code final` in a separate session, then
resume this session when the review is complete.
If you'd like to review here instead:
1) subagent
2) inline
Enter 1 or 2 to run the review here, or press Enter to wait.
Fresh-session response outcomes:
1 → dispatch the subagent review (same behavior as REVIEW_MODEL=subagent).2 → run the review inline (same behavior as REVIEW_MODEL=inline).Standard prompt (when preference is unset):
Offer review options (3-tier capability model):
Implementation complete. Final review required.
Review options:
1. Run review in this session via a subagent (recommended if provider supported)
2. Run review in a fresh session and return to this session to receive review
3. Run review inline
To run in a separate session use: oat-project-review-provide code final
After user chooses:
oat-project-review-provide code final in a separate session, then returns hereoat-project-review-receive to process findingsoat-project-implement skillAfter final review is marked passed:
"$PROJECT_PATH/state.md" frontmatter:
oat_phase: implementoat_phase_status: completeoat_project_state_updated: "{ISO 8601 UTC timestamp}""implement" to oat_hill_completed (only if configured as a HiLL gate)"$PROJECT_PATH/plan.md":
final review row status to passed (if not already)## Implementation Complete totals reflect any review fix tasks that were added"$PROJECT_PATH/implementation.md":
oat_current_task_id: nullAfter final review passes (no Critical/Important findings):
Workflow preference check (before prompting):
POST_IMPL=$(oat config get workflow.postImplementSequence 2>/dev/null || true)
POST_IMPL is wait: Print Post-implementation: wait (from workflow.postImplementSequence). Run follow-up skills manually when ready. Exit without auto-chaining.POST_IMPL is summary: Print Post-implementation: summary (from workflow.postImplementSequence). Invoke oat-project-summary. Stop after summary completes.POST_IMPL is pr: Print Post-implementation: pr (from workflow.postImplementSequence). Invoke oat-project-pr-final (which auto-generates summary.md as part of its flow).POST_IMPL is docs-pr: Print Post-implementation: docs-pr (from workflow.postImplementSequence). Invoke oat-project-document then oat-project-pr-final (summary included via pr-final).Rationale: oat-project-pr-final already auto-generates/refreshes summary.md as part of its flow, so pr and docs-pr do not need a separate summary step. The summary value exists as a standalone option for the rare case where you want just the summary without PR.
Standard prompt (when preference is unset):
Final review passed for {project-name}.
All tasks complete and verified. Next steps:
1. Generate project summary (oat-project-summary)
2. Sync documentation (oat-project-document) — if applicable
3. Create final PR (oat-project-pr-final)
Options:
a. Run all three in sequence now
b. Run summary + PR only (skip docs)
c. Exit (run individually later)
Choose:
If user chooses sequence (a or b):
oat-project-summary to generate summary.mdoat-project-documentoat-project-pr-final — this sets oat_phase_status: pr_open and guides to revise/completeDo not route directly to oat-project-complete. The pr_open status set by pr-final is the proper entry to the revision/completion flow.
If user chooses exit (c):
Tell user: "Run the skills individually when ready: oat-project-summary → oat-project-document → oat-project-pr-final"
Implementation complete for {project-name}.
Summary:
- Phases: {N} completed
- Tasks: {N} completed
- Commits: {N} created
Final verification:
- Tests: ✓ passing
- Lint: ✓ clean
- Types: ✓ valid
- Build: ✓ success
Final review:
- Status: ✓ passed
- Artifact: reviews/final-review-{date}.md
Next: Create PR or run the oat-project-pr-final skill (when available)
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.