Implement

From bjornjee/agent-dashboard · View interactive version

Implement is an AI agent skill from the GitHub repository bjornjee/agent-dashboard. Dispatch each phase of an approved plan to a fresh subagent with proportional verification; re-invoke to resume

How to use this skill

Skill file

<!-- codex-only -->

<codex_skill_must>

  1. Cwd must match .../worktrees/<app>/<name>. Halt with a clear error otherwise — this skill runs only inside a feature worktree.
  2. Read .feature-plan-path first; fall back to a plan-file search only if the sentinel file is missing.
  3. Dispatch each pending - [ ] phase to a fresh spawn_agent with role worker. Strictly sequential — never overlap phases.
  4. After each phase: the phase's Verification profile proof must pass AND git log --oneline <prev-sha>..HEAD must show exactly one new commit. Halt on either failure.
  5. When marking a phase done, flip only the - [ ] → - [x] checklist line. Never edit the ### Phase X: body.
  6. Every spawn_agent call must be followed by wait_agent.

</codex_skill_must>

<!-- /codex-only -->

Run the dispatch loop on a worktree with an approved multi-phase plan.

<!-- claude-only -->

Opt-in. Invoked after /agent-dashboard:feature (or a sibling task skill) probes the user at plan approval and the user picks "Hand off to /agent-dashboard:implement". Each phase dispatches to a fresh Agent() subagent, keeping the orchestrator session slim. Re-invoking on a partially-done worktree resumes from the first pending phase — no separate resume mode.

<!-- /claude-only -->

<!-- codex-only -->

Opt-in. Invoked after /agent-dashboard:feature (or a sibling task skill) probes the user at plan approval and the user picks "Hand off to /agent-dashboard:implement". Each phase dispatches to a fresh Codex worker via spawn_agent, keeping the orchestrator session slim. Re-invoking on a partially-done worktree resumes from the first pending phase — no separate resume mode.

<!-- /codex-only -->

Instructions

Follow these phases in order. Each phase has a gate — do not proceed until the gate is satisfied.

If a dispatched phase touches browser UI, Playwright, dev-server ports, screenshots, or interactive Browser/Chrome inspection, include ../_shared/ui-automation.md in the subagent context and pass the resolved worktree-local UI resources explicitly.

Include ../_shared/verification-profiles.md in every subagent prompt so Verification profile names remain defined even when agent-dashboard is installed without external core rules.


Phase 1: Locate worktree + plan

  1. Confirm cwd is a worktree. Run git rev-parse --show-toplevel; the path must match .../worktrees/<app>/<name>. If not, halt: "Run this from inside a feature worktree, not the main checkout."
  1. Read .feature-plan-path from the worktree root. Its single line is the absolute path to the approved plan markdown:

```bash

cat .feature-plan-path

```

<!-- claude-only -->

  1. Fallback if the sentinel is missing (older /agent-dashboard:feature run, or deleted):

<!-- /claude-only -->

<!-- codex-only -->

  1. Fallback if the sentinel is missing (older /agent-dashboard:feature run, or deleted):

<!-- /codex-only -->

  1. Wait for env setup. Check the worktree root for the env sentinels:

Gate: Worktree confirmed, plan file path resolved, env setup complete.


Phase 2: Dispatch loop

Read the plan's ## Phases checklist, dispatch each pending phase to a subagent, verify the phase's declared proof command, flip the checkbox. Resume is implicit — phases marked [x] are skipped.

  1. Parse the checklist. Read the plan file (from Phase 1). Extract each - [ ] / - [x] line under ## Phases, with its **Phase X: name** identifier and deps.
  1. Halt if no ## Phases block. The user opted into /agent-dashboard:implement on a plan without phase structure. Surface: "Plan has no ## Phases block. Either restructure it using the phase format described in /agent-dashboard:feature, or return to /agent-dashboard:feature for inline implementation." Halt.
  1. Pick the next pending phase (- [ ]) in checklist order. If all phases are [x], skip to Phase 3.
  1. Slice the phase body. Find the matching ### Phase X: name heading; capture through the next ### heading or end-of-file. This is the dispatch unit.

