thiagowfx's avatar

Β¬ just serendipity πŸ€ (not just serendipity)

β˜… /ship-and-burn a pull request

β€’ 261 words β€’ 2 min

Problem statement: ship a simple change (or commit, or pull request: you name it), then wait for green CI, then remove its local branch and worktree (=clean up).

It’s 2026, so we’ll codify this workflow in the form of an agent skill.

I created /ship-and-burn for that.

text
/ship-and-burn [reviewer]

It’s very important that you picture this movie whenever you invoke this skill.

The structure is the following, composing various of my other skills:

text
/ship ──> pull request ──> /pr-pass ──> green ──> delete local state
                                  └──> blocked ──> keep local state

The implementation is a single SKILL.md Markdown file (naturally!):

shell
% git show --stat --oneline 8e0eed7
8e0eed7 feat: add ship-and-burn skill

 README.md                                       |  1 +
 package.json                                    |  2 +-
 plugins/thiagowfx/.claude-plugin/plugin.json    |  2 +-
 plugins/thiagowfx/skills/ship-and-burn/SKILL.md | 67 +++++++++++++++++++++++++
 4 files changed, 70 insertions(+), 2 deletions(-)

The skill stops before cleanup whenever CI remains failed or pending πŸ”΄.

Once checks pass 🟒, it verifies that the worktree/checkout is clean and that every local commit exists on the remote:

bash
test -z "$(git status --porcelain)"
git merge-base --is-ancestor HEAD "origin/$branch"

For a secondary (=non-base) worktree, wt removes both the worktree and its local branch:

bash
cd "$primary"
wt del -- --foreground "$branch"

The pull request and remote branch remain intact.

Should review comments arrive later, my gh co (or wt co for a separate worktree) alias restores the branch and worktree before I address them:

text
% gh co <pull-request>
% /address-pr-comments

This surely feels like living in the future!

And, when using a light harness like pi, it’s super fast!