Task Manage
Overview
Maintain a project's task queue as a concise ordered list of tasks another agent
can pick up without extra back-and-forth. Promote only straightforward work with
limited design space; leave vague, strategic, or highly exploratory ideas in
ideas/<project>.md (or IDEAS.md for non-factory projects).
For factory-managed projects (present in C:\dev\factory\config\factory.json),
this skill operates on the factory checkout, not a local file:
C:\dev\factory\queues\<project>.md (the queue), proposals/<project>.md
(human-gated proposals), and ideas/<project>.md (curation source material) —
all in the C:\dev\factory checkout (repo khe618/factory). Always
git -C /c/dev/factory pull before reading state and git -C /c/dev/factory push after writing it. For any other project, this skill falls back to the
legacy local TASKS.md/IDEAS.md behavior described below.
This skill is the producer for the task queue. The consumer is the
implement-task skill, which executes an item and updates its status. Both
follow one shared format — read it before editing the file:
Read references/tasks-md-contract.md (in this skill) for the exact
queue format, the state model ([open] / [in progress], plus [blocked] on
the canonical factory queue), the field rules, the immutable-ID allocation
rule, and the status transitions. Everything below is the curation workflow;
the contract is the format.
Workflow
- Locate the target project. If it's factory-managed, that means the factory
checkout (
git -C /c/dev/factory pull first) — read config/factory.json
for its prefix, attemptCap, and minOpenTasks. Otherwise locate the
project root and read its instructions (CLAUDE.md / AGENTS.md) before
editing; TASKS.md belongs at the project root, not the workspace root.
- Inspect current state:
- Factory-managed:
queues/<project>.md, proposals/<project>.md,
ideas/<project>.md, and recent ledger/events/*.json for this project.
- Non-factory: existing
TASKS.md and IDEAS.md, if present.
- Recent session evidence available in context or local files — agent logs,
LEARNINGS.md, durable memories, project notes, recent session summaries.
- Git status and recent history, when the project is a git repository.
- Determine whether any
[in progress] tasks have merged into master or
main.
- Compare the task branch, commit subjects, PR references, or files mentioned
by the task against the default branch history.
- If the evidence shows the work landed on
master/main, remove the
task (the contract uses removal, not a "done" state). Factory-managed:
removal also writes a pruned ledger event file (schema + filename per
the contract) recording the task ID and PR.
- If evidence is unclear, keep the task and add/update its
Evidence note
rather than guessing.
- Promote ideas into the queue only when they are agent-ready:
- The desired outcome is concrete.
- The scope is small to medium.
- The agent can verify completion locally.
- The task does not require major product/design decisions or repeated user
input.
- Factory-managed: assign the new task's ID by the contract's allocation
rule — 1 + the max numeric suffix for this project's prefix found across
queues/*.md, proposals/*.md, AND every ledger/events/**/*.json
(including archives). Never reuse an ID, even one belonging to a pruned
task.
- Reorder tasks by practical execution value (list order = priority):
- Unblockers and correctness fixes first.
- Small, well-specified improvements next.
- Larger but still well-contained tasks after that.
- Keep noisy, speculative, or low-confidence items out of the list.
- Adversarial self-review of the proposed changes — before writing, turn a
skeptical eye on your own removals and promotions. See "Adversarial
self-review" below. This is the gate that matters most when this skill runs
autonomously, because there is no human checking the result.
- Write or update the queue following the contract format exactly. Whenever tasks are added, removed, or reordered, renumber headers strictly 1..N; never change a task's ID. Before
writing, verify every task carries a non-empty
Objective: line stating the
concrete change — it's the one required field and the line the review digest
surfaces. If you can't articulate the objective, the item isn't agent-ready;
leave it in ideas/<project>.md/IDEAS.md rather than promoting a task with
an empty objective.
- Factory-managed only — commit and push. One commit covering every
queue/proposals/ideas edit made this run, plus one
pruned ledger event
file per task removed this run (filename
<YYYYMMDDTHHMMSSZ>-<6-char [a-z0-9]>-pruned.json, schema per the ledger
contract, spec §4.3, with actor: "local:<project>"). Commit message: state: curate <project> (promote N, remove M, reorder) (omit clauses that don't apply). Push with the
discard-and-rebuild rule (spec §4.4): if the push is rejected, git -C /c/dev/factory fetch && git -C /c/dev/factory reset --hard origin/main,
re-read the current state, rebuild the edit fresh (never rebase-replay the
old commit), and retry. On repeated contention, stop and tell the user
rather than looping indefinitely.
Git guidance
When inside a git repository, gather evidence with focused commands:
git status --short --branch
git branch --show-current
git log --oneline --decorate --max-count=20
git log --oneline master..HEAD
git log --oneline main..HEAD
Use master or main according to the repository. If neither exists locally,
inspect branches/remotes before concluding a task has merged. Never remove an
[in progress] task solely because the working tree is clean; require evidence
that the relevant work is now on the default branch.
For factory-managed projects, also pull the factory checkout before reading
and cross-check against recent ledger events for this project:
git -C /c/dev/factory pull
ls /c/dev/factory/ledger/events | tail -20
Adversarial self-review
This skill often runs without a human reviewing its output, so the curation
itself is the thing that needs an adversarial pass — there is no later gate to
catch a bad call. The three curation actions are not equally risky, so concentrate
scrutiny where a mistake is expensive:
- Removal is the dangerous one. The contract has no "done" state; a finished
task is deleted. So a wrong removal silently loses tracked work with nothing
to recover it from. Before removing any
[in progress] task, argue the
opposite case and require it to survive:
- Name the concrete merge evidence — the commit(s) or merged PR that carry the
work onto
main/master. "Working tree is clean" is not evidence.
- Rule out the look-alikes: a same-named branch, a PR that was closed rather
than merged, or a partial landing where only some of the task's scope merged.
- If you cannot prove the full scope merged to the default branch, do not
remove it — keep the task and update its
Evidence line instead.
- Promotion compounds. The consumer (
implement-task) also runs
autonomously, so an under-specified task isn't caught by a human either — it
becomes a confident, wrong PR. Before promoting, pressure-test readiness:
- Is the task genuinely self-contained, or am I leaning on conversation
context the next agent won't have?
- Is there a
Done when an agent can actually check locally?
- Does it still need a product/design/architecture decision? If so it belongs
in
ideas/<project>.md/IDEAS.md, not the task queue.
- Reordering is cheap — a wrong priority is fixed on the next run, so it
doesn't need this scrutiny.
Escalation. When running autonomously and about to remove a task, hand that
specific judgment to an independent reviewer rather than trusting your own read:
run the removal evidence through codex:rescue (the same review engine
implement-task uses, so reviews stay consistent), falling back to an independent
Claude subagent if Codex is unavailable. Ask it the narrow question "does this
evidence prove the full task merged to the default branch?" Promotions and
reordering do not need the round-trip — the self-review above is enough.
Curation rules
- Prefer fewer, clearer tasks over a large backlog.
- Preserve useful context from
ideas/<project>.md/IDEAS.md but rewrite it
into an executable task.
- Do not promote ideas that require choosing among many product directions,
visual concepts, vendors, architectures, or policy decisions.
- Split compound ideas into separate tasks only when each split task is
independently useful and verifiable.
- If the queue file does not exist, create it per the contract (a short
ordered list of the best available tasks, or a one-line note if no
agent-ready tasks were found).
- Factory-managed: never promote directly from
ideas/<project>.md into
queues/<project>.md when acting as the curator role — draft into
proposals/<project>.md with a [proposed] state and a Rationale: line
instead, and leave promotion to the human's [proposed] → [approved]
edit (spec §4.2). This skill may still promote straight to [open] in the
queue when the user directly asks it to add/curate a specific task in this
conversation — the proposals gate is for the unattended curator flow, not
every invocation.
1---2name: task-manage3description: Curate a project's task queue (the factory checkout's queues/<project>.md for factory-managed projects, else a project-local TASKS.md) into an ordered queue of self-contained, agent-ready tasks. Use when the user asks to create, update, prune, prioritize, or manage TASKS.md or the factory queue; asks to turn IDEAS.md/ideas/<project>.md, recent session logs, or git history into actionable tasks; or wants in-progress tasks removed after they have merged into master/main.4---56# Task Manage78## Overview910Maintain a project's task queue as a concise ordered list of tasks another agent11can pick up without extra back-and-forth. Promote only straightforward work with12limited design space; leave vague, strategic, or highly exploratory ideas in13`ideas/<project>.md` (or `IDEAS.md` for non-factory projects).1415**For factory-managed projects (present in `C:\dev\factory\config\factory.json`),16this skill operates on the factory checkout, not a local file:**17`C:\dev\factory\queues\<project>.md` (the queue), `proposals/<project>.md`18(human-gated proposals), and `ideas/<project>.md` (curation source material) —19all in the `C:\dev\factory` checkout (repo `khe618/factory`). Always20`git -C /c/dev/factory pull` before reading state and `git -C /c/dev/factory21push` after writing it. For any other project, this skill falls back to the22legacy local `TASKS.md`/`IDEAS.md` behavior described below.2324This skill is the **producer** for the task queue. The **consumer** is the25`implement-task` skill, which executes an item and updates its status. Both26follow one shared format — read it before editing the file:2728**Read `references/tasks-md-contract.md`** (in this skill) for the exact29queue format, the state model (`[open]` / `[in progress]`, plus `[blocked]` on30the canonical factory queue), the field rules, the immutable-ID allocation31rule, and the status transitions. Everything below is the *curation* workflow;32the contract is the *format*.3334## Workflow35361. Locate the target project. If it's factory-managed, that means the factory37 checkout (`git -C /c/dev/factory pull` first) — read `config/factory.json`38 for its `prefix`, `attemptCap`, and `minOpenTasks`. Otherwise locate the39 project root and read its instructions (`CLAUDE.md` / `AGENTS.md`) before40 editing; `TASKS.md` belongs at the project root, not the workspace root.412. Inspect current state:42 - Factory-managed: `queues/<project>.md`, `proposals/<project>.md`,43 `ideas/<project>.md`, and recent `ledger/events/*.json` for this project.44 - Non-factory: existing `TASKS.md` and `IDEAS.md`, if present.45 - Recent session evidence available in context or local files — agent logs,46 `LEARNINGS.md`, durable memories, project notes, recent session summaries.47 - Git status and recent history, when the project is a git repository.483. Determine whether any `[in progress]` tasks have merged into `master` or49 `main`.50 - Compare the task branch, commit subjects, PR references, or files mentioned51 by the task against the default branch history.52 - If the evidence shows the work landed on `master`/`main`, **remove** the53 task (the contract uses removal, not a "done" state). Factory-managed:54 removal also writes a `pruned` ledger event file (schema + filename per55 the contract) recording the task ID and PR.56 - If evidence is unclear, keep the task and add/update its `Evidence` note57 rather than guessing.584. Promote ideas into the queue only when they are agent-ready:59 - The desired outcome is concrete.60 - The scope is small to medium.61 - The agent can verify completion locally.62 - The task does not require major product/design decisions or repeated user63 input.64 - Factory-managed: assign the new task's ID by the contract's allocation65 rule — 1 + the max numeric suffix for this project's prefix found across66 `queues/*.md`, `proposals/*.md`, AND every `ledger/events/**/*.json`67 (including archives). Never reuse an ID, even one belonging to a pruned68 task.695. Reorder tasks by practical execution value (list order = priority):70 - Unblockers and correctness fixes first.71 - Small, well-specified improvements next.72 - Larger but still well-contained tasks after that.73 - Keep noisy, speculative, or low-confidence items out of the list.746. **Adversarial self-review of the proposed changes** — before writing, turn a75 skeptical eye on your own removals and promotions. See "Adversarial76 self-review" below. This is the gate that matters most when this skill runs77 autonomously, because there is no human checking the result.787. Write or update the queue following the contract format exactly. Whenever tasks are added, removed, or reordered, renumber headers strictly 1..N; never change a task's ID. Before79 writing, verify every task carries a non-empty `Objective:` line stating the80 concrete change — it's the one required field and the line the review digest81 surfaces. If you can't articulate the objective, the item isn't agent-ready;82 leave it in `ideas/<project>.md`/`IDEAS.md` rather than promoting a task with83 an empty objective.848. **Factory-managed only — commit and push.** One commit covering every85 queue/proposals/ideas edit made this run, plus one `pruned` ledger event86 file per task removed this run (filename87 `<YYYYMMDDTHHMMSSZ>-<6-char [a-z0-9]>-pruned.json`, schema per the ledger88 contract, spec §4.3, with `actor: "local:<project>"`). Commit message: `state: curate <project> (promote N,89 remove M, reorder)` (omit clauses that don't apply). Push with the90 discard-and-rebuild rule (spec §4.4): if the push is rejected, `git -C91 /c/dev/factory fetch && git -C /c/dev/factory reset --hard origin/main`,92 re-read the current state, rebuild the edit fresh (never rebase-replay the93 old commit), and retry. On repeated contention, stop and tell the user94 rather than looping indefinitely.9596## Git guidance9798When inside a git repository, gather evidence with focused commands:99100```bash101git status --short --branch102git branch --show-current103git log --oneline --decorate --max-count=20104git log --oneline master..HEAD105git log --oneline main..HEAD106```107108Use `master` or `main` according to the repository. If neither exists locally,109inspect branches/remotes before concluding a task has merged. Never remove an110`[in progress]` task solely because the working tree is clean; require evidence111that the relevant work is now on the default branch.112113For factory-managed projects, also pull the factory checkout before reading114and cross-check against recent ledger events for this project:115116```bash117git -C /c/dev/factory pull118ls /c/dev/factory/ledger/events | tail -20119```120121## Adversarial self-review122123This skill often runs without a human reviewing its output, so the curation124*itself* is the thing that needs an adversarial pass — there is no later gate to125catch a bad call. The three curation actions are not equally risky, so concentrate126scrutiny where a mistake is expensive:127128- **Removal is the dangerous one.** The contract has no "done" state; a finished129 task is *deleted*. So a wrong removal silently loses tracked work with nothing130 to recover it from. Before removing any `[in progress]` task, argue the131 opposite case and require it to survive:132 - Name the concrete merge evidence — the commit(s) or merged PR that carry the133 work onto `main`/`master`. "Working tree is clean" is not evidence.134 - Rule out the look-alikes: a same-named branch, a PR that was *closed* rather135 than merged, or a partial landing where only some of the task's scope merged.136 - If you cannot prove the *full* scope merged to the default branch, do **not**137 remove it — keep the task and update its `Evidence` line instead.138- **Promotion compounds.** The consumer (`implement-task`) also runs139 autonomously, so an under-specified task isn't caught by a human either — it140 becomes a confident, wrong PR. Before promoting, pressure-test readiness:141 - Is the task genuinely self-contained, or am I leaning on conversation142 context the next agent won't have?143 - Is there a `Done when` an agent can actually check locally?144 - Does it still need a product/design/architecture decision? If so it belongs145 in `ideas/<project>.md`/`IDEAS.md`, not the task queue.146- **Reordering is cheap** — a wrong priority is fixed on the next run, so it147 doesn't need this scrutiny.148149**Escalation.** When running autonomously *and* about to remove a task, hand that150specific judgment to an independent reviewer rather than trusting your own read:151run the removal evidence through **`codex:rescue`** (the same review engine152`implement-task` uses, so reviews stay consistent), falling back to an independent153Claude subagent if Codex is unavailable. Ask it the narrow question "does this154evidence prove the full task merged to the default branch?" Promotions and155reordering do not need the round-trip — the self-review above is enough.156157## Curation rules158159- Prefer fewer, clearer tasks over a large backlog.160- Preserve useful context from `ideas/<project>.md`/`IDEAS.md` but rewrite it161 into an executable task.162- Do not promote ideas that require choosing among many product directions,163 visual concepts, vendors, architectures, or policy decisions.164- Split compound ideas into separate tasks only when each split task is165 independently useful and verifiable.166- If the queue file does not exist, create it per the contract (a short167 ordered list of the best available tasks, or a one-line note if no168 agent-ready tasks were found).169- Factory-managed: never promote directly from `ideas/<project>.md` into170 `queues/<project>.md` when acting as the curator role — draft into171 `proposals/<project>.md` with a `[proposed]` state and a `Rationale:` line172 instead, and leave promotion to the human's `[proposed]` → `[approved]`173 edit (spec §4.2). This skill may still promote straight to `[open]` in the174 queue when the user directly asks it to add/curate a specific task in this175 conversation — the proposals gate is for the unattended curator flow, not176 every invocation.