skills/flow-abort/SKILL.md
Abort the current FLOW feature. Closes the PR, deletes the remote branch, removes the worktree, and deletes the state file. Available from any phase. The confirmation prompt is governed by the skills.flow-abort config in the state file.
npx skillsauth add benkruger/flow flow-abortInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Abandon the current feature completely. This is the escape hatch — available from any phase, no prerequisites.
/flow:flow-abort
/flow:flow-abort — uses the configured mode from the state file's skills.flow-abort configThis 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.
Resolve the mode as the first action on entry, after resolving the
current branch. ## Mode Resolution is the single runnable home for
mode resolution — the same pattern flow-complete uses, so the two
terminal skills stay consistent. There are no --auto/--manual
flags — the state file's skills.flow-abort config is the single
source of truth for skill autonomy.
Resolve the current branch: run git worktree list --porcelain,
note the project root (the path on the first worktree line),
find the worktree entry whose path matches the current working
directory, and take the branch refs/heads/<name> line from that
entry (strip the refs/heads/ prefix). Call this <branch>.
Run the resolver below and use the continue field from its JSON
output as the abort-confirmation mode. It reads the
skills.flow-abort entry in the state file, tolerating every
object config shape, and falls back to manual when the config
is missing or unparseable:
${CLAUDE_PLUGIN_ROOT}/bin/flow resolve-skill-mode --skill flow-abort --branch <branch>
Run this entry check immediately after Mode Resolution.
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.
At the very start, output the following banner in your response (not via Bash) inside a fenced code block:
```text
──────────────────────────────────────────────────
FLOW v2.6.1 — 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 '<feature>'? ⚠ <any warnings from the entry check> 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, remote_branch, local_branch, branch_dir, queue_entry. Each step reports "closed"/"removed"/"deleted", "skipped", or "failed: <reason>". The branch_dir step recursively removes every per-branch artifact under .flow-states/<branch>/ (state file, log, plan, frozen phases, CI sentinel, timings, closed-issues record, issues summary, scratch rule content, commit message, start prompt). The queue_entry step removes .flow-states/start-queue/<branch> if a start-lock entry remains.
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 v2.6.1 — Abort — COMPLETE
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Feature '<feature>' has been abandoned.
Cleanup complete — see results above for details.
```
Report which steps succeeded and which were already cleaned up.
data-ai
Clear the autonomous-flow halt set when the user spoke mid-flow. Invokes `bin/flow clear-halt` so the next assistant turn resumes execution. User-only: the model cannot invoke this skill.
data-ai
Open a problem-statement conversation. Stays in discussion mode with PM as default voice; on user signal, files a vanilla What/Why/Acceptance Criteria issue against the current repo. Usage: /flow:flow-explore <topic>
tools
Display the FLOW skill catalog grouped by user role. Maintainer and Private buckets render only when invoked inside the FLOW plugin repo.
documentation
Phase 3: Review — six tenants assessed by four cognitively isolated agents (reviewer, pre-mortem, adversarial, documentation) launched in parallel. Parent session gathers context, triages findings, and fixes.