Add task tracking to doc-review
Summary
Add TaskCreate/TaskUpdate progress tracking to the doc-review command. This command has heavy multi-agent orchestration (8 steps) with three rounds of agent fan-outs (discovery, review, verification), a per-finding user interaction loop, and a commit step. Task tracking will make the multi-phase flow observable.
Part of #81 (Tier 1 -- VERY HIGH priority). See #81 for task tracking conventions and overall context.
File: commands/doc-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 | Gather PR context and discover documentation | Discovering documentation | Before Step 2 | After Step 3 (doc discovery agents return, summary presented) |
| T2 | Review documentation against PR changes | Reviewing documentation | Before Step 4 (review agents launch) | After Step 4 returns |
| T3 | Present findings and get user decisions | Processing findings with user | Before Step 5 | After Step 5 (all findings processed) |
| T4 | Apply documentation changes | Applying changes | Before Step 6 | After Step 6 (edits applied) |
| T5 | Verify changes and commit | Verifying and committing | Before Step 7 (verification agents) | After Step 8 (committed, comment posted) |
Notes:
- T1 combines Steps 2-3 (context gathering + doc discovery) since they flow together into one preparatory phase.
- T2 is the parallel review agent fan-out -- the core analysis step.
- T3 covers the per-finding user interaction loop (accept/modify/reject for each finding) as a single task.
- T5 combines verification agents and commit/report since they are tightly coupled.
- If no findings are discovered, T3 and T4 transition quickly.
Delegation Notes
- Step 3 delegates to exploration subagents via the Task tool. T1 brackets this delegation.
- Step 4 delegates to review subagents via the Task tool. T2 brackets this delegation.
- Step 7 delegates to verification subagents via the Task tool. T5 brackets this delegation.
- None of the delegations' internal steps should be tracked by this command.
Acceptance Criteria
- [ ] All 5 tasks are created after input parsing, before any work begins
- [ ] Each task transitions
in_progress->completedat the boundaries described above - [ ] T2 brackets the review agent fan-out
- [ ] T3 covers the entire finding-by-finding interaction loop
- [ ] If no findings, T3 and T4 transition quickly (not skipped)
- [ ] T5 brackets both verification agents and the commit
- [ ]
allowed-toolsin frontmatter includesTask(if not already present)
Note: The task tracking conventions have been revised (see comment on issue 81). The task graph in this issue body follows the old "3-5 compound tasks" convention and is now stale. When implementing this sub-issue, derive the task graph using 1-to-1 step mapping: one task per command step, with a Step 0 that handles input parsing and task list creation. See the updated CLAUDE.md conventions and commands/pr-review.md for the reference implementation.
Independent Assessment
Scope: Small, single-file change to commands/doc-review.md. Well-established pattern with three reference implementations (pr-review, pr-pre-merge, pr-review-fix).
Stale task graph: The T1-T5 compound task graph in the issue body was written under the old convention and is stale (as flagged by the existing comment). Below is the derived 1-to-1 task graph using current conventions.
Derived Task Graph (1-to-1 step mapping)
Step 0 absorbs the current Step 1 (input parsing). Existing Steps 2-8 shift down to Steps 1-7. All 8 tasks are created in Step 0 after input parsing. Each task starts as pending.
| Task | Subject | activeForm | in_progress | completed |
|---|---|---|---|---|
| Step 0 | Step 0: Parse input and create task list | Parsing input | Immediately | After all tasks created |
| Step 1 | Step 1: Gather PR context | Gathering PR context | Before checkout | After context summary built |
| Step 2 | Step 2: Discover documentation | Discovering documentation | Before exploration agents launch | After summary table presented |
| Step 3 | Step 3: Fan out review agents | Reviewing documentation | Before review agents launch | After all agents return |
| Step 4 | Step 4: Present findings and get user decisions | Processing findings with user | Before report presented | After all findings processed |
| Step 5 | Step 5: Apply documentation changes | Applying changes | Before edits begin | After all edits applied |
| Step 6 | Step 6: Verify changes | Verifying changes | Before verification agents launch | After corrections applied |
| Step 7 | Step 7: Commit and report | Committing and reporting | Before staging files | After comment posted |
Notes:
- Step 0 absorbs the current Step 1 (Parse Input). Current Steps 2-8 become Steps 1-7.
TaskCreateandTaskUpdatemust be added toallowed-toolsin frontmatter.- Agent delegations in Steps 2, 3, and 6 are bracketed by their step's task -- no internal tracking of subagent work.
- If no findings are discovered in Step 3, Steps 4 and 5 transition quickly (not skipped).
Implementation Plan: Add task tracking to doc-review
Stage 1: Add task tracking to doc-review.md
What it accomplishes: Adds TaskCreate/TaskUpdate progress tracking to the doc-review command following established conventions.
File modified: commands/doc-review.md
Changes:
- Frontmatter: Add
TaskCreate, TaskUpdatetoallowed-tools - Step renumbering: Current Step 1 (Parse Input) becomes Step 0; current Steps 2-8 become Steps 1-7
- Step 0 bootstrap: Rewrite current Step 1 into Step 0 format -- parse input, create Step 0 task and mark
in_progress, create remaining 7 tasks aspending, mark Step 0completed - Task tracking instrumentation: Add
Mark Step N as in_progress/completedlines at the start/end of each step (Steps 1-7), following the task graph boundaries below - Task table: Insert the full task table in Step 0 (8 rows: Steps 0-7)
Task graph:
| Task | Subject | activeForm | in_progress | completed |
|---|---|---|---|---|
| Step 0 | Step 0: Parse input and create task list | Parsing input | Immediately | After all tasks created |
| Step 1 | Step 1: Gather PR context | Gathering PR context | Before checkout | After context summary built |
| Step 2 | Step 2: Discover documentation | Discovering documentation | Before exploration agents launch | After summary table presented |
| Step 3 | Step 3: Fan out review agents | Reviewing documentation | Before review agents launch | After all agents return |
| Step 4 | Step 4: Present findings and get user decisions | Processing findings with user | Before report presented | After all findings processed |
| Step 5 | Step 5: Apply documentation changes | Applying changes | Before edits begin | After all edits applied |
| Step 6 | Step 6: Verify changes | Verifying changes | Before verification agents launch | After corrections applied |
| Step 7 | Step 7: Commit and report | Committing and reporting | Before staging files | After comment posted |
Testing: This is a plugin command definition (markdown) -- no testable runtime code. Verification is by reading the file and confirming it matches the conventions and reference implementations.
Decision Log
Architecture Choice
Selected the only viable approach: follow the assessment's derived task graph exactly, using pr-review.md as the primary reference implementation. No alternatives were meaningfully differentiated -- the conventions are prescriptive with three existing reference implementations (pr-review.md, pr-pre-merge.md, pr-review-fix.md).
This comment will guide staged implementation via /mach10:issue-implement 94 1.
Implementation Plan: Add task tracking to doc-review
Stage 1: Add task tracking to doc-review.md and update CLAUDE.md sync annotation
What it accomplishes: Adds TaskCreate/TaskUpdate progress tracking to the doc-review command following established conventions, and updates the CLAUDE.md sync annotation affected by step renumbering.
Files modified:
commands/doc-review.mdCLAUDE.md(sync annotation only)
Changes to commands/doc-review.md:
- Frontmatter: Add
TaskCreate, TaskUpdatetoallowed-tools - Step renumbering: Current Step 1 (Parse Input) becomes Step 0; current Steps 2-8 become Steps 1-7. Update step headings to match the task subjects below.
- Step 0 bootstrap: Rewrite current Step 1 into Step 0 format -- parse input, create Step 0 task and mark
in_progress, create remaining 7 tasks aspending(store each returned task ID -- do not assume IDs are sequential), mark Step 0completed. If input parsing fails, no tasks are created. - Task tracking instrumentation: Add
Mark Step N as in_progress/completedlines at the start/end of each step (Steps 1-7), following the reference implementation pattern. - Task table (3-column format matching reference implementations):
| Task | Subject | activeForm |
|---|---|---|
| Step 0 | Step 0: Parse input and create task list | Parsing input |
| Step 1 | Step 1: Gather PR context | Gathering PR context |
| Step 2 | Step 2: Discover documentation | Discovering documentation |
| Step 3 | Step 3: Fan out review agents | Reviewing documentation |
| Step 4 | Step 4: Present findings and get user decisions | Processing findings with user |
| Step 5 | Step 5: Apply documentation changes | Applying changes |
| Step 6 | Step 6: Verify changes | Verifying changes |
| Step 7 | Step 7: Commit and report | Committing and reporting |
Changes to CLAUDE.md:
--commentstwo-call sync bullet (line 68): Updatecommands/doc-review.md (Step 2)tocommands/doc-review.md (Step 1)to reflect the step renumbering.
Testing: This is a plugin command definition (markdown) -- no testable runtime code. Verification is by reading the file and confirming it matches the conventions and reference implementations.
Decision Log
Architecture Choice
Follow the assessment's derived task graph exactly, using pr-review.md as the primary reference implementation. No alternatives were meaningfully differentiated.
Addressed from plan review
- Important finding 1: Added CLAUDE.md sync annotation update as an explicit change item.
- Suggestion 1: Changed task table to 3-column format matching reference implementations.
- Suggestion 2: Step headings will be updated to match task subjects for consistency.
This comment will guide staged implementation via /mach10:issue-implement 94 1.
Progress: Stage 1 complete
Implemented task tracking for the doc-review command per the implementation plan.
Commit: f6d804e
Changes:
commands/doc-review.md: AddedTaskCreate/TaskUpdateto allowed-tools, renumbered steps (old Steps 1-8 became Steps 0-7), added Step 0 bootstrap with task table, addedin_progress/completedmarkers on all steps, updated internal cross-referencesCLAUDE.md: Updated--commentstwo-call sync annotation from(Step 2)to(Step 1)to reflect step renumbering
All six plan items addressed. No deviations from the plan.
Closing -- task tracking for doc-review was implemented in PR #112 (commit cfde894). The PR used 'Part of #81' but omitted 'Fixes #94'.