Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces a comprehensive autonomous PR workflow command that guides Claude agents through the entire pull request lifecycle, from pre-PR validation through CI/CD monitoring to merge-ready state.
Key changes:
- Created a detailed 675-line
/pr-workflowcommand with 5-phase autonomous workflow covering validation, preparation, creation, CI/CD monitoring, and completion - Added token budget documentation to CLAUDE.md referencing the CLAUDE_CODE_MAX_OUTPUT_TOKENS environment variable
- Integrated with existing pr-lifecycle, resolve-pr-comments, and git-worktrees skills for comprehensive PR management
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 15 comments.
| File | Description |
|---|---|
| CLAUDE.md | Added output token budget documentation with guidance on managing API costs and staying within configured limits |
| .claude/commands/pr-workflow.md | New comprehensive slash command providing autonomous PR workflow from validation through merge, with special case handling and skill integration |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
030ea5a to
578b893
Compare
Substantive improvements: - Fixed PR number capture by extracting from gh pr create output - Added explicit sleep command in CI monitoring loop - Fixed run ID extraction with proper JSON query - Updated to use .resolved field for unresolved comment detection - Added iteration tracking mechanism with example code - Added validation to prevent empty PRs (check commit count) Documentation/formatting improvements: - Added clarifying comment for three-dot diff usage - Added concrete commit examples (not placeholders) - Clarified template placeholder replacement - Added bash language identifiers to all code fences - Added 🩹 emoji to type list with project convention note - Enhanced token budget documentation with defaults and limits - Added error handling guidance for git operations Fixes review comments from @Copilot in PR #385 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Substantive improvements: - Fixed PR number capture by extracting from gh pr create output - Added explicit sleep command in CI monitoring loop - Fixed run ID extraction with proper JSON query - Updated to use .resolved field for unresolved comment detection - Added iteration tracking mechanism with example code - Added validation to prevent empty PRs (check commit count) Documentation/formatting improvements: - Added clarifying comment for three-dot diff usage - Added concrete commit examples (not placeholders) - Clarified template placeholder replacement - Added bash language identifiers to all code fences - Added 🩹 emoji to type list with project convention note - Enhanced token budget documentation with defaults and limits - Added error handling guidance for git operations Fixes review comments from @Copilot in PR #385 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
cb97fe0 to
d5ee8b9
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
Substantive improvements: - Fixed PR number capture by extracting from gh pr create output - Added explicit sleep command in CI monitoring loop - Fixed run ID extraction with proper JSON query - Updated to use .resolved field for unresolved comment detection - Added iteration tracking mechanism with example code - Added validation to prevent empty PRs (check commit count) Documentation/formatting improvements: - Added clarifying comment for three-dot diff usage - Added concrete commit examples (not placeholders) - Clarified template placeholder replacement - Added bash language identifiers to all code fences - Added 🩹 emoji to type list with project convention note - Enhanced token budget documentation with defaults and limits - Added error handling guidance for git operations Fixes review comments from @Copilot in PR #385 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
5ad8e2b to
dd51824
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 15 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
…tion and management Implements a comprehensive slash command that guides Claude agents through the complete pull request lifecycle from pre-PR validation through to successful merge. Changes: - Created .claude/commands/pr-workflow.md with autonomous PR workflow - Phase 1: Pre-PR validation (worktree, branch naming, issue linking) - Phase 2: PR creation preparation (commit analysis, draft generation) - Phase 3: PR creation (with proper formatting and milestone) - Phase 4: CI/CD monitoring loop (iterative fixes until ready) - Phase 5: Completion verification - Added integration with pr-lifecycle and resolve-pr-comments skills - Added CLAUDE_CODE_MAX_OUTPUT_TOKENS documentation to CLAUDE.md Fixes #377 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Substantive improvements: - Fixed PR number capture by extracting from gh pr create output - Added explicit sleep command in CI monitoring loop - Fixed run ID extraction with proper JSON query - Updated to use .resolved field for unresolved comment detection - Added iteration tracking mechanism with example code - Added validation to prevent empty PRs (check commit count) Documentation/formatting improvements: - Added clarifying comment for three-dot diff usage - Added concrete commit examples (not placeholders) - Clarified template placeholder replacement - Added bash language identifiers to all code fences - Added 🩹 emoji to type list with project convention note - Enhanced token budget documentation with defaults and limits - Added error handling guidance for git operations Fixes review comments from @Copilot in PR #385 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…ents **Changes:** - Added step 7 to Phase 1: Check if PR already exists before attempting creation - If PR exists and is OPEN, skip directly to Phase 4 monitoring - Restructured Phase 4 to prioritize review comments FIRST (before CI checks) - Added automatic rebase handling with conflict detection - Added 5-7 minute stability monitoring after all fixes - Made command fully idempotent - safe to run multiple times - Removed interactive prompts for review comments - now fully autonomous **Phase 4 new order:** 1. Review comments (highest priority - human feedback) 2. Rebase check (ensure up-to-date with base) 3. CI/CD checks (code quality) 4. Stability monitoring (5-7 minutes) **Goal:** Run `/pr-workflow`, walk away, come back to ready PR with: - All review comments addressed and replied to - Branch rebased to main (no conflicts) - All CI checks passing - No manual intervention needed 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Critical fixes: - Fixed review comment detection: use .resolved == null (not false) - Fixed PR number extraction from gh pr create output - Added explicit sleep command in CI check loop - Fixed gh pr checks to document run ID extraction with --json Documentation improvements: - Clarified git diff three-dot usage with explanatory comment - Clarified commit message template with interpolation note - Fixed bash code block formatting in cleanup sections - Enhanced CLAUDE_CODE_MAX_OUTPUT_TOKENS guidance with defaults All 30 review comments addressed (15 Copilot + 15 user acknowledgments) Fixes #377
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
a242d53 to
58a88b4
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.
| # Recommended: use gh pr comment to reply to a review comment | ||
| gh pr comment <pr-number> --reply <comment-id> --body "..." | ||
| # Or, using the API directly: | ||
| gh api repos/<owner>/<repo>/pulls/<num>/comments/<comment-id>/replies -f body="..." |
There was a problem hiding this comment.
The API endpoint path is incorrect. According to the GitHub API documentation and the existing gh-pr-comment-reply.md command (lines 70-72), replies to PR review comments should use the endpoint repos/<owner>/<repo>/pulls/<num>/comments with the in_reply_to parameter, not a /replies subpath. The correct command should be: gh api repos/<owner>/<repo>/pulls/<num>/comments -f body=\"...\" -F in_reply_to=<comment-id>
| gh api repos/<owner>/<repo>/pulls/<num>/comments/<comment-id>/replies -f body="..." | |
| gh api repos/<owner>/<repo>/pulls/<num>/comments -f body="..." -F in_reply_to=<comment-id> |
| # NOTE: GitHub API returns `null` for unresolved comments, not `false` | ||
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | ||
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | ||
| --jq '.[] | select(.resolved == null) | {id, path, line, user: .user.login, body}' | ||
| ``` | ||
| - Count unresolved review comments (where `.resolved == null`) |
There was a problem hiding this comment.
The logic for detecting unresolved comments is inverted. In the GitHub API, the resolved field is true for resolved comments and is either false or null for unresolved comments. However, the comment says 'GitHub API returns null for unresolved comments' which contradicts GitHub's API behavior. The filter should check for both false and null, or use .resolved != true to properly identify unresolved comments. The current filter select(.resolved == null) will miss comments where resolved is explicitly false.
| # NOTE: GitHub API returns `null` for unresolved comments, not `false` | |
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | |
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | |
| --jq '.[] | select(.resolved == null) | {id, path, line, user: .user.login, body}' | |
| ``` | |
| - Count unresolved review comments (where `.resolved == null`) | |
| # NOTE: GitHub API returns `true` for resolved comments, and `false` or `null` for unresolved comments | |
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | |
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | |
| --jq '.[] | select(.resolved != true) | {id, path, line, user: .user.login, body}' |
- Count unresolved review comments (where
.resolved != true)
| # NOTE: GitHub API returns `null` for unresolved comments, not `false` | ||
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | ||
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | ||
| --jq '.[] | select(.resolved == null) | {id, path, line, user: .user.login, body}' | ||
| ``` | ||
| - Count unresolved review comments (where `.resolved == null`) |
There was a problem hiding this comment.
This instruction is inconsistent with the actual GitHub API behavior. As noted in comment 2, the filter should identify comments where .resolved != true to catch both false and null values for unresolved comments, not just null values.
| # NOTE: GitHub API returns `null` for unresolved comments, not `false` | |
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | |
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | |
| --jq '.[] | select(.resolved == null) | {id, path, line, user: .user.login, body}' | |
| ``` | |
| - Count unresolved review comments (where `.resolved == null`) | |
| # NOTE: GitHub API returns `false` or `null` for unresolved comments | |
| REPO=$(gh repo view --json nameWithOwner -q .nameWithOwner) | |
| gh api repos/$REPO/pulls/$PR_NUM/comments \ | |
| --jq '.[] | select(.resolved != true) | {id, path, line, user: .user.login, body}' |
- Count unresolved review comments (where
.resolved != true)
Summary
Changes
.claude/commands/pr-workflow.mdwith 5-phase autonomous workflow:CLAUDE.mdwith token budget documentation referencing CLAUDE_CODE_MAX_OUTPUT_TOKENSRelated Issues
Fixes #377
Test Plan
🤖 Generated with Claude Code
Co-Authored-By: Claude noreply@anthropic.com