From a1cb71174f5018655a098768a1a2c0be963b5d74 Mon Sep 17 00:00:00 2001 From: Zhongwei Li Date: Sat, 29 Nov 2025 18:19:57 +0800 Subject: [PATCH] Initial commit --- .claude-plugin/plugin.json | 11 ++++++++ README.md | 3 +++ commands/pr-create.md | 52 ++++++++++++++++++++++++++++++++++++++ plugin.lock.json | 45 +++++++++++++++++++++++++++++++++ 4 files changed, 111 insertions(+) create mode 100644 .claude-plugin/plugin.json create mode 100644 README.md create mode 100644 commands/pr-create.md create mode 100644 plugin.lock.json diff --git a/.claude-plugin/plugin.json b/.claude-plugin/plugin.json new file mode 100644 index 0000000..04fe485 --- /dev/null +++ b/.claude-plugin/plugin.json @@ -0,0 +1,11 @@ +{ + "name": "pr-create-plugin", + "description": "Create GitHub pull requests with auto-generated title and description based on branch changes", + "version": "1.0.0", + "author": { + "name": "Stefan Cho" + }, + "commands": [ + "./commands" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ff2509 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# pr-create-plugin + +Create GitHub pull requests with auto-generated title and description based on branch changes diff --git a/commands/pr-create.md b/commands/pr-create.md new file mode 100644 index 0000000..7571e07 --- /dev/null +++ b/commands/pr-create.md @@ -0,0 +1,52 @@ +--- +description: Create PR with auto-generated title and description +allowed-tools: Bash(git status:*), Bash(git log:*), Bash(git diff:*), Bash(git push:*), Bash(gh pr create:*) +--- + +Create a pull request by following these steps: + +1. Run these commands in parallel to understand the current state: + - `git status` - Check branch status and tracking + - `git log origin/main..HEAD --oneline` - See commits that will be in the PR + - `git diff origin/main...HEAD` - See all changes compared to origin's main branch + +2. Analyze all changes and commits to draft: + - PR title: Concise summary following the repo's commit message style + - PR body with this format: + ``` + ## Summary + - [Bullet point 1] + - [Bullet point 2] + - [Bullet point 3] + + ## Test plan + - [ ] [Test step 1] + - [ ] [Test step 2] + + 🤖 Generated with [Claude Code](https://claude.com/claude-code) + ``` + +3. Push current branch to origin with `-u` flag if needed + +4. Create PR using: + ```bash + gh pr create --title "PR title here" --body "$(cat <<'EOF' + ## Summary + - Point 1 + - Point 2 + + ## Test plan + - [ ] Step 1 + + 🤖 Generated with [Claude Code](https://claude.com/claude-code) + EOF + )" + ``` + +5. Return the PR URL when done + +IMPORTANT: +- Compare with origin/main (not local main) +- Review ALL commits from branch point, not just latest commit +- Keep title concise and descriptive +- Make summary bullets focus on "why" not just "what" diff --git a/plugin.lock.json b/plugin.lock.json new file mode 100644 index 0000000..4ff47c0 --- /dev/null +++ b/plugin.lock.json @@ -0,0 +1,45 @@ +{ + "$schema": "internal://schemas/plugin.lock.v1.json", + "pluginId": "gh:devstefancho/claude-plugins:pr-create-plugin", + "normalized": { + "repo": null, + "ref": "refs/tags/v20251128.0", + "commit": "9e972d2f1a75455b8fc43f1b1c578d8be358152d", + "treeHash": "5106bb57dcf0fc1af391775dbb1d83850bd0fadeca32181f8c1e104c6808a7de", + "generatedAt": "2025-11-28T10:16:21.902710Z", + "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-create-plugin", + "description": "Create GitHub pull requests with auto-generated title and description based on branch changes", + "version": "1.0.0" + }, + "content": { + "files": [ + { + "path": "README.md", + "sha256": "667ab6e57c79e722851dbde271681510e8d352926784cf6e880afe110782f05d" + }, + { + "path": ".claude-plugin/plugin.json", + "sha256": "25b4ed770a7efb4280a153d764180614a22382a819c013e6b352dd1b457c0e60" + }, + { + "path": "commands/pr-create.md", + "sha256": "84806fc4f8ac13dd94b380fae99330a2fbe96ece6e483c03e2411b14ddffd6e0" + } + ], + "dirSha256": "5106bb57dcf0fc1af391775dbb1d83850bd0fadeca32181f8c1e104c6808a7de" + }, + "security": { + "scannedAt": null, + "scannerVersion": null, + "flags": [] + } +} \ No newline at end of file