From superpowers
Handles the keep/discard/pause decision for an experiment branch: merge locally, push and create PR, pause, or discard with worktree cleanup.
How this skill is triggered — by the user, by Claude, or both
Slash command
/superpowers:finishing-experiment-branchThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Execute the keep/discard/pause decision for an experiment branch and clean up the worktree.
Execute the keep/discard/pause decision for an experiment branch and clean up the worktree.
Announce at start: "I'm using the finishing-experiment-branch skill to handle the experiment branch."
experiment-closeout must have already:
docs/experiments/results/YYYY-MM-DD-<topic>.md.This skill handles git mechanics. It does NOT duplicate the documentation or decision-asking from experiment-closeout.
Check that docs/experiments/results/YYYY-MM-DD-<topic>.md exists and can survive cleanup. If it exists only in the experiment worktree or experiment branch, copy it into the main working tree on the base branch before any destructive cleanup. If no experiment note exists anywhere, refuse to proceed and redirect to experiment-closeout.
.worktrees/<topic>/.experiment-metadata.json if available.<original-repo-root>), worktree path, base branch, experiment branch, and note path.[ "$(git rev-parse --git-common-dir)" != "$(git rev-parse --git-dir)" ]
experiment-worktree was not used).If the decision was already made by experiment-closeout, execute it directly. If invoked standalone, present exactly these options:
Experiment complete. What would you like to do?
1. Merge experiment branch into <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is (pause, handle later)
4. Discard this work
pytest or project-specific command).git merge exp/<YYYY-MM-DD>-<topic>
git worktree remove .worktrees/<topic>
git branch -d exp/<YYYY-MM-DD>-<topic>
<base-branch> at commit <hash>."git push -u origin exp/<YYYY-MM-DD>-<topic>
gh pr create --title "exp: <topic>" --body "$(cat <<'EOF'
## Experiment
See docs/experiments/results/YYYY-MM-DD-<topic>.md
## Summary
<hypothesis and outcome from experiment note>
## Test Plan
- [ ] Verify metrics match experiment note
- [ ] Reproducibility check passed
EOF
)"
Branch exp/<YYYY-MM-DD>-<topic> preserved.
Worktree at .worktrees/<topic>.
Resume with finishing-experiment-branch when ready.
This will permanently delete:
- Branch: exp/<YYYY-MM-DD>-<topic>
- All commits since <base-commit>
- Worktree at .worktrees/<topic>
Type 'discard' to confirm.
<original-repo-root> and switch to <base-branch>.docs/experiments/results/YYYY-MM-DD-<topic>.md exists there.<original-repo-root>.<original-repo-root> with: "Code discarded. Branch deleted."<original-repo-root> with git status --short docs/experiments/results/YYYY-MM-DD-<topic>.md.<original-repo-root>, remove the worktree and branch:
cd <original-repo-root>
git worktree remove .worktrees/<topic> --force
git branch -D exp/<YYYY-MM-DD>-<topic>
git status, confirm on base branch.If no worktree is active (experiment ran directly on a branch without experiment-worktree):
Report three things:
.experiment-metadata.json for symlinked_data. Verify that listed paths are symlinks ([ -L <path> ]), not real directories. git worktree remove deletes symlinks safely (targets are untouched), but never rm -rf a worktree directory manually — use git worktree remove to avoid accidentally following symlinks into real data.Called by: experiment-closeout (steps 5 and 6)
Pairs with: experiment-worktree (cleans up what that skill created)
npx claudepluginhub shunyangliu/superpowers_dlGuides the decision to keep, discard, or pause experiment code changes after a run, with safe rollback and archival of outcomes.
Finishes development branches: verifies tests pass, presents options for local merge, push and GitHub PR, keep as-is, or discard; executes git commands and cleans up worktrees.
Verifies tests pass, determines base branch, then guides integration via local git merge, GitHub PR creation, keeping branch, or discard with execution and cleanup.