PR Resolve Workflow
When activated, execute this workflow to systematically address all PR review comments:
Steps
- •
Determine Issue ID: Extract the issue number from the branch name (e.g.,
BT-10fromBT-10-implement-erlang-codegen). If not in branch name, try:a. Worktree name: If in a git worktree with a name matching
BT-{number}:bash# Check if this is a worktree git rev-parse --git-dir 2>/dev/null | grep -q "worktrees" # Extract issue ID from directory name basename "$(pwd)" | grep -oE '^BT-[0-9]+'
Example:
/workspaces/BT-34→ issueBT-34 - •
Get PR review comments: Fetch all unresolved review comments from the active PR:
bashgh api repos/{owner}/{repo}/pulls/{pr}/comments --jq '.[] | select(.in_reply_to_id == null) | {id, path, body}' - •
Analyze and plan: For each review comment:
- •Understand what the reviewer is asking for
- •Determine if it needs a code fix, documentation, Linear issue, or just clarification
- •Create a todo list with all items to address
- •
Run tests first: Verify current state passes all checks:
bashjust ci
This runs all CI checks (build, clippy, fmt-check, test, test-e2e).
- •
Write tests first (TDD): For each code fix needed:
- •Write a failing test that demonstrates the bug or missing behavior
- •Run the test to confirm it fails as expected
- •This ensures the fix is verifiable and prevents regressions
- •
Address each comment: For each item in the plan:
- •Make the necessary code changes to make the test pass
- •Run tests after each significant change to catch regressions early
- •If a comment requires a follow-up Linear issue (e.g., "TODO for later"):
- •Create the Linear issue with full context
- •Add a TODO comment in the code referencing the issue number
- •Mark the todo item complete
- •
Run full test suite: After all changes:
bashjust ci
- •
Commit changes: Stage and commit with a descriptive message (using issue ID from step 1):
bashgit add -A git commit -m "fix: address PR review comments BT-{number} - Summary of each fix - Reference any Linear issues created" - •
Push changes:
bashgit push
- •
Reply to each comment: For every review comment that was addressed, add a reply explaining what was done:
gh api repos/{owner}/{repo}/pulls/{pr}/comments/{comment_id}/replies -f body="<explanation of fix, commit hash, any Linear issues created>"
Include:
- •Commit hash where the fix was made
- •Brief description of the change
- •Links to any Linear issues created for follow-up work
- •
Report summary: Provide a summary table of all comments and how they were resolved.
- •
Auto-chain to done: If all review comments have been successfully resolved (no failures, no pending issues), automatically activate the
doneskill:- •Inform the user that all PR comments have been addressed
- •Activate the
doneskill without waiting for user confirmation
If there are any issues or manual steps needed, report them and wait for user input instead.