Flow next work

From gmickel/flow-next · View interactive version

Flow next work is an AI agent skill from the GitHub repository gmickel/flow-next. Execute a flow-next spec or task with workers, gates and commits. Run when the work command is typed or flow-next-flow routes here; plain requests to implement fn-N go to flow-next-flow.

How to use this skill

Skill file

Flow work

Execute a plan systematically. Focus on finishing.

.flow/ is the only task tracker. A run that recorded task state in a markdown TODO, a plan file, TodoWrite, or any other tracker has broken this — all task state is read and written via flowctl.

Preamble

CRITICAL: flowctl is BUNDLED — NOT installed globally. which flowctl will fail (expected). Define once; subsequent blocks (here and in phases.md) use $FLOWCTL:

FLOWCTL="${CODEX_HOME:-$HOME/.codex}/scripts/flowctl"
[ -x "$FLOWCTL" ] || FLOWCTL="<plugin-root>/scripts/flowctl"   # <plugin-root> = the directory two levels above this skill's SKILL.md file (the harness gave you that file's absolute path when the skill loaded); substitute it literally
[ -x "$FLOWCTL" ] || FLOWCTL=".flow/bin/flowctl"

Hard requirements (non-negotiable):

Role: execution lead, plan fidelity first.

Goal: complete every task in order with tests.

Autonomous Mode (questions off, no receipt obligations)

Before gates, treat this host-expanded block as literal prompt data, never shell:

<work-arguments>

$ARGUMENTS

</work-arguments>

Strip standalone whitespace token mode:autonomous into WORK_ARGS; preserve

all else verbatim (spaces/quotes/globs). Set/export AUTONOMOUS=1 if found or

FLOW_AUTONOMOUS=1; otherwise set/export AUTONOMOUS=0.

Continue with WORK_ARGS; carry the exported marker into later shell fragments.

If AUTONOMOUS=1:

Input

Full request after mode parsing: $WORK_ARGS

Accepts:

If no input provided, ask for it.

FIRST: Parse Options

Option Parsing (skip questions if found in arguments)

Parse WORK_ARGS for these patterns. If found, use them and skip corresponding questions:

Branch mode:

Base: --base=<branch> or --base <branch> → DEFAULT_BASE=origin/<branch> (a leading

origin/ is kept once), the branch a new spec branch starts from and the run is compared against

(phases.md Phase 2); an unfetchable branch, or a spec with a chain parent, stops BLOCKED there,

before any branch is created.

Review mode:

("review with codex", "host review", "skip review"); --no-review = none

(All non-none review modes route through $flow-next-impl-review, which resolves the

configured/overridden backend — codex, copilot, cursor, claude, command, or host — itself.)

No-plan (direct spec execution):

Autonomous mode:

If the options are absent from the arguments

If AUTONOMOUS=1 (autonomous mode): ask nothing — apply the autonomous defaults and continue to the workflow.

Otherwise (interactive): do not ask about the branch. Stay on the current branch when it is

not the default branch, otherwise create a new one (named for the spec's branch_name), and say

which in one line. Never ask about review either: the review step resolves the backend per task

(phases.md Phase 3).

Done when: the branch and review modes are resolved from arguments, these defaults, or the

autonomous defaults.

Workflow

Read working-rules.md first unless you already have this run; it holds on every phase and in every worker dispatch.

Once the modes are resolved, read phases.md and execute each phase in order.

Guardrails

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.