commit af797514114cdf1163a567b4e397296d2d6cbd12 Author: Zhongwei Li Date: Sat Nov 29 18:13:47 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..0c3dbcb --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,12 @@ +{ + "name": "pr-resolver", + "description": "this is to analyze the PRs and solve the requested changes in them\n", + "version": "1.0.0", + "author": { + "name": "ClaudeForge Community", + "url": "https://github.com/claudeforge/marketplace" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..fc69fda --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pr-resolver + +this is to analyze the PRs and solve the requested changes in them diff --git a/commands/pr-issue-resolve.md b/commands/pr-issue-resolve.md new file mode 100644 index 0000000..5a9632e --- /dev/null +++ b/commands/pr-issue-resolve.md @@ -0,0 +1,172 @@ +--- +description: this is to analyze the PRs and solve the requested changes in them + +author: ClaudeForge Community +version: 1.0.0 +--- + +# Analyze and Resolve Suggested Changes in GitHub Pull Request + +Follow these steps to analyze suggested changes (e.g., review comments, inline suggestions, or requested modifications) in a GitHub Pull Request (PR) and resolve them efficiently. The goal is to review, understand, plan fixes, apply changes, test, and update the PR while maintaining code quality and collaboration. + +Assume the PR reference is provided as `$ARGUMENTS` (e.g., a PR number or URL like `#456` or `https://github.com/repo/pull/456`). + +Use the GitHub CLI (`gh`) for all GitHub-related tasks, such as fetching PR details, comments, and updating the PR. + +# PLAN +1. Use `gh pr view` to get the PR details + - Fetch the full PR title, description, base branch, head branch, labels, assignees, reviewers, and any linked issues. + - Note the current status (e.g., open, draft, merged) and any merge conflicts. + +2. Fetch and review all comments and suggestions + - Use `gh pr comment list` or `gh api` to retrieve all review comments, including inline suggestions (e.g., code diffs suggested in reviews). + - Categorize comments: + - **Suggestions for code changes** (e.g., "Change this function to use async/await"). + - **Questions or clarifications** (e.g., "Why did you choose this approach?"). + - **Bugs or issues** (e.g., "This breaks on edge case X"). + - **Style/nitpicks** (e.g., "Rename variable for clarity"). + - **Approvals or general feedback**. + - Identify threaded discussions or resolved/unresolved comments. + +3. Identify related dependencies or context + - Look for linked issues or other PRs (e.g., "fixes #123" or "depends on #789"). + - Check if the PR is part of a larger epic, feature branch, or release. + - Review the diff: Use `gh pr diff` to understand the changes introduced in the PR. + - If suggestions reference external resources (e.g., docs, standards), verify them. + +4. Ask clarification questions if needed + - If a suggestion is ambiguous, prepare questions for the reviewer (e.g., post them as replies in the PR). + - Examples: "Can you provide an example of the expected output?" or "Does this need to handle internationalization?" + +5. Understand prior art and codebase impact + - Search the codebase for affected files/modules (e.g., use `git grep` or IDE search). + - Review commit history in the PR branch for context. + - Check for similar past PRs or issues resolved in the repo. + +6. Ultrathink about resolving suggestions in a small and manageable way + - Break down each suggestion into actionable fixes. + - Prioritize: Address blockers first (e.g., bugs > features > style). + - Sequence fixes logically (e.g., refactor code before adding tests). + - Consider edge cases, performance, security, and compatibility. + - Draft a plan that minimizes new changes and avoids introducing regressions. + +7. Document the plan in the scratchpad + - Include the PR title and link. + - List suggestions with proposed resolutions. + - Ensure the plan is structured for easy execution by humans or automation. + +--- + +# Scratchpad for PR Resolution Planning + +## Pull Request Details +- **Title:** +- **Link:** +- **Description:** +- **Base Branch:** +- **Head Branch:** +- **Linked Issues:** + +--- + +## Suggested Changes / Comments +- Document each comment or suggestion here, grouped by file or category. +- Include commenter, comment text, and inline diff if applicable. + +- **Suggestion 1:** + - **Commenter:** + - **Text:** + - **Location:** + - **Type:** + +- **Suggestion 2:** + - **Commenter:** + - **Text:** + - **Location:** + - **Type:** + +- [ ] + +--- + +## Clarification Questions +- +- + +--- + +## Prior Art and Impact +- **Related PRs/Issues:** +- **Codebase References:** +- **Potential Risks:** + +--- + +## Proposed Resolution Plan +1. +2. +3. +4. + +--- + +## Todos +- [ ] +- [ ] +- [ ] + +--- + +## Notes +- + +--- + +# RESOLVE +- Checkout the PR branch: Use `gh pr checkout ` +- Apply fixes in small, incremental commits + - For each suggestion: + - Edit code as planned. + - Use suggested diffs if provided (e.g., apply inline suggestions via GitHub UI or manually). + - Create clear commit messages: + - Example: `refactor(auth): update token handling per review suggestion (resolves comment in #456)` +- If needed, create follow-up issues for out-of-scope suggestions +- Reply to comments: Use `gh pr comment` to respond, e.g., "Addressed in commit XYZ" and mark as resolved + +--- + +# TEST +- Run all relevant tests to verify resolutions + - Unit tests, integration tests, end-to-end tests +- Ensure code passes: + - ✅ Linting (e.g., ESLint for React Native) + - ✅ Type checking (e.g., TypeScript) + - ✅ Build checks (e.g., `yarn build` or `npm run build`) +- For React Native specifics: + - Test on simulators/emulators (iOS/Android) + - Check for platform-specific issues (e.g., native modules) +- Add new tests if suggestions involve bugs or new behavior +- Manual testing: Document steps if automated tests are insufficient + +--- + +# PUSH +- Push updated commits to the PR head branch +- Update the PR description if major changes were made + - Summarize resolutions: "Addressed review comments: fixed bug in auth, refactored UI per suggestions" + - Reference resolved comments or linked issues +- Re-request reviews if needed: Use `gh pr review --request ` +- Ensure PR follows guidelines: + - ✅ Updated labels (e.g., add "needs-review") + - ✅ No merge conflicts (resolve if any) + +--- + +## ✅ Final Checklist Before Re-Review or Merge +- [ ] All suggestions analyzed and resolved +- [ ] Replies posted to comments +- [ ] Tests passing on all platforms +- [ ] Linting and builds clean +- [ ] Commit messages descriptive +- [ ] PR updated with resolution summary +- [ ] No new issues introduced \ No newline at end of file diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..f508ffc --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:claudeforge/marketplace:plugins/commands/pr-resolver", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "c77ced24e3f80182621b93fa30aa7818e418ed2c", + "treeHash": "996bce7029edb847142d3fd69711c721ea4ffb4a82f89217c95e89756d4ebff5", + "generatedAt": "2025-11-28T10:15:35.207439Z", + "toolVersion": "publish_plugins.py@0.2.0" + }, + "origin": { + "remote": "git@github.com:zhongweili/42plugin-data.git", + "branch": "master", + "commit": "aa1497ed0949fd50e99e70d6324a29c5b34f9390", + "repoRoot": "/Users/zhongweili/projects/openmind/42plugin-data" + }, + "manifest": { + "name": "pr-resolver", + "description": "this is to analyze the PRs and solve the requested changes in them\n", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "a3ebd9c4daf9553ca6fd83f91386bd61f48acd7cc81fac31ca51cd24c51613d6" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "9c26840b0285ac56f9553d4436c8fa1efe6a15bf8bc72b9432f716e5fac90b5d" + }, + { + "path": "commands/pr-issue-resolve.md", + "sha256": "2114b957bf091e283be0a20821fe66985f4fb88e8e2a3282e35d2d994ab87f95" + } + ], + "dirSha256": "996bce7029edb847142d3fd69711c721ea4ffb4a82f89217c95e89756d4ebff5" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file