Add task tracking to pr-review
Summary
Add TaskCreate/TaskUpdate progress tracking to the pr-review command. This is the most complex command in mach10 (9 steps) with skill delegation, subagent delegation, and a multi-path deferred-item handling flow. Task tracking will make its execution observable and prevent step-skipping.
Part of #81 (Tier 1 -- VERY HIGH priority). See #81 for task tracking conventions and overall context.
File: commands/pr-review.md
What Is Task Tracking?
mach10 commands should use TaskCreate and TaskUpdate to establish visible progress checkpoints. Tasks are created upfront after input parsing, then transitioned to in_progress / completed as work proceeds. This makes long-running commands observable and forces the execution to explicitly pass through each checkpoint. See #81 for the full conventions.
Task Graph
All 5 tasks are created in a single block after Step 1 (input parsing). Each task starts as pending.
| Task | Subject | activeForm | in_progress | completed |
|---|---|---|---|---|
| T1 | Run PR review via pr-review-toolkit | Running PR review | Before Step 3 (Skill call) | After Step 3 returns |
| T2 | Post review comment | Posting review comment | Before Step 4 | After Step 4 (comment posted, URL captured) |
| T3 | Run independent assessment | Running independent assessment | Before Step 5 (Task tool subagent launch) | After Step 5 returns |
| T4 | Post assessment and present summary | Posting assessment | Before Step 6 | After Step 7 (CLI summary presented) |
| T5 | Handle deferred items and recommend next steps | Handling deferred items | Before Step 8 | After Step 9 |
Notes:
- Step 2 (checkout/pull) is preparatory and happens before T1 starts -- it does not need its own task.
- T1 wraps the Skill delegation to
/pr-review-toolkit:review-pr. Do not track the skill's internal review agents. - T3 wraps the subagent delegation for independent assessment.
- T5 covers the entire deferred-items interaction loop (Steps 8-9). If there are no deferred items, T5 still transitions through
in_progresstocompletedaround Step 9.
Delegation Notes
- Step 3 delegates to
/pr-review-toolkit:review-prvia the Skill tool. T1 brackets this delegation. - Step 5 delegates to a
general-purposesubagent via the Task tool. T3 brackets this delegation. - Neither delegation's internal steps should be tracked by this command.
Shared Task Context Warning
Step 3 delegates to /pr-review-toolkit:review-pr via the Skill tool, which runs in the same session context. Any tasks that pr-review-toolkit creates internally will appear in the same flat task list alongside T1-T5. When implementing task tracking for this command:
- Do not assume the task list only contains T1-T5 after the Skill call returns. The skill may have added its own tasks.
- Use task subjects (not positional IDs) to locate T1-T5 when transitioning them after delegation returns.
- If
pr-review-toolkitis later updated to use TaskCreate internally, verify that the mixed task list remains intelligible. Consider whether a naming convention (e.g., prefixing command tasks) is needed to visually distinguish command-level tasks from skill-level tasks. If so, coordinate with #81's conventions. - Test with the current version of
pr-review-toolkitto observe whether it creates any tasks today. If it does not, note this in the PR -- future changes to the plugin could introduce interference.
Acceptance Criteria
- [ ] All 5 tasks are created after input parsing, before any work begins
- [ ] Each task transitions
in_progress->completedat the boundaries described above - [ ] The Skill invocation in Step 3 is bracketed by T1's transitions
- [ ] The subagent invocation in Step 5 is bracketed by T3's transitions
- [ ] If the command errors out at any step, the in-progress task remains
in_progress(not artificially completed) - [ ] Task tracking does not interfere with the delegated
/pr-review-toolkit:review-prskill's behavior - [ ]
allowed-toolsin frontmatter includesTask(if not already present)
Independent Assessment
Summary
This issue asks to add TaskCreate/TaskUpdate progress tracking to the pr-review command (the most complex command in mach10 at 9 steps). The task graph specifies 5 tasks (T1-T5) created upfront after input parsing, with each transitioning through in_progress -> completed at well-defined step boundaries. The Skill delegation (Step 3) and subagent delegation (Step 5) are each wrapped by a single task.
Current State
commands/pr-review.mdis 277 lines with 9 steps, two delegations, and a 4-option deferred-items flow.allowed-toolsalready includesTask(for the Step 5 subagent).- No command in the repo has task tracking yet -- this will be the first implementation.
- Parent issue conventions (from the body of this tracking issue) are well-defined but not yet documented in CLAUDE.md (Stage 1 PR pending).
Scope
Small-to-medium. Single-file change to commands/pr-review.md. Estimated ~30-50 lines of new instructional text inserted at task creation and transition points. No changes to other commands, agents, or the plugin manifest (beyond the version bump required by the release process).
Ambiguities
-
Stage 1 dependency: The parent issue describes a two-stage approach where Stage 1 documents conventions in CLAUDE.md before per-command work begins. This sub-issue can likely proceed independently since the task graph table is self-contained, but the implementer should verify whether Stage 1 has landed by the time work starts.
-
allowed-toolsandTaskCreate/TaskUpdate: The currentallowed-toolsfield listsTask(for the subagent tool). The acceptance criteria say to includeTask"if not already present." In Claude Code, progress tracking usesTaskCreate,TaskUpdate,TaskList, andTaskGet-- these may require separateallowed-toolsentries. The implementer should verify whetherTaskis an umbrella that covers the progress-tracking tools or if explicit entries are needed. -
Shared task list with pr-review-toolkit: The issue correctly warns about shared task context from Skill delegation. Currently
pr-review-toolkitdoes not create tasks internally. The PR should note this observation and flag that future changes to the plugin could introduce interference.
Risks
- First-mover risk: As the first command to get task tracking, pattern mistakes here propagate to 11 other commands. The implementation should be clean and exemplary.
- Tool name mismatch: If
Taskinallowed-toolsdoesn't coverTaskCreate/TaskUpdate, the command will fail at runtime. This should be tested early.
Recommendation
The issue is well-specified and ready for implementation. The task graph table provides an unambiguous specification. Resolve the allowed-tools question (ambiguity 2) during implementation and document the finding for the other 11 sub-issues.
Independent Assessment (Second Opinion)
A second independent assessment was performed to cross-check the existing assessment and explore the codebase in depth.
Findings
Confirmed: Issue is implementation-ready. Stage 1 conventions landed in PR #103 and are documented in CLAUDE.md (lines 99-109). No other command has adopted task tracking yet, making this the first-mover implementation.
Acceptance criteria clarification (allowed-tools): The final acceptance criterion reads "allowed-tools in frontmatter includes Task (if not already present)." This is slightly misleading -- Task is already present (for the Step 5 subagent) and covers a different tool than the progress-tracking tools. Per the CLAUDE.md conventions, the correct action is to add TaskCreate and TaskUpdate as separate entries alongside the existing Task. The implementer should treat this criterion as satisfied by adding TaskCreate, TaskUpdate rather than verifying Task.
No sync obligation for this PR: The CLAUDE.md task-tracking instruction sync note (about rewriting the IMPORTANT: After reading the development plan phases... instruction) does not apply to pr-review.md -- that legacy instruction exists only in the three feature-dev-delegating commands (issue-implement, pr-review-fix, pr-ci-fix). The pr-review command delegates to pr-review-toolkit via Skill, which is a different delegation path.
Shared task context is clean today: pr-review-toolkit does not currently create any TaskCreate/TaskUpdate calls internally. The PR should document this observation. If the toolkit later adopts task tracking, the mixed flat list may need a naming convention to distinguish command-level from skill-level tasks.
No blockers. No prior branches, PRs, or partial work exists. The task graph table in the issue body provides an unambiguous specification.
Implementation Plan: Add task tracking to pr-review
Overview
Add TaskCreate/TaskUpdate progress tracking to the pr-review command. This is the first command in mach10 to adopt task tracking, following the conventions documented in CLAUDE.md (added by PR #103). The implementation inserts a Task Setup section and 10 transition instructions into the existing 9-step command structure.
Stage 1: Add task tracking to pr-review command
Scope: Single-file change to commands/pr-review.md plus a version bump in .claude-plugin/plugin.json.
Changes
-
Frontmatter (line 4): Add
TaskCreate, TaskUpdatetoallowed-toolsalongside the existingTasktool. -
New
## Task Setupsection (inserted between Step 2 and Step 3): Creates all 5 tasks upfront after input parsing and checkout, before any substantive work begins. All tasks start aspending. Includes instruction to store each returned ID for later use.Task Subject activeForm T1 Run PR review via pr-review-toolkit Running PR review T2 Post review comment Posting review comment T3 Run independent assessment Running independent assessment T4 Post assessment and present summary Posting assessment T5 Handle deferred items and recommend next steps Handling deferred items -
Transition instructions (10 one-line insertions at step boundaries):
Transition Location Placement T1 in_progress Step 3 Before the Skill tool invocation T1 completed Step 3 After the Skill call returns T2 in_progress Step 4 Before posting the review comment T2 completed Step 4 After the comment URL is captured T3 in_progress Step 5 Before launching the assessment subagent T3 completed Step 5 After the Task subagent returns T4 in_progress Step 6 Before posting the assessment comment T4 completed Step 7 After the CLI summary is presented T5 in_progress Step 8 Before the deferred-items AskUserQuestion T5 completed Step 9 After the next-step recommendation is displayed -
Version bump:
.claude-plugin/plugin.jsonfrom1.16.0to1.17.0.
Design decisions
- Prose style: Transitions use natural-language directives ("Mark T1 in_progress") consistent with the existing command voice, not pseudo-code.
- Separate transition lines: Each transition is a standalone sentence rather than combined ("Mark T1 completed, then T2 in_progress") for clarity and auditability.
- Prep before T1: Step 2 (checkout/pull) runs before T1 starts, per the issue spec. T1 brackets only the Skill call (Step 3).
- T4 spans Steps 6-7: Posting the assessment and presenting the CLI summary are a single logical delivery action.
- T5 spans Steps 8-9: The deferred-items interaction loop and next-step recommendation are a single concern per the CLAUDE.md user-interaction-loop convention.
What does NOT change
- No existing step boundaries are restructured.
- No sync obligations are triggered (the task-tracking instruction sync in CLAUDE.md applies only to the three feature-dev-delegating commands, not pr-review).
- The shared task context with
pr-review-toolkitrequires no naming convention -- the task subjects are already distinctive, and the CLAUDE.md convention handles robustness via stored IDs.
Notes
pr-review-toolkitdoes not currently create anyTaskCreate/TaskUpdatecalls internally. If it later adopts task tracking, the mixed flat list may need a naming convention to distinguish command-level from skill-level tasks.- Estimated ~20 lines of net-new instructional text. Final file length ~297 lines.
- No automated tests exist or are applicable for this change (markdown command definitions). Verification is manual: run
/mach10:pr-reviewon a test PR and observe task transitions.
This plan will guide staged implementation via /mach10:issue-implement 91 1.
Decision Log
Architecture Choice
Selected: Minimal changes approach -- smallest change surface, natural-language transitions, follows issue spec exactly.
Alternatives considered:
- Clean architecture (~30 lines, pseudo-code task creation, combined transitions): Rejected because pseudo-code syntax is inconsistent with the command file's natural-language voice, and 30 lines is disproportionate for what is essentially 10 one-line insertions plus a setup block.
- Pragmatic balance (~16 lines, pseudo-code with template comments, combined transitions): Rejected for the same prose-style inconsistency. While slightly more compact, combined transitions ("Mark T1 completed, then T2 in_progress") are harder to audit than separate lines.
Implementation Plan: Add task tracking to pr-review (revised)
Overview
Add TaskCreate/TaskUpdate progress tracking to the pr-review command. This is the first command in mach10 to adopt task tracking, following the conventions documented in CLAUDE.md (added by PR #103). The implementation inserts a Task Setup section and 10 transition instructions into the existing 9-step command structure.
Stage 1: Add task tracking to pr-review command
Scope: Single-file change to commands/pr-review.md plus a version bump in .claude-plugin/plugin.json.
Changes
-
Frontmatter (line 4): Add
TaskCreate, TaskUpdatetoallowed-toolsalongside the existingTasktool. -
New
## Task Setupsection (inserted between Step 2 and Step 3): Creates all 5 tasks upfront before any substantive work begins. All tasks start aspending. Includes instruction to store each returned ID for later use. Placed after Step 2 rather than after Step 1 -- if checkout fails, no orphaned tasks are created.Task Subject activeForm T1 Run PR review via pr-review-toolkit Running PR review T2 Post review comment Posting review comment T3 Run independent assessment Running independent assessment T4 Post assessment and present summary Posting assessment T5 Handle deferred items and recommend next steps Handling deferred items -
Transition instructions (10 one-line insertions at step boundaries):
Transition Location Placement T1 in_progress Step 3 Before the Skill tool invocation T1 completed Step 3 After the Skill call returns T2 in_progress Step 4 Before posting the review comment T2 completed Step 4 After the comment URL is captured T3 in_progress Step 5 Before launching the assessment subagent T3 completed Step 5 After the Task subagent returns T4 in_progress Step 6 Before posting the assessment comment T4 completed Step 7 After the CLI summary is presented T5 in_progress Step 8 Before the deferred-items AskUserQuestion T5 completed Step 9 After the next-step recommendation is displayed -
Version bump:
.claude-plugin/plugin.jsonfrom1.16.0to1.17.0.
Design decisions
- Prose style: Transitions use natural-language directives ("Mark T1 in_progress") consistent with the existing command voice, not pseudo-code.
- Separate transition lines: Each transition is a standalone sentence rather than combined ("Mark T1 completed, then T2 in_progress") for clarity and auditability.
- Error handling: Separate transition lines inherently satisfy the acceptance criterion that errored tasks remain
in_progress-- if a step fails, the subsequent "Mark T completed" instruction is never reached. - TaskUpdate scoping: All
TaskUpdatecalls happen in the outer command context. Step 5's subagent (launched via the Task tool) does not makeTaskUpdatecalls -- T3'scompletedtransition is issued after the Task call returns to the outer session. - Prep before T1: Step 2 (checkout/pull) runs before T1 starts, per the issue spec. T1 brackets only the Skill call (Step 3).
- T4 spans Steps 6-7: Posting the assessment and presenting the CLI summary are a single logical delivery action.
- T5 spans Steps 8-9: The deferred-items interaction loop and next-step recommendation are a single concern per the CLAUDE.md user-interaction-loop convention.
What does NOT change
- No existing step boundaries are restructured.
- No sync obligations are triggered (the task-tracking instruction sync in CLAUDE.md applies only to the three feature-dev-delegating commands, not pr-review).
- The shared task context with
pr-review-toolkitrequires no naming convention -- the task subjects are already distinctive, and the CLAUDE.md convention handles robustness via stored IDs.
Notes
pr-review-toolkitdoes not currently create anyTaskCreate/TaskUpdatecalls internally. If it later adopts task tracking, the mixed flat list may need a naming convention to distinguish command-level from skill-level tasks.- Estimated ~20 lines of net-new instructional text. Final file length ~297 lines.
- No automated tests exist or are applicable for this change (markdown command definitions). Verification is manual: run
/mach10:pr-reviewon a test PR and observe task transitions. - The task creation placement deviates from the issue spec's literal "after Step 1" to "after Step 2" for robustness. The observable task transition behavior is identical -- T1 still transitions to
in_progressat Step 3 in both cases.
This plan will guide staged implementation via /mach10:issue-implement 91 1.
Decision Log
Architecture Choice
Selected: Minimal changes approach -- smallest change surface, natural-language transitions, follows issue spec exactly.
Alternatives considered:
- Clean architecture (~30 lines, pseudo-code task creation, combined transitions): Rejected because pseudo-code syntax is inconsistent with the command file's natural-language voice, and 30 lines is disproportionate for what is essentially 10 one-line insertions plus a setup block.
- Pragmatic balance (~16 lines, pseudo-code with template comments, combined transitions): Rejected for the same prose-style inconsistency. While slightly more compact, combined transitions ("Mark T1 completed, then T2 in_progress") are harder to audit than separate lines.
Progress: Stage 1 implemented
Added TaskCreate/TaskUpdate progress tracking to the pr-review command.
Changes
- Frontmatter: Added
TaskCreate, TaskUpdatetoallowed-toolsalongside existingTask - Task Setup section: Inserted between Step 2 and Step 3, creates 5 tasks (T1-T5) upfront before substantive work begins
- 10 transition instructions: Each task transitions
in_progress->completedat the step boundaries specified in the issue's task graph - Version bump:
1.16.0->1.17.0
Design notes
- Natural-language prose style ("Mark T1 as
in_progressusingTaskUpdate.") consistent with existing command voice - Separate transition lines (not combined) for clarity and implicit error handling -- if a step fails, the
completedinstruction is never reached - Task Setup placed after Step 2 (checkout) rather than after Step 1 (parse input) to avoid orphaned tasks if checkout fails
pr-review-toolkitdoes not currently createTaskCreate/TaskUpdatecalls internally; if it later adopts task tracking, the mixed flat list may need a naming convention
Commit
f7bc850
Implementation Revised: 5 compound tasks -> 9 tasks (1-to-1 step mapping)
The pr-review task tracking implementation has been revised to follow the updated conventions (see comment on issue 81).
Changes
- Step 0 replaces Task Setup section -- input parsing and task list creation are now a proper step with its own bootstrap pattern.
- 9 tasks instead of 5 -- one per step (Step 0 through Step 8), replacing the T1-T5 compound mapping.
- Steps renumbered -- old Steps 1-9 become Step 0 (parse input) + Steps 1-8. Old Step 2 (checkout) becomes its own Step 1 instead of being folded into T1.
- "Step N:" subject convention -- task subjects use "Step N:
" format for sequence visibility.
New task table
| Task | Subject | activeForm |
|---|---|---|
| Step 0 | Step 0: Parse input and create task list | Parsing input |
| Step 1 | Step 1: Check out PR branch | Checking out PR branch |
| Step 2 | Step 2: Run PR review | Running PR review |
| Step 3 | Step 3: Post review comment | Posting review comment |
| Step 4 | Step 4: Run independent assessment | Running independent assessment |
| Step 5 | Step 5: Post assessment comment | Posting assessment |
| Step 6 | Step 6: Present CLI summary | Presenting summary |
| Step 7 | Step 7: Handle deferred items | Handling deferred items |
| Step 8 | Step 8: Recommend next steps | Recommending next steps |
The issue body's original task graph (T1-T5) and acceptance criteria are superseded by this 1-to-1 mapping.