/git-workflow:finishfrom git-workflow
Creates a pull request with a comprehensive description by loading project config, verifying git state, and analyzing changes against the target branch. Follows repo conventions for PR descriptions.
Ships in git-workflow. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Cross-runtime: follow runtime compatibility for invocation, delegation, configuration precedence, state paths, and permissions.
You are helping create a pull request with a comprehensive description. Your task is to gather information, generate the PR description, push the branch, and create the PR using project conventions.
Check for configuration and context:
# Check for config and context files
if [ -f ".git-workflow/config.yaml" ]; then CONFIG_PATH=".git-workflow/config.yaml"; elif [ -f ".claude/config.yaml" ]; then CONFIG_PATH=".claude/config.yaml"; else CONFIG_PATH=""; fi
if [ -f ".git-workflow/pr-context.json" ]; then CONTEXT_PATH=".git-workflow/pr-context.json"; elif [ -f ".claude/.pr-context.json" ]; then CONTEXT_PATH=".claude/.pr-context.json"; else CONTEXT_PATH=""; fi
# Get current branch
git branch --show-current
Load from the resolved CONFIG_PATH (canonical first, legacy read-only fallback):
workflow:
developmentBranch: staging
productionBranch: main
pullRequests:
targetBranch: staging
reviewers: []
labels: []
issueTracker:
type: auto
Load from the resolved CONTEXT_PATH (canonical first, legacy read-only fallback):
{
"ticket_id": "PROJ-1234",
"ticket_url": "https://...",
"ticket_title": "Ticket title",
"branch": "fix/proj-1234-description",
"type": "fix",
"description": "Short description"
}
Default Values (when no config):
pullRequests:
targetBranch: staging
reviewers: []
labels: []
If context file is missing or incomplete:
/start and /commit firstIf the context contains a branch value that does not match the current branch, treat it as stale, explain which file was ignored, and gather fresh context. Do not silently reuse context from another branch.
Check current git state:
# Current branch
CURRENT_BRANCH=$(git branch --show-current)
# Commits on this branch vs target
TARGET_BRANCH=$(config.pullRequests.targetBranch || "staging")
git log --oneline ${TARGET_BRANCH}..HEAD
# Any uncommitted changes?
git status --short
Warnings:
/commit first?"/commit first."Analyze what changed:
# Files changed vs target branch
TARGET_BRANCH=$(config.pullRequests.targetBranch || "staging")
git diff --name-only ${TARGET_BRANCH}...HEAD
git diff --stat ${TARGET_BRANCH}...HEAD
# Commit messages on this branch
git log --oneline ${TARGET_BRANCH}..HEAD
Display summary:
Changes on this branch:
Files changed: 5
Commits: 3
Files:
M src/services/auth.ts (+45, -12)
M src/controllers/user.ts (+23, -8)
A src/utils/validation.ts (+67)
M tests/auth.test.ts (+89, -0)
M package.json (+2, -1)
Commits:
abc1234 [Fix] Update authentication flow (PROJ-1234)
def5678 [Fix] Add input validation (PROJ-1234)
ghi9012 [Fix] Add unit tests (PROJ-1234)
Ask the user for additional context (use the active host user-input mechanism):
Question: "Briefly describe what this PR does and why"
Example: "Fixes authentication timeout by implementing token refresh and adding proper error handling"
Question: "What issues did this PR fix? List each problem and solution."
Format: Numbered list
Example:
1. Token expiry not handled -> Added automatic token refresh
2. No validation on user input -> Added input sanitization
3. Missing error messages -> Added user-friendly error responses
Question: "How should reviewers test these changes?"
Options:
If manual testing, ask for specific test steps.
Question: "Are there any breaking changes?"
Options:
If yes, ask for description of breaking changes.
Use this template and fill with collected data:
## Description
{Fixes|Closes|Relates to} {ticket_id}
{High-level summary from user input}
### Changes
{For each commit or logical change, create a bullet point}
- **{Component/Area}**: {Description of change}
### Why
{Root cause explanation from user}
{Solution explanation}
---
## Testing
### Automated Tests
```bash
{testing.unit command or auto-detected}
```
### Manual Testing
{If manual testing required, include steps}
{If API endpoint, include curl example:}
```bash
curl -X {METHOD} "{base_url}/{endpoint}" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json"
```
### Expected Result
**Before**: {Description of broken behavior}
**After**: {Description of fixed behavior}
---
## Checklist
- [ ] Tests pass locally
- [ ] Code follows project style guidelines
- [ ] Self-review completed
- [ ] Documentation updated (if needed)
{If breaking changes:}
- [ ] Breaking changes documented
- [ ] Migration guide provided
Linear:
## Description
Fixes {ticket_id}
{Linear will auto-link to the ticket}
Jira:
## Description
Fixes [{ticket_id}]({jira_base_url}/browse/{ticket_id})
GitHub Issues:
## Description
Fixes #{issue_number}
# Push branch to remote with upstream tracking
git push -u origin {branch_name}
Error Handling:
Use commit message format from config (default: [{type}] {message} ({ticket})):
[Fix] Update authentication flow (PROJ-1234)
[Feature] Add dark mode support (ENG-456)
[Hotfix] Fix critical security issue (ABC-789)
# Determine target branch
TARGET_BRANCH=$(config.pullRequests.targetBranch || "staging")
# Create PR
gh pr create \
--base "${TARGET_BRANCH}" \
--title "{PR_TITLE}" \
--body "$(cat <<'EOF'
{GENERATED_DESCRIPTION}
EOF
)"
# From config.pullRequests.reviewers
gh pr edit {PR_NUMBER} --add-reviewer "user1,user2,team/name"
# From config.pullRequests.labels
gh pr edit {PR_NUMBER} --add-label "needs-review,bug"
gh pr edit {PR_NUMBER} --add-assignee @me
If Linear MCP server is available, update ticket status:
mcp__linear__update_issue(id: ticket_id, state: "In Review")
The MCP server handles authentication automatically.
If Jira MCP server is available, add PR link and update status:
mcp__jira__add_comment(issueKey: ticket_id, body: "PR: {PR_URL}")
GitHub automatically links PRs with "Fixes #123" syntax (no additional action needed).
Output confirmation:
Branch pushed: {branch_name}
PR created: {PR_URL}
Title: {PR_TITLE}
Target: {target_branch}
Reviewers: {reviewers_list or "None configured"}
Labels: {labels_list or "None"}
PR is ready for review!
Ask if the user wants to clean up canonical context:
# Remove context file (optional)
rm .git-workflow/pr-context.json
Or keep it for reference until the PR is merged. Legacy .claude/.pr-context.json is a read-only fallback and must never be deleted or modified by this workflow. If the active context came from that legacy path, warn that cleanup cannot remove it, leave it in place, and recommend /setup or $setup to migrate it.
| Setting | Default | Description |
|---|---|---|
pullRequests.targetBranch | staging | Default base branch for PRs |
pullRequests.reviewers | [] | Default reviewers |
pullRequests.labels | [] | Default labels |
issueTracker.type | auto | Issue tracker integration |
workflow.developmentBranch | staging | Development branch name |
| Scenario | Action |
|---|---|
gh not installed | Provide installation instructions |
| Not authenticated | Run gh auth login instructions |
| No commits on branch | Suggest running /commit first |
| Uncommitted changes | Suggest running /commit first |
| Branch not pushed | Push automatically before PR |
| PR already exists | Show existing PR URL, ask to update |
| Context file missing | Gather info manually, suggest /start |
| Target branch doesn't exist | Error with suggestion |
User: /finish
Agent: [Shows 5 files changed, 3 commits]
Agent: Describe what this PR does? -> "Fixes auth timeout"
Agent: What issues were fixed? -> "1. Token expiry -> Added refresh"
Agent: How to test? -> "Run existing tests"
Agent: Breaking changes? -> "No"
Result: PR #123 created
URL: https://github.com/org/repo/pull/123
User: /finish
Agent: [Gathers info]
Result: PR #124 created
Reviewers: @alice, @bob, @team/backend
Labels: needs-review, feature
User: /finish
Agent: [Creates PR]
Agent: [Updates Linear ticket ENG-456 to "In Review"]
Result: PR #125 created
Ticket ENG-456 updated to "In Review"
## Description
Fixes {ticket_id}
This PR fixes {brief description of bug}.
### Root Cause
{Explanation of why the bug occurred}
### Solution
{How the fix addresses the root cause}
### Changes
- {Change 1}
- {Change 2}
## Testing
{Test instructions}
## Description
Implements {ticket_id}
This PR adds {feature name} which allows users to {capability}.
### Implementation
{High-level overview of implementation approach}
### Changes
- {Change 1}
- {Change 2}
## Testing
{Test instructions}
## Screenshots
{If UI changes, include before/after screenshots}
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub rlajous/claude-code-commands --plugin git-workflow22 skills in this plugin
/change-briefTurn a pull request into a concise, self-contained HTML decision brief with business logic, diagrams when useful, conditional UI/mobile screenshots, API cURL request/response evidence, risks, verification, and representative before/after code. Use when the user asks to "explain this change as HTML", "before/after html", "change brief", "html explainer for a PR", "explain what changed", or wants a shareable, human-readable snapshot of a code change. Args a PR number/URL, or nothing to use the current branch's PR./clean-goneDelete local Git branches whose upstream was deleted on the remote ("[gone]"), and remove any worktrees attached to them. Use when the user asks to clean up merged/stale branches, prune gone branches, tidy local branches after merging PRs, or "delete branches that are gone on the remote"./Other plugins' skills for the same job