Skip to content
Merged
Show file tree
Hide file tree
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
32 changes: 11 additions & 21 deletions .claude/skills/doc-pr-fix/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: <number>` — the PR number (e.g. `913`)
- `PR: <number>` — the PR number (e.g. `921`)
- `Repo: <owner/name>` — the repository (e.g. `netwrix/docs`)
- `Progress comment ID: <id>` — ID of the "On it." comment already posted (may be empty)
- `Writer's request: <text>` — 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.
Expand Down Expand Up @@ -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/<owner>/<repo>/issues/comments/<progress-comment-id> \
-X PATCH -f body="<your answer here>"
```

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 <pr-number> --repo <owner>/<repo> --body "<your answer here>"
Expand All @@ -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/<owner>/<repo>/issues/comments/<progress-comment-id> \
-X PATCH -f body="$(cat <<'EOF'
gh api repos/<owner>/<repo>/issues/<pr-number>/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/<owner>/<repo>/issues/<pr-number>/comments \
--method POST --field body="**Fix in progress:** ..." --jq '.id'
gh api repos/<owner>/<repo>/issues/comments/<id-from-above> \
-X PATCH -f body="<updated checklist>"
```

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:
Expand Down Expand Up @@ -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/<owner>/<repo>/issues/comments/<progress-comment-id> \
gh api repos/<owner>/<repo>/issues/comments/<id-from-step-3> \
-X PATCH -f body="$(cat <<'EOF'
**Fix complete:**

Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/claude-doc-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)"'
Loading