From 762ebc664ae8e0e8c3e93d1d83a51f74d6f7ff17 Mon Sep 17 00:00:00 2001 From: jth-nw Date: Thu, 14 May 2026 10:21:45 -0500 Subject: [PATCH 1/2] fix(doc-pr): replace ack comment with eyes emoji reaction MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ack comment added noise, especially for questions. Replace it with a 👀 reaction on the triggering comment (immediate, unobtrusive feedback) and have Claude post its own comments: a direct answer for questions, or a progress checklist for file-edit tasks. Generated with AI Co-Authored-By: Claude Code --- .claude/skills/doc-pr-fix/SKILL.md | 32 ++++++++++------------------- .github/workflows/claude-doc-pr.yml | 11 +++------- 2 files changed, 14 insertions(+), 29 deletions(-) diff --git a/.claude/skills/doc-pr-fix/SKILL.md b/.claude/skills/doc-pr-fix/SKILL.md index 0f5c98015e..dd08f7443c 100644 --- a/.claude/skills/doc-pr-fix/SKILL.md +++ b/.claude/skills/doc-pr-fix/SKILL.md @@ -13,9 +13,8 @@ Read `docs/CLAUDE.md` before starting. It contains the Netwrix writing standards ## Input The prompt contains labeled fields — extract these values and use them as literals throughout: -- `PR: ` — the PR number (e.g. `913`) +- `PR: ` — the PR number (e.g. `921`) - `Repo: ` — the repository (e.g. `netwrix/docs`) -- `Progress comment ID: ` — ID of the "On it." comment already posted (may be empty) - `Writer's request: ` — everything the writer wrote after `@claude` Do not use shell variable expansion (`$VAR`) in any commands — use the literal values you extracted from the prompt. @@ -44,14 +43,7 @@ Parse the writer's comment to determine what they want. Common patterns: ### If the request is a question or asks for an explanation -Answer it directly. Do not create a todo list or edit any files. Update the "On it." comment with your answer: - -```bash -gh api repos///issues/comments/ \ - -X PATCH -f body="" -``` - -If the progress comment ID is empty, post a new comment instead: +Answer it directly. Do not create a todo list or edit any files. Post a comment with your answer: ```bash gh pr comment --repo / --body "" @@ -70,29 +62,27 @@ Example tasks for a "fix all issues" request: Only include tasks for what the writer actually asked for. -Update the "On it." comment with your task list (use literal values from the prompt — no shell variables): +Post a progress comment and capture its ID from the command output — you'll update this comment as work proceeds: ```bash -gh api repos///issues/comments/ \ - -X PATCH -f body="$(cat <<'EOF' +gh api repos///issues//comments \ + --method POST --field body="$(cat <<'EOF' **Fix in progress:** - [ ] Apply editorial suggestions in `path/to/file.md` - [ ] Verify changes - [ ] Commit and push EOF -)" +)" --jq '.id' ``` -If the progress comment ID is empty, create a new comment and note its ID for the final update: +Use the literal ID from that output in subsequent update calls. Update the comment at natural milestones (after finishing each file, after committing) — not after every edit: ```bash -gh api repos///issues//comments \ - --method POST --field body="**Fix in progress:** ..." --jq '.id' +gh api repos///issues/comments/ \ + -X PATCH -f body="" ``` -Update the comment at natural milestones (after finishing each file, after committing) — not after every edit. - ## Step 4: Apply fixes Work through the requested fixes methodically: @@ -126,10 +116,10 @@ git push ## Step 7: Final update -Replace the progress comment with a completion summary. Don't post a separate comment — update the same one: +Replace the progress comment with a completion summary. Don't post a separate comment — update the same one using the ID you captured in Step 3: ```bash -gh api repos///issues/comments/ \ +gh api repos///issues/comments/ \ -X PATCH -f body="$(cat <<'EOF' **Fix complete:** diff --git a/.github/workflows/claude-doc-pr.yml b/.github/workflows/claude-doc-pr.yml index bf04b577c7..3fec12c5f8 100644 --- a/.github/workflows/claude-doc-pr.yml +++ b/.github/workflows/claude-doc-pr.yml @@ -164,17 +164,13 @@ jobs: gh pr comment ${{ steps.pr-info.outputs.number }} --repo ${{ github.repository }} \ --body "This PR is from a fork. Automated fixes cannot be pushed directly. I can still review and suggest changes — apply them manually from the comments." - - name: Post acknowledgment comment - id: ack-comment + - name: React with eyes if: steps.pr-info.outputs.is_fork == 'false' && steps.pr-info.outputs.targets_dev == 'true' env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - COMMENT_ID=$(gh api "repos/${{ github.repository }}/issues/${{ steps.pr-info.outputs.number }}/comments" \ - --method POST \ - --field body="**On it.** I'll reply here shortly." \ - --jq '.id') - echo "comment_id=$COMMENT_ID" >> "$GITHUB_OUTPUT" + gh api repos/${{ github.repository }}/issues/comments/${{ github.event.comment.id }}/reactions \ + --method POST -f content="eyes" - name: Checkout repository if: steps.pr-info.outputs.is_fork == 'false' && steps.pr-info.outputs.targets_dev == 'true' @@ -197,7 +193,6 @@ jobs: /doc-pr-fix PR: ${{ steps.pr-info.outputs.number }} Repo: ${{ github.repository }} - Progress comment ID: ${{ steps.ack-comment.outputs.comment_id }} Writer's request: ${{ github.event.comment.body }} claude_args: '--max-turns 50 --allowedTools "Bash(gh:*),Bash(git:*),Read,Write,Edit,Glob,Grep,Skill(doc-pr-fix),Skill(doc-help)"' From 58a67b45698e17e5def5355714457dcc13e6b950 Mon Sep 17 00:00:00 2001 From: jth-nw Date: Thu, 14 May 2026 10:26:14 -0500 Subject: [PATCH 2/2] fix(doc-pr): use GITHUB_TOKEN for claude-code-action so comments can be posted MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit VALE_TOKEN only has contents:write scope and cannot post or edit PR comments (403). The action overrides GH_TOKEN with whatever github_token is set to, so all gh CLI calls inherited the wrong token. Switching to GITHUB_TOKEN fixes comment posting. Git pushes still use VALE_TOKEN because actions/checkout already configured the git credential helper with it — the two tokens are independent. Generated with AI Co-Authored-By: Claude Code --- .github/workflows/claude-doc-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/claude-doc-pr.yml b/.github/workflows/claude-doc-pr.yml index 3fec12c5f8..08cfc209d5 100644 --- a/.github/workflows/claude-doc-pr.yml +++ b/.github/workflows/claude-doc-pr.yml @@ -187,7 +187,7 @@ jobs: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} - github_token: ${{ secrets.VALE_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} show_full_output: true prompt: | /doc-pr-fix