Skip to content

Commit 0c1d89c

Browse files
olaservoclaude
andcommitted
docs(skill): expand pull-requests SKILL.md beyond inline instructions
The bundled skill now reads differently from the inline server instructions rather than mirroring them, showing the point of progressive disclosure: a skill-aware host spends no extra context on every request but can pull the deeper version on demand. Restructure into "When to use", "Workflow" (numbered steps), and "Caveats" sections per the agentskills.io spec's recommended body shape. Add content that is *not* in the inline instructions: - when to skip this flow (single top-level comment / approve without inline feedback) - the pending-ness hinges on omitting `event` in step 1 - specific line-ref parameter names (path, line, side, startLine, startSide) - the concrete `APPROVE | REQUEST_CHANGES | COMMENT` event values - pending reviews are invisible to the PR author and can be deleted via `method: "delete_pending"` Update the embedded-content test to check for the new `## Workflow` section header and a second tool-name presence assertion. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 890ea55 commit 0c1d89c

File tree

2 files changed

+22
-3
lines changed

2 files changed

+22
-3
lines changed

pkg/github/bundled_skills_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,9 @@ func Test_PullRequestsSkill_EmbeddedContent(t *testing.T) {
4444
assert.Equal(t, "pull-requests", frontmatterName, "frontmatter name must match final skill-path segment in %s", pullRequestsSkillURI)
4545

4646
body := md[4+end+5:]
47-
assert.Contains(t, body, "## PR review workflow")
47+
assert.Contains(t, body, "## Workflow", "skill body must carry the workflow section")
4848
assert.Contains(t, body, "pull_request_review_write", "review workflow content must be preserved")
49+
assert.Contains(t, body, "add_comment_to_pending_review", "review workflow content must be preserved")
4950
assert.Contains(t, body, "submit_pending", "the distinctive tool method must be present")
5051
}
5152

skills/pull-requests/SKILL.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,24 @@ name: pull-requests
33
description: Submit a multi-comment GitHub pull request review using the pending-review workflow (pull_request_review_write → add_comment_to_pending_review → submit_pending). Use when leaving line-specific feedback on a pull request, when asked to review a PR, or whenever creating any review with more than one comment.
44
---
55

6-
## PR review workflow
6+
## When to use
77

8-
PR review workflow: Always use 'pull_request_review_write' with method 'create' to create a pending review, then 'add_comment_to_pending_review' to add comments, and finally 'pull_request_review_write' with method 'submit_pending' to submit the review for complex reviews with line-specific comments.
8+
Use this skill when submitting a pull request review that will include more than one comment, especially line-specific comments placed on particular files or diff lines.
9+
10+
**Skip this flow** — call `pull_request_review_write` with `method: "create"` and supply `body` and `event` directly — when:
11+
12+
- Leaving a single top-level comment with no line references.
13+
- Approving or requesting changes without inline feedback.
14+
15+
## Workflow
16+
17+
Submit a multi-comment review using the three-step pending-review flow:
18+
19+
1. **Open a pending review.** Call `pull_request_review_write` with `method: "create"` **and no `event`**. Omitting `event` is what makes the review pending instead of submitting it immediately.
20+
2. **Add each comment.** Call `add_comment_to_pending_review` once per comment, supplying `path` and a line reference (`line`/`side` for a single line, or `startLine`/`startSide` plus `line`/`side` for a multi-line range). This tool requires that a pending review already exists for the current user on this PR.
21+
3. **Submit the review.** Call `pull_request_review_write` with `method: "submit_pending"`, an optional summary `body`, and an `event` indicating the review state — one of `APPROVE`, `REQUEST_CHANGES`, or `COMMENT`.
22+
23+
## Caveats
24+
25+
- **Always complete step 3.** A pending review is invisible to the PR author until `submit_pending` is called. If you stop partway through, the draft stays on the reviewer's side and can be resumed later or removed with `method: "delete_pending"`.
26+
- **Do not pass `event` in step 1.** Providing `event` to `create` submits the review immediately and leaves no pending review for `add_comment_to_pending_review` to attach to.

0 commit comments

Comments
 (0)