core/skills/sw-review/SKILL.md
Fetches and displays PR review comments from GitHub, grouped by priority, and allows the user to reply to or resolve individual threads.
npx skillsauth add obsidian-owl/specwright sw-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Surface PR review comments, triage autonomously per Google severity framework
(protocols/decision.md), draft replies, and present for approval before
posting. When the associated Specwright work can be resolved safely, use
review-packet.md, approvals.md, and unit evidence as the primary reply
context instead of reasoning from the diff alone. Stateless with respect to
Specwright state — never modifies workflow.json.
Fetch all comment types, group by status, apply autonomous triage:
The PR itself is the review surface — reviewers see replies directly. When no associated work can be matched, say so explicitly and use a diff-only fallback.
{projectArtifactsRoot}/config.json — git.prTool and git.baseBranch settingsgit branch --show-currentgh pr list --head {branch}gh api REST and GraphQL endpoints{repoStateRoot}/work/*/workflow.json{workDir}/review-packet.md{workArtifactsRoot}/{workId}/approvals.md{workDir}/evidence/*.mdgh api POST to the appropriate endpointresolveReviewThread GraphQL mutationPR detection (MEDIUM freedom):
git branch --show-current. If the result
is empty or HEAD is detached, report the detached HEAD condition and stop.gh pr list --head {branch} --json number,title,url.
If no open PR is found, retry with --state merged as a fallback for merged PRs.config.git.prTool before invoking gh; if the value is not gh or is
unset, degrade to URL display. sw-review only supports the gh CLI.Comment fetching (MEDIUM freedom):
gh api:
GET /repos/{owner}/{repo}/issues/{n}/commentsGET /repos/{owner}/{repo}/pulls/{n}/commentsreviewThreads with isResolved field.
To correlate: match REST review comment id against GraphQL
reviewThreads.comments.nodes[].databaseId. If correlation fails, treat
as unresolved.--per-page 50. If exactly 50
results are returned, assume more may exist and display: "Showing first 50 —
view full thread at {url}." Pagination state is in Link response headers,
not in the JSON body.user.login), timestamp (created_at),
file path and line number (path, line) for review comments, and body text.Comment grouping and prioritization (MEDIUM freedom):
Associated work context (MEDIUM freedom):
workUnits[].prNumber, then the PR head branch
against workflow.json.branch. If more than one work matches, report the
ambiguity and fall back instead of picking one silently.review-packet.md,
approvals.md, and unit evidence before drafting replies or validating bot
comments.review-packet.md as the primary reviewer-response context. Use
approvals.md to verify approval lineage claims and evidence files to verify
gate-status claims. Do not default to diff-only reasoning when these audit
artifacts are available.Responding and resolving (MEDIUM freedom):
gh api with an HTTP POST:
gh api --method POST /repos/{owner}/{repo}/pulls/{n}/comments/{id}/replies./repos/{owner}/{repo}/issues/{n}/comments with a body field. Issue
comments have no threading — there is no in_reply_to_id for this endpoint.resolveReviewThread GraphQL mutation
via gh api graphql. The gh pr edit command is for PR metadata only — it
cannot post replies or resolve threads; always use gh api instead.Graceful degradation without gh (LOW freedom):
gh is not available or not installed, degrade gracefully: construct the
PR URL from the git remote URL (convert SSH or HTTPS remote to a browser
URL), display it, and inform the user: "Install gh CLI to fetch and respond
to comments from the terminal." Do not abort or STOP — present the URL as a
fallback so the user can open the PR in a browser.protocols/headless.md.Stateless utility (LOW freedom):
prTool is permitted. No writes to
{projectArtifactsRoot}, {workArtifactsRoot}, {repoStateRoot}, or
{worktreeStateRoot}.protocols/decision.md — autonomous decision framework (Google severity triage, external reply gate)protocols/git.md — PR operations, remote URL conventions, gh CLI patternsprotocols/evidence.md — gate evidence as canonical detailprotocols/approvals.md — approval lineage contractprotocols/review-packet.md — reviewer packet contract for reply contextprotocols/headless.md — non-interactive execution and result file formatprotocols/context.md — logical-root config loadinggit branch --show-current returns empty. Report "Cannot
detect branch: HEAD is detached. Check out a branch and try again." Do not proceed.gh pr list --head returns no results and the --state merged
fallback also returns nothing. Report "No pull request found for branch
{branch}" and exit without error.gh api returns HTTP 429, or HTTP 403 with
X-RateLimit-Remaining: 0. Surface the error message and the
X-RateLimit-Reset time. Ask the user to retry after the reset window.gh api returns HTTP 403 without rate-limit
headers. Report "Access denied. Run gh auth status to check token scopes
and repository access." Do not retry automatically.testing
Explicitly adopt an existing work into the current worktree after validating live ownership, stale sessions, and branch consistency.
testing
Orchestrates quality gates for the current work unit. Runs enabled gates in dependency order, produces an aggregate evidence report with gate handoff.
tools
Syncs the local repository by fetching all remotes, updating the base branch, and removing stale local branches that are not protected by live sessions or helper worktrees.
data-ai
Shows current Specwright state for this worktree, the attached work, repo-wide active works, gate results, and lock status. Supports --reset, --cleanup, and --repair {unitId}.