mach10 icon indicating copy to clipboard operation
mach10 copied to clipboard

Commands drop issue/PR body and use raw $ARGUMENTS in gh calls

Open LeanAndMean opened this issue 9 months ago • 3 comments

Summary

Two related problems affect multiple commands in the plugin:

Problem 1: --comments drops the issue/PR body

When commands gather context using gh issue view <number> --comments or gh pr view <number> --comments, the --comments flag causes gh to display only the comments, completely omitting the title and body. This means downstream workflows never receive the original problem statement, acceptance criteria, or PR description.

Verified behavior:

  • gh issue view 4 → shows title + body
  • gh issue view 4 --comments → shows only comments, no body at all

Affected commands (7):

Command Location What gets lost
issue-implement.md Step 3, line 74 Issue body (problem statement, acceptance criteria)
issue-plan.md Step 1, line 19 Issue body
issue-review-plan.md Step 1, line 19 Issue body (original requirements)
issue-assessment.md Step 1, line 19 Issue body (problem statement)
pr-review-validate.md Step 1, line 19 PR description (purpose and scope)
pr-review-fix.md Step 2, line 33 PR description
doc-review.md Step 2, line 39 PR description

Problem 2: Raw $ARGUMENTS used directly in gh commands

Six commands use $ARGUMENTS directly in gh CLI calls (e.g., gh issue view $ARGUMENTS --comments) without first parsing out the issue/PR number. If the user passes additional context (e.g., 6 focus on API changes), the gh command receives the entire string and fails.

The other six commands that accept complex input already have a "Parse Input" step that extracts the number and handles optional context. The affected commands lack this.

Affected commands (6):

Command Raw $ARGUMENTS usage
issue-plan.md gh issue view $ARGUMENTS, gh issue comment $ARGUMENTS, feature/issue-$ARGUMENTS-<slug>
issue-review-plan.md gh issue view $ARGUMENTS
issue-assessment.md gh issue view $ARGUMENTS, gh issue edit $ARGUMENTS, gh issue comment $ARGUMENTS
pr-review-validate.md gh pr view $ARGUMENTS, gh pr comment $ARGUMENTS
pr-merge.md gh pr view $ARGUMENTS, gh pr merge $ARGUMENTS
pr-pre-merge.md gh pr checkout $ARGUMENTS

Commands that already handle this correctly: issue-implement, pr-review, pr-review-fix, pr-ci-fix, doc-review, pr-create.

Overlap

Four commands have both problems (issue-plan, issue-review-plan, issue-assessment, pr-review-validate). Two have only the --comments bug (issue-implement, pr-review-fix, doc-review). Two have only the raw $ARGUMENTS problem (pr-merge, pr-pre-merge).

Acceptance Criteria

  • [ ] All 7 --comments commands retrieve both the body and comments separately
  • [ ] All 6 raw-$ARGUMENTS commands have a Parse Input step that extracts the number before use in gh calls
  • [ ] The issue-implement delegation prompt explicitly references using the issue body as context
  • [ ] Commands that already work correctly are not regressed

LeanAndMean avatar Feb 20 '26 21:02 LeanAndMean

Implementation Plan

Scope: Fix the --comments body-dropping bug across all 7 affected commands (not just issue-implement).

Problem

gh issue view <number> --comments and gh pr view <number> --comments both omit the title and body, showing only comments. This means context-gathering steps in 7 commands silently lose the issue description or PR description.

Affected Commands

Command gh call location What gets lost
issue-implement.md Step 3, line 74 Issue body (problem statement, acceptance criteria)
issue-plan.md Step 1, line 19 Issue body
issue-review-plan.md Step 1, line 19 Issue body (original requirements)
issue-assessment.md Step 1, line 19 Issue body (problem statement)
pr-review-validate.md Step 1, line 19 PR description (purpose and scope)
pr-review-fix.md Step 2, line 33 PR description
doc-review.md Step 2, line 39 PR description

Commands that are NOT affected: pr-create, pr-ci-fix, pr-merge, pr-review (line 61 is a URL retrieval, not context gathering), push.

Stage 1: Fix all 7 commands

