mach10 icon indicating copy to clipboard operation
mach10 copied to clipboard

Add task tracking to pr-review-fix

Open LeanAndMean opened this issue 7 months ago • 4 comments

Summary

Add TaskCreate/TaskUpdate progress tracking to the pr-review-fix command. This command gathers PR and review context, identifies which findings to fix (potentially with user interaction for finding selection), then delegates the actual fixes to feature-dev. Task tracking will ensure every step is an explicit checkpoint that cannot be silently skipped.

Part of #81 (Tier 2 -- HIGH priority). See #81 for task tracking conventions and overall context.

File: commands/pr-review-fix.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 Step 0 after input parsing. Each task starts as pending (except Step 0 itself, which starts as in_progress).

Task Subject activeForm in_progress completed
Step 0 Step 0: Parse input and create task list Parsing input Immediately after creation After all other tasks are created
Step 1 Step 1: Gather PR and review context Gathering context Before fetching PR and locating review/assessment comments After review comment located, assessment located if provided
Step 2 Step 2: Identify issues to fix Identifying issues Before matching identifiers or presenting findings to user After findings identified, user has selected if multiSelect was needed
Step 3 Step 3: Fix review findings via feature-dev Fixing findings Before Skill invocation After Skill returns
Step 4 Step 4: Recommend next steps Recommending next steps Before displaying suggestion After suggestion displayed

Notes:

  • Step 0 absorbs the current Step 1 (Parse Input) and adds the task bootstrap. Current Steps 2-5 become Steps 1-4.
  • Step 2 may be very quick (if specific findings were provided as F/S identifiers) or involve user interaction (if only the PR number was given and findings need to be selected via AskUserQuestion with multiSelect).
  • Step 3 wraps the feature-dev skill delegation -- the bulk of execution time.
  • 5 tasks follows the 1-to-1 step mapping convention: one task per command step.

Delegation Notes

  • Step 3 delegates to /feature-dev:feature-dev via the Skill tool. The Step 3 task brackets this delegation.
  • The Skill invocation instruction should be rewritten from the old "add each phase as a task to your todo list" wording to explicit TaskCreate/TaskUpdate references per the delegation phase tracking convention. Instruct feature-dev to create a task for each phase using "Phase N: <action>" subject convention.
  • The skill's internal phase tasks are not tracked by this command -- they appear in the shared flat task list alongside Steps 0-4.

Shared Task Context Warning

Step 3 delegates to /feature-dev:feature-dev via the Skill tool, which runs in the same session context. Any tasks that feature-dev creates internally will appear in the same flat task list alongside Steps 0-4. The "Step N:" vs "Phase N:" subject prefixes provide visual distinction.

When implementing task tracking for this command:

  • Expect a mixed task list after Step 3 transitions to in_progress. Feature-dev will add its own Phase tasks at the same level as Steps 0-4.
  • Use stored task IDs (not positional IDs) to locate Steps 0-4 when transitioning them after delegation returns.
  • Do not suppress feature-dev's internal task creation -- those tasks provide valuable progress visibility during the fix phase.

Implementation Checklist

Changes to commands/pr-review-fix.md:

  • [ ] Add TaskCreate, TaskUpdate to allowed-tools in frontmatter
  • [ ] Add Step 0 that parses input and creates the full task list (absorbing current Step 1)
  • [ ] Renumber current Steps 2-5 to Steps 1-4
  • [ ] Add TaskUpdate in_progress/completed markers at start/end of each step
  • [ ] Rewrite the Step 3 Skill invocation instruction from old "todo list" wording to explicit TaskCreate/TaskUpdate with "Phase N:" convention

Other changes:

  • [ ] Bump plugin version in .claude-plugin/plugin.json
  • [ ] Update CLAUDE.md "Task-tracking instruction sync" note to reflect that pr-review-fix has been converted (if all three feature-dev-delegating commands are done, update the note fully; otherwise note partial progress)

Acceptance Criteria

  • [ ] All 5 tasks (Steps 0-4) are created in Step 0 after input parsing, before any work begins
  • [ ] Step 0 is created first and immediately marked in_progress, then completed after all other tasks exist
  • [ ] Each subsequent step transitions in_progress -> completed at the boundaries described in the task graph
  • [ ] Step 2 covers the optional user selection flow (multiSelect for finding IDs)
  • [ ] Step 3 brackets the Skill invocation
  • [ ] Step 3 Skill instruction uses explicit TaskCreate/TaskUpdate references with "Phase N:" convention (not the old "todo list" wording)
  • [ ] Task tracking does not interfere with the delegated /feature-dev:feature-dev skill's behavior
  • [ ] The mixed task list (command Step tasks + feature-dev Phase tasks) remains intelligible
  • [ ] allowed-tools in frontmatter includes TaskCreate and TaskUpdate

LeanAndMean avatar Apr 09 '26 17:04 LeanAndMean

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.

LeanAndMean avatar Apr 13 '26 19:04 LeanAndMean

Implementation Plan: Add task tracking to pr-review-fix

Stage 1: Add task tracking to pr-review-fix

What it accomplishes: Adds TaskCreate/TaskUpdate progress tracking to the pr-review-fix command, making every step an explicit checkpoint that cannot be silently skipped. Rewrites the Skill invocation instruction to use the explicit TaskCreate/TaskUpdate delegation phase tracking convention.

Files modified:

  • commands/pr-review-fix.md -- add task tracking instrumentation, renumber steps, rewrite Skill instruction
  • CLAUDE.md -- update two sync notes to reflect new step numbers and conversion status
  • .claude-plugin/plugin.json -- version bump 1.18.0 -> 1.19.0

Detailed changes to commands/pr-review-fix.md

  1. Frontmatter: Add TaskCreate, TaskUpdate to allowed-tools
  2. Step 0 (absorbs current Step 1): Keep all existing parse input prose. Add task bootstrap block: create Step 0 task first and mark in_progress, create remaining 4 tasks as pending, present task table, mark Step 0 completed
  3. Step 1 (current Step 2, renumbered): Add in_progress bookend after heading, completed bookend at end. Update cross-reference from "Step 4" to "Step 3"
  4. Step 2 (current Step 3, renumbered): Add in_progress/completed bookends
  5. Step 3 (current Step 4, renumbered): Add in_progress/completed bookends. Replace IMPORTANT: After reading the development plan phases, add each phase as a task to your todo list so you do not skip any phases. with new wording using explicit TaskCreate/TaskUpdate references and "Phase N: <action>" convention. Update "retrieved in Step 2" to "retrieved in Step 1"
  6. Step 4 (current Step 5, renumbered): Add in_progress/completed bookends

Detailed changes to CLAUDE.md

  1. Finding-identifier sync (line 67): Update commands/pr-review-fix.md (argument-hint, Step 1 examples/parsing, Step 3 extraction) to commands/pr-review-fix.md (argument-hint, Step 0 examples/parsing, Step 2 extraction)
  2. Task-tracking instruction sync (line 69): Remove commands/pr-review-fix.md (Step 4) from the old-wording list. Add note that pr-review-fix has adopted native tracking with "Phase N:" convention in its Step 3 Skill invocation. Update "three" to "two" for remaining commands.

Detailed changes to .claude-plugin/plugin.json

  • Bump version from 1.18.0 to 1.19.0

Task graph

Task Subject activeForm in_progress completed
Step 0 Step 0: Parse input and create task list Parsing input Immediately after creation After all other tasks are created
Step 1 Step 1: Gather PR and review context Gathering context Before fetching PR and locating review/assessment comments After review comment located, assessment located if provided
Step 2 Step 2: Identify issues to fix Identifying issues Before matching identifiers or presenting findings to user After findings identified, user has selected if multiSelect was needed
Step 3 Step 3: Fix review findings via feature-dev Fixing findings Before Skill invocation After Skill returns
Step 4 Step 4: Recommend next steps Recommending next steps Before displaying suggestion After suggestion displayed

Testing

This is a plugin definition (no runtime code). Verification is manual: review the resulting file against the pr-review.md reference implementation and the CLAUDE.md conventions.


This comment will guide staged implementation via /mach10:issue-implement 99 1.

LeanAndMean avatar Apr 13 '26 20:04 LeanAndMean

Implementation Plan: Add task tracking to pr-review-fix

Stage 1: Add task tracking to pr-review-fix

What it accomplishes: Adds TaskCreate/TaskUpdate progress tracking to the pr-review-fix command, making every step an explicit checkpoint that cannot be silently skipped. Rewrites the Skill invocation instruction to use the explicit TaskCreate/TaskUpdate delegation phase tracking convention.

Files modified:

  • commands/pr-review-fix.md -- add task tracking instrumentation, renumber steps, rewrite Skill instruction
  • CLAUDE.md -- update two sync notes to reflect new step numbers and conversion status
  • .claude-plugin/plugin.json -- version bump 1.18.0 -> 1.19.0

