Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions .github/prompts/shared/03-comment-hygiene.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,32 @@
feedback.** Skipping cleanup leaves stale comments and dismissed reviews with
outdated text visible on the PR timeline.

### 0a. List everything you previously posted
### 0a. List all existing feedback

Run all three:
First, get your own bot identity:

```sh
gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq '.[] | select(.user.login == "claude[bot]") | {id, state, body}'
gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq '.[] | select(.user.login == "claude[bot]") | {id, path, body}'
gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq '.[] | select(.user.login == "claude[bot]") | {id, body}'
BOT_LOGIN=$(gh api graphql -f query='{ viewer { login } }' --jq '.data.viewer.login')
```

Also list reviews and comments from other authors so you understand context —
but never modify items you did not author.
List **all** reviews and comments to understand context and avoid duplicating
feedback from others:

```sh
gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq '.[] | {user: .user.login, state, body}'
gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq '.[] | {user: .user.login, path, body}'
gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq '.[] | {user: .user.login, body}'
```

Identify your own previous activity (these are the only items you can modify):

```sh
gh api repos/${REPO}/pulls/${PR_NUMBER}/reviews --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, state, body}"
gh api repos/${REPO}/pulls/${PR_NUMBER}/comments --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, path, body}"
gh api repos/${REPO}/issues/${PR_NUMBER}/comments --jq ".[] | select(.user.login == \"$BOT_LOGIN\") | {id, body}"
```

Do not modify items you did not author.

### 0b. Clean up stale reviews

Expand Down