Fix pattern: Replace each context-gathering --comments call with two separate calls:

gh <entity> view <number>             # title + body
gh <entity> view <number> --comments  # comments

Files to modify:

  1. commands/issue-implement.md — Steps 3-4: split the gh call and update the feature-dev delegation prompt to explicitly reference the issue body
  2. commands/issue-plan.md — Step 1: split the gh call
  3. commands/issue-review-plan.md — Step 1: split the gh call
  4. commands/issue-assessment.md — Step 1: split the gh call
  5. commands/pr-review-validate.md — Step 1: split the gh call
  6. commands/pr-review-fix.md — Step 2: split the gh call
  7. commands/doc-review.md — Step 2: split the gh call
  8. .claude-plugin/plugin.json — Version bump 0.1.3 → 0.1.4

Testing: Manual verification. No automated tests in this repo.


This plan will guide staged implementation via /mach10:issue-implement.

LeanAndMean avatar Feb 20 '26 21:02 LeanAndMean

Revised Implementation Plan

Supersedes the previous plan comment. Scope expanded to cover both the --comments body-dropping bug and the raw $ARGUMENTS problem.

Stage 1: Fix all 9 affected commands

Two fix patterns applied across the affected commands:

Fix A — --comments body-dropping (7 commands): Replace each context-gathering --comments call with two separate calls:

gh <entity> view <number>             # title + body
gh <entity> view <number> --comments  # comments

Fix B — Raw $ARGUMENTS (6 commands): Add a Parse Input step (following the existing pattern from issue-implement, pr-review, etc.) that extracts the issue/PR number from $ARGUMENTS before any gh call, and replace all raw $ARGUMENTS references in gh commands with the parsed <issue-number> or <pr-number> placeholder.

Files to modify

# File Fix A Fix B Notes
1 commands/issue-implement.md Yes — Already has Parse Input. Also update Step 4 delegation prompt to reference issue body.
2 commands/issue-plan.md Yes Yes Add Parse Input. Replace $ARGUMENTS in gh calls and branch name.
3 commands/issue-review-plan.md Yes Yes Add Parse Input. Replace $ARGUMENTS in gh call.
4 commands/issue-assessment.md Yes Yes Add Parse Input. Replace $ARGUMENTS in gh calls (view, edit, comment).
5 commands/pr-review-validate.md Yes Yes Add Parse Input. Replace $ARGUMENTS in gh calls (view, comment).
6 commands/pr-review-fix.md Yes — Already has Parse Input.
7 commands/doc-review.md Yes — Already has Parse Input.
8 commands/pr-merge.md — Yes Add Parse Input. Replace $ARGUMENTS in gh calls (view, merge).
9 commands/pr-pre-merge.md — Yes Add Parse Input. Replace $ARGUMENTS in gh calls (checkout).
10 .claude-plugin/plugin.json — — Version bump 0.1.3 → 0.1.4.

Testing

Manual verification. No automated tests in this repo. For each modified command, confirm:

  • gh invocations use parsed number, not raw $ARGUMENTS
  • Context-gathering steps retrieve both body and comments

This plan will guide staged implementation via /mach10:issue-implement.

LeanAndMean avatar Feb 20 '26 21:02 LeanAndMean

Stage 1 Progress

Implemented both fix patterns across all 9 affected commands:

Fix A -- --comments body-dropping (7 commands): Split gh <entity> view <N> --comments into two calls (view <N> for title + body, view <N> --comments for comments only) in: issue-implement, issue-plan, issue-review-plan, issue-assessment, pr-review-validate, pr-review-fix, doc-review.

Fix B -- Raw $ARGUMENTS parsing (6 commands): Added Parse Input step and replaced raw $ARGUMENTS in gh calls with parsed placeholders in: issue-plan, issue-review-plan, issue-assessment, pr-review-validate, pr-merge, pr-pre-merge.

Additional fix: Removed erroneous /clear before /mach10:push suggestion in issue-implement -- push needs session context to route the progress comment correctly.

Version bump: 0.1.3 -> 0.1.4

Commit: af5f4c2

LeanAndMean avatar Feb 20 '26 22:02 LeanAndMean