From fakoli-flow
Ship phase — merge, PR, keep, or discard with pre-merge verification
How this skill is triggered — by the user, by Claude, or both
Slash command
/fakoli-flow:finishThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Ship work only after fresh verification. Present options. Execute the chosen one. Never act without an explicit choice.
/flow:finish)Ship work only after fresh verification. Present options. Execute the chosen one. Never act without an explicit choice.
Core principle: Verify first, present exactly 4 options, wait for a decision, then execute.
This skill is invoked:
/flow:verify reports all criteria PASS/flow:finishNever auto-merge or auto-push. The skill presents options and waits. The user decides.
Do not rely on the verify step's results. Re-run now, in this message.
Detect the project language first:
[ -f tsconfig.json ] && echo "TypeScript"
[ -f Cargo.toml ] && echo "Rust"
{ [ -f pyproject.toml ] || [ -f setup.py ]; } && echo "Python"
Then run the appropriate test command:
TypeScript:
npx tsc --noEmit && bun test
Python:
ruff check . && mypy . && pytest
Rust:
cargo check && cargo test
If tests fail — STOP.
Report the failures with their full output:
Tests failing (N failures). Cannot proceed to ship.
[show exact failure output]
Fix the failures and re-run `/flow:finish`.
Do not proceed to Step 2. Return control to the user.
If tests pass: Continue.
git branch --show-current
git branch --list main master
If main exists, use main as the base branch. If only master exists, use master. If neither main nor master is found, ask the user: "What is the base branch?"
Present these options verbatim, substituting <base-branch> with the detected branch name:
Tests pass. What would you like to do with this branch?
1. Merge back to <base-branch> locally
2. Push and create a Pull Request
3. Keep the branch as-is
4. Discard this work
Which option? (1/2/3/4)
Do not add explanations, recommendations, or commentary. Do not suggest an option. Wait for the user's answer.
# Get the current feature branch name
FEATURE_BRANCH=$(git branch --show-current)
# Switch to base branch
git checkout <base-branch>
# Pull latest
git pull
# Merge feature branch
git merge "$FEATURE_BRANCH"
After merging, re-run tests on the merged result:
# Run the same test command from Step 1
If the post-merge tests fail: do not delete the feature branch. Report the failures and stop.
If the post-merge tests pass:
git branch -d "$FEATURE_BRANCH"
Report: "Merged <feature-branch> into <base-branch>. Branch deleted."
# Push the feature branch
git push -u origin $(git branch --show-current)
Then create the PR using gh pr create. Pull the summary from the plan file:
# Find the plan
ls docs/plans/ | sort | tail -1
Read the plan's Goal line and task list. Use them in the PR body:
gh pr create --title "<feature name from plan Goal>" --body "$(cat <<'EOF'
## Summary
<2-3 bullet points from the plan's task list — what was built, not how>
## Test results
- Type check: PASS (npx tsc --noEmit)
- Tests: PASS (N/N passing)
- Acceptance criteria: N/N PASS
## Plan
docs/plans/<plan-filename>
EOF
)"
Report the PR URL when gh pr create returns it.
Report: "Keeping branch <feature-branch>. No changes made."
Do not delete anything. Do not merge anything. Done.
First, show exactly what will be deleted:
git log <base-branch>..HEAD --oneline
Display:
This will permanently delete:
Branch: <feature-branch>
Commits to be lost:
<commit hash> <commit message>
<commit hash> <commit message>
...
Type "discard" to confirm. This cannot be undone.
Wait for the user to type exactly discard. Accept nothing else — not "yes", not "ok", not "confirm".
If the user does not type discard: abort. Report: "Discard cancelled. Branch preserved."
If the user types discard:
FEATURE_BRANCH=$(git branch --show-current)
git checkout <base-branch>
git branch -D "$FEATURE_BRANCH"
Report: "Branch <feature-branch> and all its commits have been deleted."
Check if a worktree was used for this branch. Use the FEATURE_BRANCH variable captured
at the top of the chosen option block — do NOT use git branch --show-current here,
because Options 1 and 4 have already checked out the base branch by this point.
git worktree list | grep "$FEATURE_BRANCH" 2>/dev/null
git worktree remove <worktree-path>
| Option | What happens | Worktree |
|---|---|---|
| 1. Merge locally | Merges to base, deletes feature branch | Removed |
| 2. Push + PR | Pushes branch, creates GitHub PR | Preserved |
| 3. Keep as-is | Nothing changes | Preserved |
| 4. Discard | Deletes all commits, deletes branch | Removed |
Skipping the Step 1 re-run because /flow:verify just passed.
Verify ran earlier. Code may have changed. Run the tests again now.
Adding a recommendation when presenting options. "I'd suggest option 2" — don't. Present the options. Wait.
Accepting "yes" instead of "discard" for Option 4. The exact word is the guard. If someone types "yes", ask again.
Forgetting to check for worktrees. A dangling worktree is a future confusion. Always check and clean up for Options 1 and 4.
npx claudepluginhub fakoli/fakoli-plugins --plugin fakoli-flowVerifies tests pass on completed feature branch, presents options to merge locally, create GitHub PR, keep as-is or discard; executes choice and cleans up worktree.
Finishes Git development branches: verifies tests pass, presents options to merge locally, push/create GitHub PR, keep as-is, or discard; executes choice and cleans up worktrees.
Verifies tests and presents merge, PR, branch cleanup, or discard options after implementation is complete.