Files
mangaBookmark/.claude/skills/implement-tickets/SKILL.md
T
sulthan c400c91a80 Implement a batch of tickets through per-ticket subagents (#82)
## What this adds

Two files that turn the one-ticket-at-a-time `/implement` loop into an orchestrated batch.

**`.claude/skills/implement-tickets/SKILL.md`** — user-invoked (`disable-model-invocation: true`, so it costs no context until typed). The agent that runs it is an orchestrator, not an implementer:

1. Collect the tickets over `tea`, reading each `Blocked by` line.
2. Plan waves from the blocking edges, three tickets wide, and fix every cross-ticket contract (shared signature, JSON shape, column, token) before anything is dispatched.
3. Present the plan and stop for approval.
4. Per ticket: `git worktree add ../ticket-<n>`, copy the gitignored `.env`, claim the issue, write a brief to `.scratch/`, then dispatch the whole wave as one `task` batch.
5. Land each result — merge `--no-ff`, comment the report, close, remove the worktree. Textual conflicts are the orchestrator's; a semantic clash goes back to whichever ticket owns the contract.
6. Full suite once on the merged base.

**`.omp/agents/ticket-implementer.md`** — the worker. Brief-driven, worktree-bound, and gated on review before it reports: it runs the `code-review` skill over its own diff with `cr-spec` and `cr-standards` on the two axes, fixes Critical and Important findings in at most two rounds, and returns a short status contract (`DONE` / `DONE_WITH_CONCERNS` / `BLOCKED` / `NEEDS_CONTEXT` / `REVIEW_BLOCKED`).

The brief template makes the subagent read `tea issue <n> --comments` for its ticket and for the issue that ticket refers to — the comments carry decisions the body never got updated with — and names the `tdd` skill at each seam where a test comes first. Briefs are written in the ubiquitous language of `CONTEXT.md`; a brief that says "scrape" where the domain says Poll hands the subagent the wrong model of the system.

## Verification

Dispatched a real `ticket-implementer` as a probe. The agent resolved from `.omp/agents`, and it spawned `cr-spec`, which replied. That was the one thing that could have silently killed the design: `task.maxRecursionDepth` defaults to 2, and the chain is session to orchestrator to implementer to reviewer. It clears. If that ever changes, the implementer returns `REVIEW_BLOCKED` and the orchestrator runs the review itself.

Confirmed against the omp binary that `autoloadSkills: code-review, tdd` is split by `parseArrayOrCSV`, not swallowed as one unknown name.

## Notes

- Agents are discovered from `.omp/agents`, never `.claude/agents` — the latter is deliberately skipped by omp because its frontmatter is a different contract.
- No product code changes. `.gitignore` gains `.scratch/`, where briefs and reports live.
- Not included: retry after a failed dispatch, a state file for resuming a crashed wave, a cheap model tier for mechanical tickets. Add them when a real batch needs them.

Reviewed-on: #82
Co-authored-by: Sulthan Zaki <sultankiki05@gmail.com>
Co-committed-by: Sulthan Zaki <sultankiki05@gmail.com>
2026-08-11 10:08:09 +07:00

5.7 KiB

name, description, disable-model-invocation
name description disable-model-invocation
implement-tickets Orchestrate a batch of tickets: plan the briefs, then hand each ticket to its own implementer subagent in its own worktree. true

Implement tickets

You are the orchestrator. You write briefs, dispatch, land results, and talk to the tracker. You do not write the implementation — every line of ticket code is written by a ticket-implementer subagent in its own git worktree. Reach for the editor yourself only for a merge conflict resolution.

Ticket source and tea usage: docs/agents/issue-tracker.md. Codebase questions: graphify query "<question>" before grepping.

1. Collect the tickets

The user's argument is the selector: issue numbers, a label, a parent issue, or nothing. With nothing, take the open issues labelled ready-for-agent.

Fetch each with tea issue <n> --comments, and read the whole body — acceptance criteria and the Blocked by line are what the rest of this skill runs on. A ticket whose blockers are still open is out of this batch unless a blocker is also in it.

2. Plan the batch

Explore enough of the codebase to write briefs a fresh context can act on: the files each ticket lands in, the patterns it must follow, the AGENTS.md invariants it touches.

Then decide three things:

  • Waves. Blocking edges set the order; tickets with no open blocker inside the batch share a wave. Cap each wave at 3 concurrent tickets unless the user set another width.
  • Contracts. Two tickets in one wave that meet at a function signature, a JSON shape, a table column, or a token name: you decide the shape now and write the identical wording into both briefs. A contract left for the subagents to negotiate is a merge conflict you scheduled.
  • Splits. A ticket too big for one fresh context window goes into the wave as two briefs, or back to the user.

3. Get the plan approved

Present, and stop:

  • the wave list, and for each ticket: number, title, one-line brief summary, the files or areas it will touch, its verification commands
  • every cross-ticket contract, verbatim as it will appear in the briefs
  • anything you had to assume

Wait for approval. Apply the user's edits to the plan, do not relitigate them.

4. Run a wave

Per ticket, before dispatch:

git worktree add ../ticket-<n> -b ticket/<n>-<slug> <base>   # base = the branch you are on
cp .env ../ticket-<n>/ 2>/dev/null                            # gitignored, worktrees do not get it
tea issue edit <n> --add-assignees <your gitea username>      # tea login list has it

Write the brief to .scratch/<batch-slug>/t<n>-brief.md using the template below, in the ubiquitous language of CONTEXT.md — a brief that says "scrape" where the domain says Poll hands the subagent the wrong model of the system. Then dispatch the whole wave in one task batch, every item on the ticket-implementer agent. Each dispatch names: the absolute brief path, the worktree path, the branch, the base ref, and the report path .scratch/<batch-slug>/t<n>-report.md.

Ticket # —