commit 38f3390d768e5f66d5948c4be06e83dcd5f002e1 Author: Zhongwei Li Date: Sat Nov 29 18:06:52 2025 +0800 Initial commit diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..c877ddd --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "pr-issue-resolve", + "description": "this is to analyze the PRs and solve the requested changes in them\n", + "version": "1.0.0", + "author": { + "name": "safayavatsal" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..80d8c3d --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pr-issue-resolve + +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..4641a45 --- /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: safayavatsal +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..340182f --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:ccplugins/awesome-claude-code-plugins:plugins/pr-issue-resolve", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "68003b85eba2a26bf977d1751f5b0b617e602f13", + "treeHash": "6f8cfcecf02f9691081e948a3a4a012e3aadff7e98d2b5e60fc2dbcd416ffdc7", + "generatedAt": "2025-11-28T10:14:38.400985Z", + "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-issue-resolve", + "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": "54771c3da856d2afef781ef5abf26c189f18a9dcce4f3904364f6b1ca1213116" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "f23321598b46b02b11d73a75cb23ffdcd21430541ef8dd18dec88e993f40d80e" + }, + { + "path": "commands/pr-issue-resolve.md", + "sha256": "abcf55d4b4e9391f26b830c6aa244037521f34031b26be28e5b0a6cdac03bf5a" + } + ], + "dirSha256": "6f8cfcecf02f9691081e948a3a4a012e3aadff7e98d2b5e60fc2dbcd416ffdc7" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file