generated from bitwarden/template
-
Notifications
You must be signed in to change notification settings - Fork 0
PM-30632: Add git-workflow plugin for streamlined PR creation #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Hinton
wants to merge
2
commits into
main
Choose a base branch
from
feature/add-git-workflow-plugin
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| { | ||
| "name": "git-workflow", | ||
| "version": "1.0.0", | ||
| "description": "Streamlined git workflow: commit, push, and create/update PR with auto-generated messages following Bitwarden PR template", | ||
| "author": { | ||
| "name": "Bitwarden", | ||
| "url": "https://github.com/bitwarden" | ||
| }, | ||
| "homepage": "https://github.com/bitwarden/ai-plugins/tree/main/plugins/git-workflow", | ||
| "repository": "https://github.com/bitwarden/ai-plugins", | ||
| "keywords": [ | ||
| "git", | ||
| "workflow", | ||
| "commit", | ||
| "push", | ||
| "pull-request", | ||
| "automation", | ||
| "pr-template" | ||
| ], | ||
| "commands": ["./commands/commit-push-pr.md"] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # Changelog | ||
|
|
||
| All notable changes to the Git Workflow Plugin will be documented in this file. | ||
|
|
||
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [1.0.0] - 2026-01-09 | ||
|
|
||
| ### Added | ||
| - Initial release with `/commit-push-pr` command | ||
| - Auto-commit, push, and PR creation workflow | ||
| - Integration with Bitwarden PR template | ||
| - Jira ticket tracking with auto-extracted PR titles |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| # Git Workflow Plugin | ||
|
|
||
| A Claude Code plugin that streamlines the git workflow by automating commit, push, and PR creation in a single command. | ||
|
|
||
| ## Overview | ||
|
|
||
| The Git Workflow plugin automates the complete git workflow: it creates a commit with an auto-generated message, pushes to remote, and creates a pull request following your repository's PR template. | ||
|
|
||
| ## Features | ||
|
|
||
| - **Single-command workflow** - Commit, push, and create PR in one step | ||
| - **Auto-generated commit messages** - Analyzes changes to create semantic commit messages | ||
| - **PR template integration** - Follows `.github/PULL_REQUEST_TEMPLATE.md` structure | ||
| - **Jira integration** - Extracts ticket ID from URL for PR title | ||
| - **Automatic branch creation** - Creates feature branch if on main | ||
|
|
||
| ## Installation | ||
|
|
||
| Add the Bitwarden AI Plugin Marketplace to Claude Code: | ||
|
|
||
| ```bash | ||
| /plugin marketplace add bitwarden/ai-plugins | ||
| ``` | ||
|
|
||
| Install the git-workflow plugin: | ||
|
|
||
| ```bash | ||
| /plugin install git-workflow@bitwarden-marketplace | ||
| ``` | ||
|
|
||
| Restart Claude Code for the plugin to become active. | ||
|
|
||
| ## Usage | ||
|
|
||
| Simply run the command from within your git repository: | ||
|
|
||
| ``` | ||
| /commit-push-pr | ||
| ``` | ||
|
|
||
| The command will: | ||
| 1. Create a new branch if you're on main | ||
| 2. Commit your changes with an auto-generated message | ||
| 3. Push the branch to origin | ||
| 4. Ask for your Jira ticket URL | ||
| 5. Create a PR with the Jira ID as the title and auto-generated body | ||
|
|
||
| ### Example | ||
|
|
||
| ```bash | ||
| # Make some changes to your code | ||
| /commit-push-pr | ||
| ``` | ||
|
|
||
| When prompted, provide your Jira URL: | ||
| ``` | ||
| https://bitwarden.atlassian.net/browse/PM-123 | ||
| ``` | ||
|
|
||
| The PR will be created with: | ||
| - **Title**: `PM-123` Short descriptive title | ||
| - **Body**: Following the Bitwarden PR template with tracking link and objective | ||
|
|
||
| ## Requirements | ||
|
|
||
| - **Git** - Installed and configured | ||
| - **GitHub CLI (`gh`)** - Installed and authenticated (`gh auth login`) | ||
| - **Repository setup** - Inside a git repository with a remote configured | ||
| - **Changes to commit** - Modified tracked files | ||
|
|
||
| ## Version History | ||
|
|
||
| See [CHANGELOG.md](CHANGELOG.md) for version history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| --- | ||
| allowed-tools: Read, Bash(git checkout -b:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*) | ||
| description: Commit, push, and open a PR | ||
| --- | ||
|
|
||
| ## Context | ||
|
|
||
| - Current git status: !`git status` | ||
| - Current git diff (staged and unstaged changes): !`git diff HEAD` | ||
| - Current branch: !`git branch --show-current` | ||
|
|
||
| ## Your task | ||
|
|
||
| Based on the above changes: | ||
|
|
||
| 1. Create a new branch if on main | ||
| 2. Create a single commit with an appropriate message | ||
| 3. Push the branch to origin | ||
| 4. Read the PR template at `.github/PULL_REQUEST_TEMPLATE.md` | ||
| 5. Create a pull request using `gh pr create` with: | ||
| - Title: Ask the user for the Jira ticket URL (from bitwarden.atlassian.net) and extract the ID (e.g., "PM-1" or "CL-1000"). Then use that ID to form the title in the format "[JIRA-ID] Short descriptive title" | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐จ Anything more we can do here by picking up context? Perhaps that's a stretch but it could get Git metadata. |
||
| - Body: Following the template structure with the tracking link in the ๐๏ธ Tracking section and auto-generated objective in the ๐ Objective section | ||
| 6. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
๐ญ "Naming things is hard" but Claude's version of this calls the plugin "commit commands". I would like to future-proof this so that it can collect the commands an engineer might need here, and that might mean waiting for #15.