From 3ef970daecc5f264bf06906fd527227de59d3aae Mon Sep 17 00:00:00 2001 From: jdalton Date: Tue, 5 May 2026 16:29:06 -0700 Subject: [PATCH 1/2] chore(skills): sync cursor-bugbot from canonical Synced from socket-repo-template canonical (855d634). --- .claude/skills/cursor-bugbot/SKILL.md | 157 ++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 .claude/skills/cursor-bugbot/SKILL.md diff --git a/.claude/skills/cursor-bugbot/SKILL.md b/.claude/skills/cursor-bugbot/SKILL.md new file mode 100644 index 00000000..dbc1f894 --- /dev/null +++ b/.claude/skills/cursor-bugbot/SKILL.md @@ -0,0 +1,157 @@ +--- +name: cursor-bugbot +description: Drive the Cursor Bugbot review-and-fix loop on a PR. Inventories open Bugbot threads, classifies each (real bug / false positive / already fixed), fixes the real ones, replies on the inline thread (never as a detached PR comment), updates the PR title/body if scope shifted, and pushes. Use when reviewing a PR you just authored, after `gh pr create`, or after a new Bugbot pass on an existing PR. +user-invocable: true +allowed-tools: Read, Edit, Write, Grep, Glob, AskUserQuestion, Bash(gh:*), Bash(git:*), Bash(pnpm run:*), Bash(rg:*), Bash(grep:*) +--- + +# cursor-bugbot + +Drive the Cursor Bugbot fix-and-respond loop end-to-end. This is the canonical flow every PR author should run after Bugbot posts findings. + +## Modes + +- `/cursor-bugbot ` — full audit-and-fix on one PR (default). +- `/cursor-bugbot check ` — list Bugbot findings, classify them, but don't fix or reply. +- `/cursor-bugbot reply ` — single-comment reply where `` is `fixed`, `false-positive`, or `wont-fix`. +- `/cursor-bugbot scope ` — re-evaluate the PR title and body against the actual commits and rewrite them when out of step. + +## Why a skill + +Cursor Bugbot's review surface is easy to mis-handle: + +- **Replies must thread on the inline review-comment**, not as a detached PR comment. A detached `gh pr comment` doesn't mark the thread resolved and the bot doesn't see it as a response. The right call is `gh api repos/{owner}/{repo}/pulls/{pr}/comments/{comment_id}/replies -X POST -f body=…`. +- **Findings stale after fixes land.** Bugbot reviews a specific commit SHA. When you push a fix, the comment still references the old commit; the thread stays open until you reply marking it resolved. +- **Stale findings vs. live bugs vs. false positives** all read the same on the API surface. Triaging needs a process, not vibes. +- **Scope creep on PRs**. CLAUDE.md mandates "When adding commits to an OPEN PR, update the PR title and description to match the new scope." Easy to forget when you're heads-down fixing Bugbot findings. + +This skill makes all of the above mechanical. + +## Process + +### Phase 1 — Inventory + +```bash +gh api "repos/{owner}/{repo}/pulls//comments" \ + --jq '.[] | select(.user.login | test("cursor|bugbot"; "i")) | {id, path, line, body: (.body | split("\n")[0])}' +``` + +Lists Bugbot findings as one-liners. Each finding has: + +- `id` — comment ID (used for replies and resolution) +- `path` — file the finding is on +- `line` — line number on that file +- `body` — first line is the title (`### Title`) +- `body` (full) — `Description` block, severity (Low/Medium/High), and rule (when triggered by a learned rule) + +For each finding, fetch the full body to read the description: + +```bash +gh api "repos/{owner}/{repo}/pulls/comments/" \ + --jq '{path, line, body: (.body | split("