Detailed changes to commands/pr-review-fix.md

  1. Frontmatter: Add TaskCreate, TaskUpdate to allowed-tools (after Task, before Edit).

  2. Step 0 (absorbs current Step 1): Keep all existing parse-input prose (argument structure, 4 example inputs, extraction logic). After the parse-input block, add the task bootstrap:

    • Create Step 0 task via TaskCreate and immediately mark in_progress.
    • Create Steps 1-4 as pending.
    • Store each returned task ID for use in later TaskUpdate calls -- do not assume IDs are sequential.
    • Mark Step 0 completed.
  3. Step 1 (current Step 2 "Gather Context", renumbered): Add in_progress bookend as first instruction, completed bookend as last instruction. Update the cross-reference at the end of the step from "Save the review comment content for use in Step 4" to "Save the review comment content for use in Step 3".

  4. Step 2 (current Step 3 "Identify Issues to Fix", renumbered): Add in_progress/completed bookends.

  5. Step 3 (current Step 4 "Delegate to Feature Dev", renumbered): Add in_progress/completed bookends. Replace the old Skill invocation instruction:

    Old:

    IMPORTANT: After reading the development plan phases, add each phase as a task to your todo list so you do not skip any phases.

    New:

    IMPORTANT: Use TaskCreate to create a task for each phase of the 7-phase development plan before starting work. Use "Phase N: <action>" as the subject format (e.g., "Phase 1: Understand the codebase"). Mark each phase in_progress via TaskUpdate when starting and completed when finishing. Do not skip any phases.

    Update the two "retrieved in Step 2" references to "retrieved in Step 1".

  6. Step 4 (current Step 5, renumbered and renamed): Rename heading from "## Step 5: After Fixes" to "## Step 4: Recommend next steps" (matching the task subject and the pr-review.md convention). Add in_progress/completed bookends.

Task graph

Task Subject activeForm in_progress completed
Step 0 Step 0: Parse input and create task list Parsing input Immediately after creation After all other tasks are created
Step 1 Step 1: Gather PR and review context Gathering context Before fetching PR and locating review/assessment comments After review comment located, assessment located if provided
Step 2 Step 2: Identify issues to fix Identifying issues Before matching identifiers or presenting findings to user After findings identified, user has selected if multiSelect was needed
Step 3 Step 3: Fix review findings via feature-dev Fixing findings Before Skill invocation After Skill returns
Step 4 Step 4: Recommend next steps Recommending next steps Before displaying suggestion After suggestion displayed

Detailed changes to CLAUDE.md

  1. Finding-identifier sync (line 67): Update commands/pr-review-fix.md (argument-hint, Step 1 examples/parsing, Step 3 extraction) to commands/pr-review-fix.md (argument-hint, Step 0 examples/parsing, Step 2 extraction).

  2. Task-tracking instruction sync (line 69): Three edits within this bullet:

    • Remove commands/pr-review-fix.md (Step 4) from the old-wording command list, leaving commands/issue-implement.md (Step 4) and commands/pr-ci-fix.md (Step 4).
    • Change "all three locations" to "both locations".
    • In the closing sentence, change "the three feature-dev-delegating commands" to "the two remaining feature-dev-delegating commands". Add a sentence noting that pr-review-fix has adopted native TaskCreate/TaskUpdate tracking with "Phase N:" convention in its Step 3 Skill invocation.

Detailed changes to .claude-plugin/plugin.json

  • Bump version from 1.18.0 to 1.19.0.

Testing

This is a plugin definition (no runtime code). Verification is manual: review the resulting file against the pr-review.md reference implementation and the CLAUDE.md conventions.


This comment will guide staged implementation via /mach10:issue-implement 99 1.

LeanAndMean avatar Apr 13 '26 20:04 LeanAndMean

Progress: Stage 1 complete

Implemented task tracking for the pr-review-fix command per the implementation plan.

Changes (commit 53738ce):

  • commands/pr-review-fix.md -- Added TaskCreate/TaskUpdate to allowed-tools; added Step 0 bootstrap (absorbs old Step 1) with task table; renumbered old Steps 2-5 to Steps 1-4; added in_progress/completed bookends to each step; rewrote Skill invocation instruction to use explicit TaskCreate/TaskUpdate with "Phase N:" convention; updated cross-references
  • CLAUDE.md -- Updated finding-identifier sync note (Step 0/Step 2 references) and task-tracking instruction sync note (removed pr-review-fix from old-wording list, noted native tracking adoption, updated counts)
  • .claude-plugin/plugin.json -- Version bump 1.18.0 -> 1.19.0

All acceptance criteria from the issue are met. Verified against pr-review.md reference implementation.

LeanAndMean avatar Apr 13 '26 20:04 LeanAndMean