From flow
Aborts current FLOW feature by closing GitHub PR, deleting remote branch, removing worktree, and deleting state file. Available any phase; --auto or --manual modes.
npx claudepluginhub benkruger/flowThis skill uses the workspace's default tool permissions.
Abandon the current feature completely. This is the escape hatch — available
Resets FLOW project artifacts: closes open PRs, removes git worktrees, deletes local/remote branches, clears .flow-states files. Use on main branch to clean abandoned features.
Removes git worktrees and associated branches after PR merges, sub-scope consolidation, or manual cleanup. Lists worktrees if unspecified, handles uncommitted changes and paused states.
Interactively selects and safely removes a specific git worktree for issues, checking if linked issue is closed, branch merged into default, and no uncommitted changes before removal, with optional branch deletion.
Share bugs, ideas, or general feedback.
Abandon the current feature completely. This is the escape hatch — available from any phase, no prerequisites.
/flow:flow-abort
/flow:flow-abort --auto
/flow:flow-abort --manual
/flow:flow-abort — uses configured mode from the state file (default: auto)/flow:flow-abort --auto — skips confirmation and proceeds directly to cleanup/flow:flow-abort --manual — prompts for user confirmation before any destructive actionThis flow is one of potentially many running simultaneously — on this
machine (multiple worktrees) and across machines (multiple engineers).
Your state file (.flow-states/<branch>/state.json) is yours alone. Never
read or write another branch's state. All local artifacts (logs, plan
files, temp files) are scoped by branch name. GitHub state (PRs, issues,
labels) is shared across all engineers — operations that create or modify
shared state must be idempotent.
--auto was passed → mode is auto--manual was passed → mode is manual<project_root>/.flow-states/<branch>/state.json. Use skills.flow-abort value.skills key → use built-in default: autoRun this entry check as your very first action.
git worktree list --porcelain. Note the path on the first
worktree line (this is the project root). Find the worktree entry
whose path matches your current working directory — the
branch refs/heads/<name> line in that entry is the current branch
(strip the refs/heads/ prefix).<project_root>/.flow-states/<branch>/state.json.
feature, branch, worktree,
pr_number, and pr_url. Print the feature name, branch, PR URL,
and current phase.branch from the porcelain output (already known)pr_number unknown — skip PR close step laterIf the Read tool fails for any other reason, stop and show the error.
Use these values for all subsequent steps — do not re-read the state file or re-run git commands to gather the same information.
Resolve the mode using the Mode Resolution rules above.
At the very start, output the following banner in your response (not via Bash) inside a fenced code block:
```text
──────────────────────────────────────────────────
FLOW v1.1.0 — Abort — STARTING
──────────────────────────────────────────────────
```
Skip this step if mode is auto — proceed directly to Steps 2–7.
If mode is manual, this is destructive and irreversible. Use AskUserQuestion.
If the entry check printed warnings, include them in the confirmation:
"Abort feature ''? ⚠ This will close the PR, delete the remote branch, remove the worktree, and delete the state file and log. All uncommitted work in the worktree will be lost."
If a state file was found in the entry check, remove the "Flow In-Progress" label from any issues referenced in the prompt. Best-effort — continue to cleanup even if removal fails. Skip this step if no state file exists.
${CLAUDE_PLUGIN_ROOT}/bin/flow label-issues --state-file <project_root>/.flow-states/<branch>/state.json --remove
Run the cleanup script from the project root with abort flags:
${CLAUDE_PLUGIN_ROOT}/bin/flow cleanup <project_root> --branch <branch> --worktree <worktree_path> --pr <pr_number>
If pr_number is unknown, omit --pr. The cleanup script deletes local branches and attempts remote branch deletion when --pr is provided.
The script outputs JSON with a steps dict showing what happened to each resource (pr_close, worktree_tmp, worktree, remote_branch, local_branch, state_file, plan_file, dag_file, log_file, frozen_phases, ci_sentinel, timings_file, closed_issues_file, issues_file, adversarial_test). Each step reports "closed"/"removed"/"deleted", "skipped", or "failed: reason". The adversarial_test step matches .flow-states/<branch>/adversarial_test.* so the Phase 4 adversarial agent's temp file is removed regardless of the runtime-chosen extension.
Tell the user what was cleaned, what was already gone, and what failed.
Then output the following banner in your response (not via Bash) inside a fenced code block:
```text
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ FLOW v1.1.0 — Abort — COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Feature '<feature>' has been abandoned.
Cleanup complete — see results above for details.
```
Report which steps succeeded and which were already cleaned up.