If the phase body mentions UI automation, browser testing, Playwright, screenshots, or interactive inspection, also read ../_shared/ui-automation.md and include its relevant rules in the subagent prompt.

Always read ../_shared/verification-profiles.md and include its relevant rules in the subagent prompt.

  1. Record pre-state. <prev-sha> = git rev-parse HEAD. The post-dispatch check uses this to confirm one new commit landed.

<!-- claude-only -->

  1. Dispatch the subagent (foreground, sequential — never overlap phases). Do not set model; the dashboard controls model selection at session level:

<!-- /claude-only -->

<!-- codex-only -->

  1. Dispatch the subagent (foreground, sequential — never overlap phases). Use Codex spawn_agent with the worker role, then call wait_agent for that agent before continuing. Do not set model; the dashboard controls model selection at session level:

<!-- /codex-only -->

```

<!-- claude-only -->

Agent({

description: "Phase X dispatch",

subagent_type: "general-purpose",

prompt: <subagent prompt template, see below>,

<!-- /claude-only -->

<!-- codex-only -->

spawn_agent({

agent_type: "worker",

message: <subagent prompt template, see below>,

<!-- /codex-only -->

})

<!-- codex-only -->

wait_agent({ targets: ["<agent-id>"] })

<!-- /codex-only -->

```

  1. Verify when the subagent returns:

<!-- claude-only -->

<!-- /claude-only -->

<!-- codex-only -->

<!-- /codex-only -->

  1. Mark done. Edit the plan: flip the matching - [ ] → - [x], append the short commit SHA in parens. Only the checklist line — don't touch the ### Phase X: body.

```

```

  1. Loop to step 3.

Gate: All phases in the ## Phases checklist are marked - [x] and each phase's declared proof command is green.

Subagent prompt template (verbatim, with `{placeholders}` filled in)
You are implementing Phase {ID} of an approved plan.

Worktree: {worktree_path}
Plan file (read-only reference): {plan_path}
Phase ID: {ID}
Phase scope (the only section you should implement):

<<<phase-body>>>
{inline copy of the `### Phase {ID}:` heading and body from the plan}
<<<end-phase-body>>>

Rules:
1. Follow the phase's Verification profile using active AGENTS.md/core instructions when present and the included verification-profile glossary as the standalone fallback. Execute the named proof command, avoid implementation-only tests, and use full `make test` only for Full phases or when the phase risk cannot be bounded.
2. Implement ONLY this phase. Do not touch files outside this phase's declared scope.
3. After the profile proof passes, commit with:
     git commit -m "feat: {phase-id-kebab} <one-line description>"
4. Do NOT modify the plan file. Do NOT update checkboxes — the orchestrator owns that.
5. If the phase is ambiguous or blocked, STOP and report a question instead of guessing.
6. If this phase touches UI automation, apply the provided UI automation policy and use only the worktree-local port/base URL/profile/output paths.

Report back with:
- Commit SHA
- Verification profile and proof status (pass/fail + key output line)
- Files changed (paths)
- Anything unexpected

Phase 3: Review

Review all changes for correctness, security, and convention adherence. Apply all project rules and conventions that are in your context.

Review the full branch diff (git diff $(git merge-base HEAD main)..HEAD), not just the last phase — subagents see only their phase, so cross-phase coherence is the orchestrator's responsibility.

Gate: No critical or high-severity issues remain.


Phase 4: Handoff to /agent-dashboard:pr

Tell the user:

Implementation complete. All phases marked done. Open the PR with:

    /agent-dashboard:pr

Gate: User has been pointed at /agent-dashboard:pr.


Resume behavior

No separate resume mode. Re-invoking /agent-dashboard:implement on a partially-done worktree just works:

The plan file's checkbox state is the source of truth — the orchestrator's in-memory state is disposable. If the session itself got compacted mid-flight, just re-invoke. The in-flight phase whose checkbox is still - [ ] will simply be retried.


Red Flags — STOP

If you catch yourself saying or thinking any of these, pause and re-read the relevant phase:

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.