patch-task

A bounded workflow for fixing review comments or failed CI checks on an existing GitHub pull request. A pull request is a proposed code change waiting for review.

In plain words
What is it for?
Use it to enter the pull request's worktree, address review and CI findings, update the code, and escalate the issue when the iteration limit is reached.
Why use it?
It gathers reviewer feedback and failing test details in one place, then prevents endless automatic retries by escalating after three patch attempts.

Skill for Claude CodeCodex

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 skills/blakemartz/delivery-loop/patch-task
Any agent
npx skills add blakemartz/delivery-loop --skill patch-task
Clone the repo
git clone --depth 1 https://github.com/blakemartz/delivery-loop

Made for: Claude Code, Codex.

Per session 54 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 921 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.00054 $0.00921
Opus 5 $0.00027 $0.00461
Sonnet 5 $0.00011 $0.00184
Haiku 4.5 $0.00005 $0.00092

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

Security

Grade A, and why

patch-task 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.

plugins/delivery-loop/skills/patch-task/SKILL.md · 34 lines

How it starts

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

patch-task — fix a PR that got changes-requested

You are the patcher role from the delivery spec (${CLAUDE_PLUGIN_ROOT}/docs/agentic_delivery_spec.md, §3.5, §9). Read .claude/delivery.conf for GATE_CMD, BASE_BRANCH, and NOTIFY_ESCALATE_CMD.

Protocol

  1. Check the iteration budget. gh pr view <pr> --json comments — find the latest Patch iteration: n/3 comment. If n is already 3: add label needs-human to the PR and linked issue, comment a summary of the impasse, run NOTIFY_ESCALATE_CMD if set, and STOP. Do not patch.
  2. Gather findings. The review: gh pr view <pr> --json reviews,comments (request-changes body + line comments). CI: gh pr checks <pr> — read the failing run logs via gh run view <run-id> --log-failed if red.
  3. Re-enter the task worktree. bash "${CLAUDE_PLUGIN_ROOT}/scripts/task-worktree.sh" <issue#> returns the existing worktree (it re-creates it from the branch if it was cleaned up). Work only there.
  4. Fix every finding. Address each review point and each failing check — and fix it toward the best-practice, idiomatic solution (spec §2.1), not just enough to silence the finding. If you disagree with a finding, don't silently ignore it — reply to the review comment with your reasoning and make the call visible.
  5. Rebase onto origin/$BASE_BRANCH if behind. Resolve conflicts here in the worktree. Never force-push over review history (after a rebase, --force-with-lease is acceptable only if the rebase itself required it; prefer plain pushes of fixup commits).
  6. Re-verify. Every acceptance criterion from the linked issue + the gate (GATE_CMD). Hooks fire on commit/push; never bypass the gate.
  7. Push, then: comment Patch iteration: <n+1>/3 plus a short change summary on the PR; flip the issue back: gh issue edit <N> --add-label status:in-review --remove-label status:changes-requested.
  8. Report what changed and that the PR awaits re-review.

Encode the lesson: if the finding traces back to a harness gap (a criterion the gate should have caught, an ambiguous template), file a module:infra task.

Read the full file on GitHub · 34 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 · 34 lines · 54 tokens per session scan A 628d912c5887

Subscribe to this mod's changes

patch-task is a skill published in the GitHub repository blakemartz/delivery-loop (4 stars, last pushed 1mo ago), licensed MIT. It adds 54 tokens to every session and 921 once invoked, about $0.0003 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.