From 432428213349798b710b8a6e0ba7ce5d4aaea35e Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Sun, 15 Feb 2026 21:54:20 -0500 Subject: [PATCH 1/3] Update Claude instructions/add fix for "update pull request" command --- .claude/commands/update-pull-request.md | 16 ++++++++-------- CLAUDE.md | 8 +++++++- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/.claude/commands/update-pull-request.md b/.claude/commands/update-pull-request.md index 2eb7bb8c..6148703a 100644 --- a/.claude/commands/update-pull-request.md +++ b/.claude/commands/update-pull-request.md @@ -373,16 +373,16 @@ Follow these steps: # If complex formatting is needed, save response to a variable first and ensure proper escaping gh api graphql -f query=' - mutation { + mutation($pullRequestId: ID!, $body: String!, $inReplyTo: ID!) { addPullRequestReviewComment(input: { - pullRequestId: "'$PR_ID'", - body: "", - inReplyTo: "" + pullRequestId: $pullRequestId, + body: $body, + inReplyTo: $inReplyTo }) { comment { id } } } - ' + ' -f pullRequestId="${PR_ID}" -f body="" -f inReplyTo="" ``` Use the PR node ID from `metadata.json` for `pullRequestId`. @@ -415,15 +415,15 @@ Follow these steps: ```bash gh api graphql -f query=' - mutation { - resolveReviewThread(input: {threadId: ""}) { + mutation($threadId: ID!) { + resolveReviewThread(input: {threadId: $threadId}) { thread { id isResolved } } } - ' + ' -f threadId="" ``` - Map each comment back to its parent thread using the data structure from step 3 parsing. diff --git a/CLAUDE.md b/CLAUDE.md index 89ce0deb..7dedd96f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -41,7 +41,7 @@ This is a collection of guidelines and references. - Structured log messages should be short sentences with sentence case (e.g., "Starting data sync" not "STARTING DATA SYNC") - When debugging or fixing bugs, check Sentry errors, ECS logs, and Alpaca account status to understand what happened - After fixing a bug, create a git commit with a detailed summary of the root cause and fix in the commit message -- When creating GitHub issues or pull requests, use the templates provided in the `.github/` directory +- When creating GitHub issues or pull requests, use the templates in the `.github/` directory and follow commented instructions - Only use labels already available on the GitHub repository for issues and pull requests - When naming branches, use an all-lowercase, hyphenated, and concise summary of the work being done - `tools/` folder contains development utilities and scripts @@ -57,3 +57,9 @@ This is a collection of guidelines and references. - Make every change as simple as possible and impact minimal code - Find root causes and avoid temporary fixes - maintain high standards - Changes should only touch what's necessary to avoid introducing bugs +- If uncertainty arises, ask for help or input rather than guessing +- Do not introduce abstractions for single-use code +- Always match existing styles and patterns in the codebase for consistency +- When fixing a bug, write tess that reproduce the bug before fixing it, then verify the tests pass after the fix +- Do not use emojis in commit messages, GitHub issues, or pull requests - maintain a professional tone +- When possible, use GitHub's GraphQL API for more efficient data retrieval in scripts and tools From 04532084f2bafed5ac8f8d270e5b2e63c307e3f6 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Sun, 15 Feb 2026 22:09:19 -0500 Subject: [PATCH 2/3] Add minor typo fix --- CLAUDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CLAUDE.md b/CLAUDE.md index 7dedd96f..5772954f 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -60,6 +60,6 @@ This is a collection of guidelines and references. - If uncertainty arises, ask for help or input rather than guessing - Do not introduce abstractions for single-use code - Always match existing styles and patterns in the codebase for consistency -- When fixing a bug, write tess that reproduce the bug before fixing it, then verify the tests pass after the fix +- When fixing a bug, write tests that reproduce the bug before fixing it, then verify the tests pass after the fix - Do not use emojis in commit messages, GitHub issues, or pull requests - maintain a professional tone - When possible, use GitHub's GraphQL API for more efficient data retrieval in scripts and tools From aaad22f46e9adb2252dc2ad804097e2adc5d66f9 Mon Sep 17 00:00:00 2001 From: John Forstmeier Date: Sun, 15 Feb 2026 23:59:26 -0500 Subject: [PATCH 3/3] Fix "pending" responses to pull request feedback --- .claude/commands/update-pull-request.md | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/.claude/commands/update-pull-request.md b/.claude/commands/update-pull-request.md index 6148703a..17b342d6 100644 --- a/.claude/commands/update-pull-request.md +++ b/.claude/commands/update-pull-request.md @@ -362,37 +362,32 @@ Follow these steps: - For each piece of feedback (both addressed and rejected), draft a response comment explaining what was done or why it was rejected, using the commenter name for personalization. - Post all response comments to their respective threads: - - For review comments (code-level), use GraphQL `addPullRequestReviewComment` mutation: + - For review comments (code-level), use GraphQL `addPullRequestReviewThreadReply` mutation to post comments directly to threads (NOT as pending review): ```bash - # Extract PR node ID from metadata - PR_ID=$(jq -r '.id' "${SCRATCHPAD}/metadata.json") - # IMPORTANT: Keep response text simple - avoid newlines, code blocks, and special characters # GraphQL string literals cannot contain raw newlines; use spaces or simple sentences # If complex formatting is needed, save response to a variable first and ensure proper escaping gh api graphql -f query=' - mutation($pullRequestId: ID!, $body: String!, $inReplyTo: ID!) { - addPullRequestReviewComment(input: { - pullRequestId: $pullRequestId, - body: $body, - inReplyTo: $inReplyTo + mutation($pullRequestReviewThreadId: ID!, $body: String!) { + addPullRequestReviewThreadReply(input: { + pullRequestReviewThreadId: $pullRequestReviewThreadId, + body: $body }) { comment { id } } } - ' -f pullRequestId="${PR_ID}" -f body="" -f inReplyTo="" + ' -f pullRequestReviewThreadId="" -f body="" ``` - Use the PR node ID from `metadata.json` for `pullRequestId`. - Use the comment node ID (format: `PRRC_*`) from `review_threads.json` for `inReplyTo` parameter. + Use the thread ID (format: `PRRT_*`) from `review_threads.json` for `pullRequestReviewThreadId` parameter. - Example to get comment node ID: + Example to get thread ID: ```bash - # Get first comment's node ID from a specific thread - COMMENT_ID=$(jq -r '.[] | select(.threadId == "PRRT_xxx") | .comments[0].id' "${SCRATCHPAD}/review_threads.json") + # Get thread ID from review_threads.json + THREAD_ID=$(jq -r '.[] | select(.comments[0].body | contains("some text")) | .threadId' "${SCRATCHPAD}/review_threads.json") ``` **Response formatting guidelines**: