AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.
dx(skills): improve pr-address skill — full thread context + PR description backtick fix (#12480)
Zamil Majdyf617f50f0b4b
diff --git a/.claude/skills/pr-address/SKILL.md b/.claude/skills/pr-address/SKILL.mdindex d672c1886b..67b9ef1b23 100644--- a/.claude/skills/pr-address/SKILL.md+++ b/.claude/skills/pr-address/SKILL.md@@ -19,16 +19,60 @@ gh pr view {N}## Fetch comments (all sources)+### 1. Inline review threads — GraphQL (primary source of actionable items)++Use GraphQL to fetch inline threads. It natively exposes `isResolved`, returns threads already grouped with all replies, and paginates via cursor — no manual thread reconstruction needed.++```bash+gh api graphql -f query='+{+ repository(owner: "Significant-Gravitas", name: "AutoGPT") {+ pullRequest(number: {N}) {+ reviewThreads(first: 100) {+ pageInfo { hasNextPage endCursor }+ nodes {+ id+ isResolved+ path+ comments(last: 1) {+ nodes { databaseId body author { login } createdAt }+ }+ }+ }+ }+ }+}'+```++If `pageInfo.hasNextPage` is true, fetch subsequent pages by adding `after: "<endCursor>"` to `reviewThreads(first: 100, after: "...")` and repeat until `hasNextPage` is false.++**Filter to unresolved threads only** — skip any thread where `isResolved: true`. `comments(last: 1)` returns the most recent comment in the thread — act on that; it reflects the reviewer's final ask. Use the thread `id` (Relay global ID) to track threads across polls.++### 2. Top-level reviews — REST (MUST paginate)++```bash+gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews --paginate+```++**CRITICAL — always `--paginate`.** Reviews default to 30 per page. PRs can have 80–170+ reviews (mostly empty resolution events). Without pagination you miss reviews past position 30 — including `autogpt-reviewer`'s structured review which is typically posted after several CI runs and sits well beyond the first page.++Two things to extract:+- **Overall state**: look for `CHANGES_REQUESTED` or `APPROVED` reviews.+- **Actionable feedback**: non-empty bodies only. Empty-body reviews are thread-resolution events — they indicate progress but have no feedback to act on.++**Where each reviewer posts:**+- `autogpt-reviewer` — posts detailed structured reviews ("Blockers", "Should Fix", "Nice to Have") as **top-level reviews**. Not present on every PR. Address ALL items.+- `sentry[bot]` — posts bug predictions as **inline threads**. Fix real bugs, explain false positives.+- `coderabbitai[bot]` — posts summaries as **top-level reviews** AND actionable items as **inline threads**. Address actionable items.+- Human reviewers — can post in any source. Address ALL non-empty feedback.++### 3. PR conversation comments — REST+```bash-gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews # top-level reviews-gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments # inline review comments-gh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments # PR conversation comments+gh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments --paginate```-**Bots to watch for:**-- `autogpt-reviewer` — posts "Blockers", "Should Fix", "Nice to Have". Address ALL of them.-- `sentry[bot]` — bug predictions. Fix real bugs, explain false positives.-- `coderabbitai[bot]` — automated review. Address actionable items.+Mostly contains: bot summaries (`coderabbitai[bot]`), CI/conflict detection (`github-actions[bot]`), and author status updates. Scan for non-empty messages from non-bot human reviewers that aren't the PR author — those are the ones that need a response.## For each unaddressed comment@@ -94,13 +138,23 @@ gh pr view {N} --repo Significant-Gravitas/AutoGPT --json mergeable --jq '.merge```If the result is `"CONFLICTING"`, the PR has a merge conflict — see "Resolving merge conflicts" below. If `"UNKNOWN"`, GitHub is still computing mergeability — wait and re-check next poll.-3. Check for new comments (all three sources):-```bash-gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments # inline review comments-gh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments # PR conversation comments-gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews # top-level reviews-```- Compare against previously seen comments to detect new ones.+3. Check for new/changed comments (all three sources):++ **Inline threads** — re-run the GraphQL query from "Fetch comments". For each unresolved thread, record `{thread_id, last_comment_databaseId}` as your baseline. On each poll, action is needed if:+ - A new thread `id` appears that wasn't in the baseline (new thread), OR+ - An existing thread's `last_comment_databaseId` has changed (new reply on existing thread)++ **Conversation comments:**+ ```bash+ gh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments --paginate+ ```+ Compare total count and newest `id` against baseline. Filter to non-empty, non-bot, non-author-update messages.++ **Top-level reviews:**+ ```bash+ gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews --paginate+ ```+ Watch for new non-empty reviews (`CHANGES_REQUESTED` or `COMMENTED` with body). Compare total count and newest `id` against baseline.4. **React in this precedence order (first match wins):**diff --git a/.claude/skills/pr-review/SKILL.md b/.claude/skills/pr-review/SKILL.mdindex 0d0d377f32..e0c5c1e1c2 100644--- a/.claude/skills/pr-review/SKILL.md+++ b/.claude/skills/pr-review/SKILL.md@@ -28,7 +28,7 @@ gh pr diff {N}Before posting anything, fetch existing inline comments to avoid duplicates:```bash-gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments+gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments --paginategh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews```diff --git a/autogpt_platform/CLAUDE.md b/autogpt_platform/CLAUDE.mdindex 7808e7ff25..5a14506f60 100644--- a/autogpt_platform/CLAUDE.md+++ b/autogpt_platform/CLAUDE.md@@ -56,6 +56,16 @@ AutoGPT Platform is a monorepo containing:- Ensure the branch name is descriptive (e.g., `feature/add-new-block`)- Use conventional commit messages (see below)- Fill out the .github/PULL_REQUEST_TEMPLATE.md template as the PR description+- Always use `--body-file` to pass PR body — avoids shell interpretation of backticks and special characters:+ ```bash+ PR_BODY=$(mktemp)+ cat > "$PR_BODY" << 'PREOF'+ ## Summary+ - use `backticks` freely here+ PREOF+ gh pr create --title "..." --body-file "$PR_BODY" --base dev+ rm "$PR_BODY"+ ```- Run the github pre-commit hooks to ensure code quality.### Reviewing/Revising Pull Requests@@ -63,8 +73,8 @@ AutoGPT Platform is a monorepo containing:Use `/pr-review` to review a PR or `/pr-address` to address comments.When fetching comments manually:-- `gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews` — top-level reviews-- `gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments` — inline review comments+- `gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/reviews --paginate` — top-level reviews+- `gh api repos/Significant-Gravitas/AutoGPT/pulls/{N}/comments --paginate` — inline review comments (always paginate to avoid missing comments beyond page 1)- `gh api repos/Significant-Gravitas/AutoGPT/issues/{N}/comments` — PR conversation comments### Conventional Commits