# Flush

Use when the user wants to manually flush a deferred-commit queue from a prior or...

- Repository: https://github.com/jeremylongshore/tons-of-skills-marketplace (2890 stars)
- Category: Git and review
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add jeremylongshore/tons-of-skills-marketplace --skill flush -g -a claude-code -y`
Codex: `npx skills add jeremylongshore/tons-of-skills-marketplace --skill flush -g -a codex -y`
Cursor: `npx skills add jeremylongshore/tons-of-skills-marketplace --skill flush -g -a cursor -y`
Gemini CLI: `npx skills add jeremylongshore/tons-of-skills-marketplace --skill flush -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add jeremylongshore/tons-of-skills-marketplace`

## Description

Use when the user wants to manually flush a deferred-commit queue from a prior or interrupted chain. Reads .hyperflow/commits-queue/manifest.json, fast-forwards the staging branch onto the user's branch, deletes staging, clears the queue. Recovery interface when a chain crashed before its Step 4 auto-flush ran. Trigger with /hyperflow:flush, "flush pending commits", "flush queue", "apply staged commits", "where are my commits".

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Flush

Manually flush the deferred-commit queue from a chain that ran with `commit-when=end`. Normally `/hyperflow:dispatch` calls `scripts/flush-commits.sh` at its Step 4 wrap-up; this skill exists for the case where the chain was interrupted (crash, kill, context loss) before the auto-flush ran.

## Subcommands

| Subcommand | Description |
|---|---|
| (no arg) | Run `scripts/flush-commits.sh <project-root>`, fast-forward staging onto user's branch, delete staging, clear queue |
| `--dry-run` | Show what would be flushed without doing it. Lists the queued commits in order. |

## What gets flushed

`.hyperflow/commits-queue/manifest.json` tracks the chain's `user_branch`, `staging_branch` (always `hyperflow/staging-<chain-id>`), and the list of queued commits with SHAs and messages. Flush replays them via `git merge --ff-only` so:

- All N commits land on the user's branch with original SHAs preserved
- Order is chronological (queue-time order)
- Original commit messages are preserved
- Original file-to-message mapping is preserved (each commit touched exactly the files its sub-task touched)

## What happens if fast-forward isn't possible

If the user's branch diverged from staging (e.g. the user committed manually mid-chain on the same branch), `git merge --ff-only` refuses. The skill surfaces the error with two recovery options:

1. `git rebase hyperflow/staging-<chain-id>`, replay staging commits on top of user's new commits
2. `git cherry-pick <staging-base>..hyperflow/staging-<chain-id>`, selectively pick commits

The staging branch is preserved for the user to act on manually. The queue manifest stays in place so a future `/hyperflow:flush` retry can attempt again after the user resolves divergence.

## Flow

1. Check `.hyperflow/commits-queue/manifest.json` exists. If not, print `No queue to flush.` and stop.
2. Run `bash $PLUGIN_ROOT/scripts/flush-commits.sh $PROJECT_ROOT [--dry-run]`.
3. Print the script's output verbatim.

## Overview

The rest: https://github.com/jeremylongshore/tons-of-skills-marketplace/blob/HEAD/plugins/ai-agency/hyperflow/skills/flush/SKILL.md
