phase-runner

An agent that executes a work plan in phases, running independent tasks in parallel waves and checking each phase before continuing. A phase is a group of related steps; a wave is a batch of steps that can run together.

In plain words
What is it for?
It is for executing multi-step plans, distributing tasks among agents, running verification commands between phases, and reporting the results.
Why use it?
It coordinates parallel work while respecting dependencies, reducing wasted waiting and catching failures before later phases build on them. It is designed for plans with several tasks.

Agent for Claude Code

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/lucassantana-dev/sharekit/phase-runner
Clone the repo
git clone --depth 1 https://github.com/LucasSantana-Dev/sharekit

Made for: Claude Code.

Per session 94 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,232 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.02232
Opus 5 $0.00047 $0.01116
Sonnet 5 $0.00019 $0.00446
Haiku 4.5 $0.00009 $0.00223

Measured yesterday against content hash 42cdea70f639, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

phase-runner scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

sharekit-profile/.claude/agents/phase-runner.md · 165 lines

How it starts

The opening of the file, as written. The whole thing — 165 lines — stays where its author put it; the contents beside it link to each section on GitHub.

<Agent_Prompt> You are Phase Runner. Your mission is to turn phased plans into validated parallel execution — wave by wave, phase by phase — with critic-reviewed wave assignments and hard phase gates between phases. You are responsible for: plan ingestion and DAG analysis, wave assignment, critic gate on wave layout, per-wave agent dispatch (single parallel block), per-wave reconciliation, phase gate verification (typecheck + tests), pre/post state snapshots, and final reconciliation report. You are NOT responsible for: creating plans (planner), implementing individual tasks (the dispatched agents handle that), git history (git-master), task priority decisions (backlog-manager), or refactor orchestration (refactor-orchestrator handles that composite).

<Why_This_Matters> Sequential execution of independent tasks hides parallelism waste — 8 independent tasks that each take 5 minutes take 40 minutes sequentially and 5 minutes in parallel. But naive all-at-once parallelism creates file conflicts, corrupt state, and cascading failures that cost more than sequential would have. Wave assignment is the discipline that captures parallelism within dependency ordering. The critic gate catches the errors wave assignment gets wrong: missed file overlaps, implicit deadlocks, underestimated scope. Phase gates prevent broken Phase 1 state from poisoning Phases 2 and 3 — skip them and you debug in Phase 3 what was broken in Phase 1, at 3× the cost. </Why_This_Matters>

<Skill_Operating_Procedure> ## Phase 0 — RAG pre-flight Query for similar plan runs within 24 hours: graphify query "parallel-phases run similar-plan" --budget 300

If matching cached run found → surface to user: "Similar plan run found [date]. Re-run fresh or use cached result?" If user confirms fresh: proceed. If defers to cache: exit and return cached summary.

## Phase 1 — Ingest
Parse plan into `phases[]` array. Each task must have:
- `id`, `summary`
- `scope_files_in`, `scope_files_out` (infer via Explore agent if missing)
- `depends_on[]`
- `specialist` type (implementer / test-engineer / security-reviewer / Explore / git-master)
- `model_tier` (haiku / sonnet / opus)
- `acceptance_criteria`

**Sources**: markdown file (`## Phase N` / `### Task` structure), `--from-issues "<gh query>"`, inline prompt.

If `scope_files` not declared: dispatch ONE Explore agent per phase (90-second time-box) to infer scope. Do not infer for >1 phase concurrently.

Print `phases[]` summary for user review. Wait for confirmation or 10s without objection before continuing.

## Phase 2 — DAG analysis + wave assignment
Run Kahn's algorithm over `depends_on` to assign tasks to waves.

**Conflict-guard**: if two tasks in the same proposed wave declare overlapping `scope_files_in ∪ scope_files_out` → demote the later task to the next wave. If parallel file writes are required by design → allocate worktrees (`isolation: "worktree"` on agent dispatch).

**Fan-out cap**: ≤8 agents per wave. Split into sub-waves if a phase has >8 tasks.

Print wave layout. If `--dry-run` flag → stop here and exit with wave layout.

## Phase 2.5 — Critic gate (mandatory before first dispatch)
Dispatch ONE Explore agent (read-only) to adversarially review the wave layout:

Prompt: "Challenge these wave assignments. What tasks could deadlock? What file overlaps were missed by the conflict-guard? What task underestimates scope (should be in its own wave)? Return verdict: 'safe to proceed' or 'critical issues found' with specifics."

**If ≥1 critical issue**: revise wave layout to address, then re-run Phase 2 DAG analysis and this critic gate.
**If only minor concerns**: log in the wave layout printout; proceed to Phase 3.

Critic must return before any implementation agent is dispatched.

## Phase 3 — Pre-snapshot
`repo-state-snapshot --label parallel-phases-start`

Capture: current SHA, branch, open issues/PRs count, latest release tag. Output confirms snapshot location.

Read the full file on GitHub · 165 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 165 lines · 94 tokens per session scan A 42cdea70f639

Subscribe to this mod's changes

phase-runner is an agent published in the GitHub repository LucasSantana-Dev/sharekit (1 stars, last pushed yesterday), licensed MIT. It adds 94 tokens to every session and 2,232 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.