diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 0250682..1eb2a98 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -27,6 +27,12 @@ "source": "./plugins/bitwarden-code-review", "version": "1.5.2", "description": "Comprehensive code review system with organization-wide standards." + }, + { + "name": "git-workflow", + "source": "./plugins/git-workflow", + "version": "1.0.0", + "description": "Streamlined git workflow: commit, push, and create/update PR with auto-generated messages following Bitwarden PR template" } ] } diff --git a/plugins/git-workflow/.claude-plugin/plugin.json b/plugins/git-workflow/.claude-plugin/plugin.json new file mode 100644 index 0000000..2ac9d35 --- /dev/null +++ b/plugins/git-workflow/.claude-plugin/plugin.json @@ -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"] +} diff --git a/plugins/git-workflow/CHANGELOG.md b/plugins/git-workflow/CHANGELOG.md new file mode 100644 index 0000000..a9fa773 --- /dev/null +++ b/plugins/git-workflow/CHANGELOG.md @@ -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 diff --git a/plugins/git-workflow/README.md b/plugins/git-workflow/README.md new file mode 100644 index 0000000..6a9ea73 --- /dev/null +++ b/plugins/git-workflow/README.md @@ -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. diff --git a/plugins/git-workflow/commands/commit-push-pr.md b/plugins/git-workflow/commands/commit-push-pr.md new file mode 100644 index 0000000..bde4a2e --- /dev/null +++ b/plugins/git-workflow/commands/commit-push-pr.md @@ -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" + - 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.