diff --git a/.claude-plugin/marketplace.json b/.claude-plugin/marketplace.json index 48b25b7..e88df7f 100644 --- a/.claude-plugin/marketplace.json +++ b/.claude-plugin/marketplace.json @@ -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" }, diff --git a/plugins/gw/CLAUDE.md b/plugins/gw/CLAUDE.md new file mode 100644 index 0000000..9a54ca9 --- /dev/null +++ b/plugins/gw/CLAUDE.md @@ -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 ` +- **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. diff --git a/plugins/gw/skills/gw/SKILL.md b/plugins/gw/skills/gw/SKILL.md index 8db22b2..de2952a 100644 --- a/plugins/gw/skills/gw/SKILL.md +++ b/plugins/gw/skills/gw/SKILL.md @@ -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 ---