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..08cfc209d5 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' @@ -191,13 +187,12 @@ 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 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)"'