From flow
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.
npx claudepluginhub benkruger/flowThis skill uses the workspace's default tool permissions.
Remove all FLOW artifacts from the current project. Use when abandoned features leave orphaned worktrees, branches, state files, and PRs.
Aborts current FLOW feature by closing GitHub PR, deleting remote branch, removing worktree, and deleting state file. Available any phase; --auto or --manual modes.
Automates git branch cleanup: inventories local/remote branches, identifies merged/gone candidates, protects main/develop/release/current, confirms deletions, prunes remotes, provides recovery SHAs.
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.
Share bugs, ideas, or general feedback.
Remove all FLOW artifacts from the current project. Use when abandoned features leave orphaned worktrees, branches, state files, and PRs.
Run:
git branch --show-current
If the current branch is NOT main, stop:
"Must be on main branch to reset. Switch to main first."
Gather all FLOW artifacts. Display each category.
Run:
git worktree list
List any worktrees besides the main working tree.
Use Glob to find all files in .flow-states/ — JSON state files and logs.
Use Glob to find files in .flow-states/start-queue/.
Run:
git branch --list
List any branches besides main.
Run:
git branch -r
List any remote branches besides origin/main and origin/HEAD.
Run:
gh pr list --state open --json number,headRefName
List any open PRs.
Print the full inventory inside a fenced code block:
```text
──────────────────────────────────────────────────
FLOW Reset — Artifact Inventory
──────────────────────────────────────────────────
Worktrees: <count>
State files: <count>
Start lock entries: <count>
Local branches: <count>
Remote branches: <count>
Open PRs: <count>
──────────────────────────────────────────────────
```
List each item under its category.
If nothing is found in any category, print:
"No FLOW artifacts found. Nothing to reset."
And stop.
Use AskUserQuestion:
"Destroy all listed artifacts? This cannot be undone."
- Yes, destroy everything
- No, cancel
If cancelled, stop.
Process each category. Continue on failure — report errors at the end.
For each open PR, run gh pr close <number> where <number> is the PR number from the inventory.
For each worktree (besides main), run git worktree remove --force <path> where <path> is the worktree path from the inventory.
For each remote branch (besides origin/main and origin/HEAD), run git push origin --delete <name> where <name> is the branch name without the origin/ prefix.
For each local branch (besides main), run git branch -D <name>.
For each file in .flow-states/start-queue/, run rm .flow-states/start-queue/<filename>.
For each file in .flow-states/, run rm .flow-states/<filename>.
Print results inside a fenced code block:
```text
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ FLOW Reset — Complete
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
PRs closed: <count>
Worktrees removed: <count>
Remote branches deleted: <count>
Local branches deleted: <count>
State files deleted: <count>
Lock queue entries cleared: <count>
Errors: <count or "none">
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
```
If any step failed, list the error details below the summary.
Run:
git worktree list
And:
git branch --list
Confirm only main remains. If stale artifacts persist, report them.