| name | issue-delivery |
|---|---|
| description | Orchestrate plan-issue review/close loops where main-agent owns orchestration and review only, subagents own implementation task lanes, and close gates require approval plus merged PRs. |
Prereqs:
- Run inside (or have access to) the target repository.
plan-issueavailable onPATH.ghavailable onPATH, andgh auth statussucceeds for live issue/PR reads and writes.issue-pr-reviewis the review decision workflow after handoff.
Inputs:
- Plan issue number (
--issue <number>) created during plan orchestration. ISSUE_NUMBERshould be captured from upstreamplan-issue start-planoutput and reused across all commands in this skill.- Optional repository override (
--repo <owner/repo>). - Optional review summary text (
--summary). - Plan-close approval comment URL (
PLAN_APPROVED_COMMENT_URL) forclose-plan. - Approval URL format:
https://github.com/<owner>/<repo>/(issues|pull)/<n>#issuecomment-<id>. - PR linkage inputs for runtime row sync (
--task <task-id>or--sprint <n> [--pr-group <group>], plus--pr <#123|123|pull-url>). - Conditional subagent dispatch bundle (required when this issue is plan-sprint originated via
plan-issue start-sprint):- rendered
TASK_PROMPT_PATHartifact for the assigned lane/task - sprint-scoped
SUBAGENT_INIT_SNAPSHOT_PATH - issue-scoped
PLAN_SNAPSHOT_PATH - task-scoped
DISPATCH_RECORD_PATH - plan task section context (exact snippet and/or direct link/path)
- rendered
- Local rehearsal policy:
- This main skill is live-mode default (
plan-issue ...). - If rehearsal is explicitly requested, load
references/LOCAL_REHEARSAL.md.
- This main skill is live-mode default (
- Task owners must be subagent identities (must reference
subagent);main-agentownership is invalid for implementation tasks.
Outputs:
- Deterministic orchestration over typed
plan-issuecommand flows with explicit gate checks. - Status snapshots and review-request markdown blocks for traceable issue history.
- Deterministic PR linkage/status sync through
link-prbefore review and close gates. - Issue close only when review approval and merged-PR checks pass via
close-plan. - Definition of done: execution is complete only when
close-plansucceeds and the target issue is actually closed. - Error contract: if any gate/command fails, stop forward progress and report the failing command plus key stderr/stdout gate errors.
- Main-agent acts as orchestrator/reviewer only; implementation branches/PRs are delegated to subagents.
- Issue task table remains the single execution source of truth (
Subagent PRssection is legacy and removed by sync). - Subagent-owned task lanes stay stable across implementation, clarification, CI, and review follow-up unless main-agent explicitly reassigns the lane.
Exit codes:
0: success1: runtime failure / gate failure2: usage error
Failure modes:
- Missing required options (
--issue,--approved-comment-url,--summarywhen required by policy). - Missing required binaries (
plan-issue;ghfor live mode). - Invalid approval URL format or repo mismatch with
--repo. link-prtarget ambiguity (for example sprint selector spans multiple runtime lanes without--pr-group).link-prrejected PR selector (--prdoes not resolve to a concrete PR number).- Task rows violate close gates (status not
done, execution metadata/PR missing, or PR not merged). - Issue/PR metadata fetch fails via
ghin live mode. - Task
Ownerismain-agent/non-subagent identity inTask Decomposition. - Plan-sprint originated dispatch launched without required bundle (
TASK_PROMPT_PATH,SUBAGENT_INIT_SNAPSHOT_PATH,PLAN_SNAPSHOT_PATH,DISPATCH_RECORD_PATH, plan task snippet/link/path). - Review or clarification follow-up is redirected into a replacement branch/worktree/PR without explicit task-lane reassignment.
- None. This orchestration skill intentionally uses
plan-issuecommand flows and has no repo-localscripts/entrypoint.
- Main-agent is limited to issue orchestration:
- status/review-handoff/close gates
- dispatch and acceptance decisions
- Main-agent must not implement issue tasks directly.
- Even for a single-PR issue, implementation must be produced by a subagent PR and then reviewed by main-agent.
- Main-agent review/merge decisions should use
issue-pr-review; this loop skill enforces ownership and close gates.
- Follow the shared task-lane continuity policy:
skills/workflows/issue/_shared/references/TASK_LANE_CONTINUITY.md - Treat each
Task Decompositionrow as one task lane and keep follow-up on that lane by default. - Replacement dispatch is allowed only when the original subagent cannot continue or when assignment facts must change; preserve issue row and PR linkage deterministically when reassigning.
- Local rehearsal playbook (
plan-issue-localandplan-issue --dry-run):references/LOCAL_REHEARSAL.md - Shared task-lane continuity policy (canonical):
skills/workflows/issue/_shared/references/TASK_LANE_CONTINUITY.md - Shared main-agent review rubric (canonical):
skills/workflows/issue/_shared/references/MAIN_AGENT_REVIEW_RUBRIC.md - Shared post-review outcome handling (canonical):
skills/workflows/issue/_shared/references/POST_REVIEW_OUTCOMES.md
- Live mode is default in this main skill:
plan-issue <subcommand> .... - Resolve and reuse a single
ISSUE_NUMBERfrom upstream plan orchestration, then dispatch implementation to subagents viaissue-subagent-pr.- If the issue originated from
plan-issue start-sprint, dispatch each subagent with:- rendered
TASK_PROMPT_PATH SUBAGENT_INIT_SNAPSHOT_PATHPLAN_SNAPSHOT_PATHDISPATCH_RECORD_PATH- assigned plan task section snippet/link/path
- rendered
- If the issue originated from
- Keep runtime-truth rows synchronized with
link-pr; addstatus-plancheckpoints when needed, and useblockedwhile a task lane is waiting on clarification or another external unblock. - Handoff review with
ready-plan, apply the shared main-agent review rubric, run review decisions throughissue-pr-review, and route follow-up back to the same subagent-owned task lane until close gates are satisfied. - Close with
close-planusingPLAN_APPROVED_COMMENT_URL. - If local rehearsal is explicitly requested, switch to
references/LOCAL_REHEARSAL.md.
- Do not stop at
status-planorready-planas a final state. - A successful run must terminate at
close-planwith issue stateCLOSED. - If close gates fail, treat the run as unfinished and report:
- failing command
- gate errors (task status, PR merge, approval URL, or owner policy)
- next required unblock action
- Confirm repository context, runtime mode (
plan-issue), andgh auth statusfor live mode. - Confirm the plan issue already exists, capture
ISSUE_NUMBERfrom upstream orchestration output, and keep using that single value for all--issueflags. - Confirm task decomposition ownership remains subagent-only.
- Main-agent dispatches implementation tasks to subagents (for example via
issue-subagent-pr), while remaining orchestration/review-only.- For plan-sprint originated issues, dispatch must include the required bundle:
- rendered
TASK_PROMPT_PATH SUBAGENT_INIT_SNAPSHOT_PATHPLAN_SNAPSHOT_PATHDISPATCH_RECORD_PATH- assigned plan task section snippet/link/path
- rendered
- For plan-sprint originated issues, dispatch must include the required bundle:
- As subagent PRs progress, run
link-prto update issue taskPRandStatusfields (instead of manual table edits).- Task-scoped link:
plan-issue link-pr --issue <number> --task <task-id> --pr <#123|123|pull-url> [--status <planned|in-progress|blocked>] --taskautomatically syncs shared-lane rows (per-sprint/pr-shared) in one operation.- Sprint-scoped link is valid only when the target resolves to one runtime lane; otherwise specify
--pr-group. - Use
in-progresswhile a lane is actively implementing or addressing requested follow-up. - Use
blockedwhile a lane is waiting on missing/conflicting context or an external unblock.
- Task-scoped link:
- If a subagent reports missing/conflicting context or another blocker, stop forward progress, clarify the task, and send the work back to the same task lane by default instead of widening scope or opening a replacement PR path.
- Run
status-planto generate a main-agent snapshot comment for task/PR/review state checkpoints. - Run
ready-planwhen the issue is ready for main-agent review handoff. - Main-agent reviews subagent PRs against
skills/workflows/issue/_shared/references/MAIN_AGENT_REVIEW_RUBRIC.md(typically usingissue-pr-review), requests follow-up back to the current subagent-owned task lane or merges until close gates are satisfied. - After each review decision, apply
skills/workflows/issue/_shared/references/POST_REVIEW_OUTCOMES.mdto keep issue/task state synchronized before any further dispatch or final close gate work. - Run
close-planwithPLAN_APPROVED_COMMENT_URLto enforce final gates (task status plus merged PR checks), re-sync/normalize the issue task table, and close the issue.
- Keep local rehearsal details in
references/LOCAL_REHEARSAL.md; load it only when explicitly requested. - Prefer
link-prfor PR/status updates so row normalization and lane sync rules stay consistent. Execution Modecontrols branch/worktree uniqueness checks: onlypr-isolatedrequires unique branch/worktree per row.- Use
--dry-runto suppress write operations while previewing commands. - Use a single
ISSUE_NUMBERvariable across the run to avoid cross-issue updates. - If the original subagent cannot continue, reassign explicitly and keep the new subagent on the same task-lane facts unless the issue row is intentionally updated first.
- After
request-followuporclose-pr, do not continue orchestration from a stale row; apply the shared post-review outcome handling first. - For
issue-pr-review, prefer structured outcome flags (request-followup:--row-status,--next-owner;close-pr:--close-reason,--next-action, optional--replacement-pr,--row-status) so row sync comments are deterministic.