Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .claude-plugin/marketplace.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "gw",
"description": "Stacked branch management for Claude Code. Teaches Claude to use gw for branch creation, pushing, rebasing, and syncing instead of raw git commands. Includes MCP tools for direct stack manipulation.",
"version": "1.0.0",
"version": "1.1.0",
"author": {
"name": "Jon Deibel"
},
Expand Down
32 changes: 32 additions & 0 deletions plugins/gw/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# gw - Always Use for Branch Management

This repo uses **gw** for all branch and stack management. Use gw MCP tools instead of raw git for any operation involving branches, pushing, rebasing, or syncing.

## Quick Rules

- **Push**: Use `gw_push` or `gw_force_push`, never `git push`
- **Create branches**: Use `gw_branch_create`, never `git checkout -b`
- **Switch branches**: Use `gw_switch`, never `git checkout <branch>`
- **Rebase**: Use `gw_rebase`, never `git rebase`
- **Sync with remote**: Use `gw_sync` or `gw_sync_rebase`, never `git pull`
- **View branch state**: Use `gw_log` or `gw_log_pr`, never `git branch`
- **Raw git is fine for**: `git add`, `git commit`, `git status`, `git diff`, `git log`, `git stash`

## Before Any Git Workflow Operation

Always run `gw_log` first to understand the current stack state before creating branches, pushing, or creating PRs.

## Creating PRs

When creating PRs for stacked branches, create them bottom-up. The root branch PR targets the base branch (e.g. `main`), and each child branch PR targets its parent branch. Use `gw_log_pr` to check existing PR status.

## Starting New Work

1. Run `gw_log` to check existing stacks
2. Create a stack with `gw_stack_create`
3. Commit with git as normal
4. When the next logical unit starts, create the next branch with `gw_branch_create`

## After Pushing Changes to an Earlier Branch

Run `gw_rebase` after committing to a branch that has descendants, so the rebase propagates through the chain.
18 changes: 10 additions & 8 deletions plugins/gw/skills/gw/SKILL.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
name: gw
description: >
Guides Claude to use gw (Git Workflow) for all branch and stack management
instead of raw git commands. Automatically applies when doing git operations
like committing, branching, pushing, creating PRs, or organizing work into
reviewable chunks.
TRIGGER when: user asks to commit, push, create a branch, create a PR, break
work into pieces, rebase, sync with main, or any git workflow operation.
DO NOT TRIGGER when: reading files, running tests, editing code with no git
intent.
Detailed reference for gw stacked branch workflows: splitting branches,
resolving rebase/split conflicts, creating stacked PRs, and advanced
stack management. Use when the task involves splitting a branch into a
stack, handling rebase conflicts, creating multiple stacked PRs, or
planning how to decompose work into stacked branches.
TRIGGER when: user asks to split a branch, resolve rebase conflicts,
create stacked PRs, break work into reviewable pieces, or needs
detailed guidance on gw workflows.
DO NOT TRIGGER when: simple commit, push, single PR creation, branch
switching, or basic git operations (the plugin CLAUDE.md handles those).
allowed-tools: Bash, Read, Edit, Write, Glob, Grep, mcp__gw__gw_stack_create, mcp__gw__gw_stack_list, mcp__gw__gw_stack_delete, mcp__gw__gw_branch_create, mcp__gw__gw_branch_remove, mcp__gw__gw_log, mcp__gw__gw_log_pr, mcp__gw__gw_push, mcp__gw__gw_force_push, mcp__gw__gw_rebase, mcp__gw__gw_rebase_continue, mcp__gw__gw_rebase_abort, mcp__gw__gw_sync, mcp__gw__gw_sync_rebase, mcp__gw__gw_sync_merged, mcp__gw__gw_switch, mcp__gw__gw_split, mcp__gw__gw_split_continue, mcp__gw__gw_split_abort, mcp__github__create_pull_request
---

Expand Down