From 119959f37591bd84545934b4fff3c1414739c1c0 Mon Sep 17 00:00:00 2001 From: Jon Deibel Date: Tue, 10 Mar 2026 08:01:24 -0400 Subject: [PATCH] feat: add plugin CLAUDE.md for auto-loaded gw instructions The gw skill only fires when explicitly invoked, so everyday operations like "commit this" or "create a PR" bypassed gw entirely. Adding a CLAUDE.md at the plugin root ensures gw rules are always loaded into context. The skill description is narrowed to complex workflows (splitting, conflict resolution, stacked PRs) since the CLAUDE.md handles basic operations. Bumps plugin version to 1.1.0. Co-Authored-By: Claude Opus 4.6 (1M context) --- .claude-plugin/marketplace.json | 2 +- plugins/gw/CLAUDE.md | 32 ++++++++++++++++++++++++++++++++ plugins/gw/skills/gw/SKILL.md | 18 ++++++++++-------- 3 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 plugins/gw/CLAUDE.md 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 ---