用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill implement-pr-suggestions命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
基于 SOC 职业分类
| name | implement-pr-suggestions |
| description | Implement approved PR review suggestions Use when this capability is needed. |
| metadata | {"author":"akallabet"} |
This skill fetches unresolved PR review conversations, filters to only those approved (👍) by the current user, groups them into dependency-aware buckets, and spawns parallel subagents to implement the changes.
Determine the PR number to work with:
/implement-pr-suggestions 123), use that as the PR number.gh pr view --json number -q '.number'
Also resolve the current GitHub username:
gh api user -q '.login'
Store both PR_NUMBER and GITHUB_USERNAME for subsequent steps.
Also resolve the skill directory — the absolute path provided in the "Base directory for this skill" context when this skill is loaded. Store it as SKILL_DIR. All script references below use this variable so the skill works regardless of where it is installed.
Use gh api graphql with the query file at {SKILL_DIR}/scripts/pr-review-query.graphql to fetch all review threads with full comment and reaction data.
To get OWNER and REPO, run:
gh repo view --json owner,name -q '.owner.login + " " + .name'
All temporary and output files are stored under auto-pr-reviews/ in the project root. Construct the branch-safe name by replacing / with - in the branch name (e.g. feature/ENG-5753 becomes feature-ENG-5753).
Then fetch the threads using the GraphQL file:
mkdir -p auto-pr-reviews
gh api graphql -F owner='{OWNER}' -F repo='{REPO}' -F pr={PR_NUMBER} -f query="$(cat {SKILL_DIR}/scripts/pr-review-query.graphql)" > auto-pr-reviews/{BRANCH_SAFE}-{PR_NUMBER}-raw-threads.json
Run the standalone TypeScript filter script. It discards resolved threads and keeps only those the current user has approved with a 👍 reaction, writing the result to a JSON file:
npx tsx {SKILL_DIR}/scripts/filter-approved-threads.ts \
auto-pr-reviews/{BRANCH_SAFE}-{PR_NUMBER}-raw-threads.json \
"$GITHUB_USERNAME" \
auto-pr-reviews/{BRANCH_SAFE}-{PR_NUMBER}-approved-threads.json
The script handles all filtering in one pass:
isResolved == trueTHUMBS_UP reaction from the specified GitHub userauto-pr-reviews/{BRANCH_SAFE}-{PR_NUMBER}-approved-threads.jsonRead the output file. If the result is an empty array [], inform the user that no approved suggestions were found and stop.
Analyze the filtered (approved) suggestions and group them into parallel buckets using dependency-aware logic.
Same-file rule: Suggestions targeting the same file MUST be in the same bucket (sequential application avoids merge conflicts).
Cross-file dependency rule: Suggestions that are logically coupled across files MUST also be in the same bucket. Examples:
Parallel buckets: Only suggestions with NO logical dependency on each other go into separate parallel buckets (e.g., two unrelated bug fixes in completely independent modules).
Write the plan JSON to:
auto-pr-reviews/{branch-name}-{pr-number}.json
Use the same branch-safe name from earlier steps (replacing / with -).
The JSON schema:
{
"version": "2.0",
"prNumber": 123,
"branch": "feature/my-branch",
"createdAt": "2026-02-10T10:30:00Z",
"githubUsername": "octocat",
"approvedThreads": [ ... ],
"buckets": [
{
"id": 1,
"rationale": "Route handler and its test file are logically coupled",
"files": ["pages/api/v3.0/users/index.ts", "__tests__/pages/api/v3.0/users/index.test.ts"],
"threads": [ ... ]
},
{
"id": 2
...
For each bucket, include a rationale string explaining WHY these suggestions were grouped together. This helps with auditability and debugging.
For each bucket in the plan, spin up a coder subagent (choose among the available ones) via the Task tool. All buckets run in parallel (launch them in a single message with multiple Task tool calls).
Each subagent receives:
You are implementing approved PR review suggestions for PR #{PR_NUMBER}.
## Your Bucket (Bucket {BUCKET_ID})
Rationale: {RATIONALE}
## Files to Modify
{LIST_OF_FILES}
## Suggestions to Implement
{For each thread in the bucket, include:}
- File: {path}
- Line: {line} (original: {originalLine}, side: {diffSide})
- Diff context:
{diffHunk from the first comment}
- Suggestion:
{comment body}
- Author: {author.login}
## Instructions
1. Read each file before modifying it.
2. Apply each suggestion carefully, using the diff hunk as context to locate the correct position.
3. If a suggestion contains a ```suggestion code block, apply that exact code change.
4. If a suggestion is descriptive (no code block), implement the described change using your best judgment.
5. After applying ALL suggestions in this bucket, run verification:
- `npm run lint` (fix any lint errors you introduced)
- `npm run typecheck` (fix any type errors you introduced)
6. Do NOT commit changes. Just apply and verify.
After ALL subagents complete, run a final verification pass across the entire codebase:
npm run lint
npm run typecheck
If there are errors, fix them. Then report to the user:
All helper scripts live in {SKILL_DIR}/scripts/:
scripts/pr-review-query.graphql — GraphQL query that fetches review threads with comments, reactions, and diff hunks from a PR. Used in Step 2.scripts/filter-approved-threads.ts — TypeScript CLI script that reads raw GraphQL output, discards resolved threads, keeps only those with a thumbs-up from the specified user, and writes the filtered result to a JSON file. Used in Step 3.EXAMPLE.json — Reference example of the plan JSON output schema produced in Step 4.Converted and distributed by TomeVault — claim your Tome and manage your conversions.