/task-agent:task-agentfrom task-agent
Reads a YAML task list, clones repos, executes tasks, commits changes, and creates PRs. Each invocation processes exactly one pending task.
Ships in task-agent. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Each invocation does exactly one task: the next pending item from the tasks file. The same file (or a sibling state file, in legacy mode) tracks completion, so reruns always pick up where the previous run left off.
Arguments (all optional, key=value form):
tasks=<path> — path to the tasks file. Default: agent-tasks.yml or agent-tasks.yaml in cwd.state=<path> — path to a separate state file. Forces legacy mode. Default: auto-derived (<stem>-state.yml) and only used if the tasks file is in legacy format.Two file formats are supported:
id, a description, and a status (pending | done | failed | skipped). On completion the same entry gains branch, pr_url, date. Unknown keys (e.g. external_ref, labels, priority) are preserved verbatim across rewrites so external sync tools can attach metadata.*-state.yml listing completed entries. Auto-detected when the tasks file has no status: field. Existing setups keep working unchanged.See ../../references/format.md for the full schema, the status enum, and the passthrough-metadata contract.
Prereqs: python3, git.
Before doing any work, call TaskCreate for each phase below. Call TaskUpdate (status in_progress) when you begin a phase and TaskUpdate (status completed) when you finish it.
Parse tasks=<path> and state=<path> from the invocation arguments. If tasks= is not
given, search the current directory for agent-tasks.yml then agent-tasks.yaml. Stop and
show the expected format if no file is found.
All YAML reading and writing goes through the helper script
${CLAUDE_PLUGIN_ROOT}/scripts/tasks_io.py, which guarantees that unknown keys on task
entries (e.g. external_ref, labels) survive every round-trip. The script's contract:
status: field. The tasks file is the single source of truth; no state file is read.status). The script
reads the state file from the explicit state=<path> argument if given, else from
<tasks-stem>-state.yml next to the tasks file. A missing state file is treated as empty.{repo, id, description, status, ...}.
Missing ids are synthesized as md5(repo + "\n" + description)[:6]; missing statuses
default to done (legacy task whose (repo, description) is in state.completed) or
pending.Invoke it and capture the JSON:
python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tasks_io.py" load "$TASKS_PATH" \
${STATE_PATH:+--state "$STATE_PATH"}
Remember the mode field from the output — Phase 4 needs it to write back in the same
format.
Walk the normalized list in order and pick the first task whose status == 'pending'.
Tasks with status of done, failed, or skipped are passed over silently (failures
and skips were intentional outcomes of earlier runs).
If nothing is pending, tell the user — all done, nothing left to do — and end with the result block {"status": "none"} (Phase 4.4).
Print the chosen task clearly before proceeding:
Today's task:
Repo: owner/repo-name
ID: abc123
Task: "Add unit tests for the authentication module"
Only clone the one repo containing today's task if not already cloned locally.
Each repo lives under a task-agent directory in the OS temp dir (so the local clone
is reused across runs and Windows/Linux/macOS all work). The exact base directory is:
WORKDIR="${TASK_AGENT_WORKDIR:-$(python3 -c 'import os,tempfile;print(os.path.join(tempfile.gettempdir(),"task-agent"))')}"
Override with the TASK_AGENT_WORKDIR env var if you need a different location (e.g. a
persistent disk on a build agent).
Run this phase inline. It is a lookup and a git clone/fetch, which does not need a
fresh agent's context.
Call mcp__github__search_repositories with query: "repo:OWNER/REPO_NAME" and
minimal_output: false. Read the default_branch field from the returned repository object.
LOCAL_PATH="$WORKDIR/REPO_NAME"
if [ -d "$LOCAL_PATH/.git" ]; then
git -C "$LOCAL_PATH" fetch origin
git -C "$LOCAL_PATH" checkout DEFAULT_BRANCH
git -C "$LOCAL_PATH" reset --hard origin/DEFAULT_BRANCH
# reset --hard keeps untracked files. Drop leftovers from earlier runs so they
# cannot end up in this task's commit, but only in a clone task-agent owns:
# one it created (marker file), or any clone in the default temp workdir, which
# Phase 5 deletes anyway. A clone the user keeps under a custom
# TASK_AGENT_WORKDIR is never cleaned; the implementer's by-path staging still
# keeps its untracked files out of the commit.
if [ -f "$LOCAL_PATH/.git/task-agent-clone" ] || [ -z "$TASK_AGENT_WORKDIR" ]; then
git -C "$LOCAL_PATH" clean -fd # ignored files such as node_modules stay
fi
else
mkdir -p "$WORKDIR"
git clone "https://github.com/OWNER/REPO_NAME.git" "$LOCAL_PATH"
touch "$LOCAL_PATH/.git/task-agent-clone" # marks the clone as task-agent-owned
fi
Run 3.1, 3.2, 3.4 and 3.5 inline. Only the implementation itself (3.3) goes to a subagent, so the code-writing agent is one level deep, not two.
Slugify the task text and append a short hash for uniqueness:
TASK="<today's task text>"
SLUG=$(echo "$TASK" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/-/g' | sed 's/-\+/-/g' | sed 's/^-\|-$//g' | cut -c1-45)
HASH=$(echo "$TASK" | python3 -c "import sys,hashlib; print(hashlib.md5(sys.stdin.read().encode()).hexdigest()[:6])")
BRANCH="task/${SLUG}-${HASH}"
git -C "$LOCAL_PATH" checkout DEFAULT_BRANCH
# -B is idempotent: creates the branch, or resets it to the current commit if a stale
# copy was left behind by an interrupted prior run.
git -C "$LOCAL_PATH" checkout -B "$BRANCH"
Spawn the plugin's dedicated agent, task-agent:task-implementer (defined in
../../agents/task-implementer.md). Its role
instructions live there: read the repo's CLAUDE.md/CONTRIBUTING/CI config, implement,
run the repo's own checks, and commit only when they pass. It has no Agent tool
and never pushes. Pass only the context:
Agent(
subagent_type: "task-agent:task-implementer",
description: "Implement task <TASK_ID>",
prompt: """
LOCAL_PATH: <LOCAL_PATH>
Repository: <OWNER/REPO_NAME>
BRANCH: <BRANCH>
REFERENCES_DIR: ${CLAUDE_PLUGIN_ROOT}/references
Task: <TASK_DESCRIPTION>
"""
)
Resolve ${CLAUDE_PLUGIN_ROOT} to an absolute path before passing it; the agent
cannot expand it.
Read the STATUS: line at the end of its reply:
| STATUS | What to do next |
|---|---|
committed | Continue to 3.4. The rest of the reply is AGENT_SUMMARY. |
nothing-to-do | Skip 3.4/3.5. Record done with branch and date and no pr_url (Phase 4). |
checks-failing | Do not push. Record failed with error: "checks failing: <command>". |
blocked | Do not push. Record failed with error: "<reason from the reply>". |
A missing STATUS: line counts as blocked.
git -C "$LOCAL_PATH" push origin "$BRANCH" --force-with-lease
Only reached on STATUS: committed. If there are unexpectedly no commits to push,
treat it like nothing-to-do (still update state so we don't retry it tomorrow).
Call mcp__github__create_pull_request with:
owner: OWNERrepo: REPO_NAMEtitle: TASK_DESCRIPTIONhead: BRANCHbase: DEFAULT_BRANCHbody:
## Summary
AGENT_SUMMARY
---
*Opened by multi-repo-tasks via Claude Code.*
Capture the html_url field from the response as the PR URL.
Extract the PR number from the URL (last path segment).
After the PR is open, continue to Phase 4.
The write path branches on the mode detected in Phase 1. Both branches must preserve every key the user (or an external sync tool) put on the task — never drop unknown fields.
Pick one of:
done — the implementer reported committed and a PR was opened, or it reported
nothing-to-do. Always sets branch, date. Sets pr_url when a PR was opened.failed — the implementer reported checks-failing or blocked, or a later step
(push, PR creation) failed. Sets error: "<short reason>". Nothing unverified is pushed.skipped — the task is no longer applicable (e.g. repo gone). Sets reason: "<why>".The same helper script does the writeback, picking the right strategy based on the mode detected in Phase 1:
status flips in place and the completion keys
(branch, pr_url, date, or error / reason) are merged onto it. Unknown keys on
the entry are preserved.completed: in the state file.python3 "${CLAUDE_PLUGIN_ROOT}/scripts/tasks_io.py" record "$TASKS_PATH" \
--mode "$MODE" \
--task-id "$TASK_ID" \
--repo "$REPO" \
--description "$TASK_DESCRIPTION" \
--status "$NEW_STATUS" \
${STATE_PATH:+--state "$STATE_PATH"} \
--completion-json "$COMPLETION_JSON"
COMPLETION_JSON is a JSON object — for status=done use
{"branch": "...", "pr_url": "...", "date": "YYYY-MM-DD"}; for failed use
{"error": "<short reason>"}; for skipped use {"reason": "<why>"}.
## Task — Done
✅ owner/repo-name
Task: "Add unit tests for the authentication module"
Branch: task/add-unit-tests-abc123
PR: https://github.com/owner/repo-name/pull/42
Progress: 1 of 5 tasks completed across 2 repos.
Next up: "Fix the typo in README.md" (owner/repo-name)
End the report with one fenced json block labelled result on its own line before it, so
callers (a human, another skill) can read the outcome without parsing prose. It is the last
thing in the report:
result:
```json
{"status": "done", "pr_url": "https://github.com/owner/repo-name/pull/42", "repo": "owner/repo-name", "branch": "task/add-unit-tests-abc123"}
```
status is done, failed or skipped (as recorded in Phase 4.2), or none when Phase 1.3
found no pending task (nothing was selected or recorded; the block is just {"status": "none"}). pr_url, repo and
branch are present only for done; failed adds error, skipped adds reason.
After all tasks are done, run the cleanup directly:
rm -rf "$WORKDIR"
github and the other is github2. Use github2 only to create and manage PRs into repos that are not owned by me.REFERENCES_DIR).committed. A PR whose checks were never run locally just moves the failure to CI.What SKILL.md sets; muted values are Claude Code's defaults
opusThree short reads, in order
npx claudepluginhub dan323/easier-life-skills --plugin task-agent6 skills in this plugin
/pr-reviewerReviews a pull request (correctness, tests, repo conventions, safety), verifies the repo's own checks in a throwaway worktree, and posts one GitHub review with inline comments (it may create or fetch a local clone and a temporary worktree, but never edits the PR branch or the clone's working files). Thin skill wrapper around the `pr-reviewer` sub-agent and the stand-in for Copilot review; ends with a machine-readable `result` block. In a workflow, use `pr-reviewer-workflow`./pr-reviewer-workflowWorkflow adapter for `pr-reviewer`: runs it with the step args and writes `findings`, `posted`, `already_raised`, `review_url` and `commit` to `$WORKFLOW_OUTPUT`, so a workflow can loop `until: ${{ steps.review.output.findings == 0 }}`. Use `pr-reviewer` directly outside workflows./review-fixerReads unresolved review comments on a pull request — from the `pr-reviewer` agent, repo members, or allowlisted review bots — applies code fixes for the actionable ones, runs the repo's checks, and pushes. Thin skill wrapper around the `review-fixer` sub-agent; ends with a machine-readable `result` block. In a workflow, use `review-fixer-workflow`./review-fixer-workflowWorkflow adapter for `review-fixer`: runs it with the step args and writes `fixed`, `resolved`, `skipped`, `ignored`, `pushed` and `commit` to `$WORKFLOW_OUTPUT`. Use `review-fixer` directly outside workflows./task-agent-workflowWorkflow adapter for `task-agent`: runs it with the step args and writes `pr_url`, `repo` and `branch` (plus `status`) to `$WORKFLOW_OUTPUT` so later steps can review or sync the PR. Use `task-agent` directly outside workflows.Other plugins' skills for the same job