Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

flowing

БесплатноЗапускает вложенные скриптыНе проверен

Runs a multi-step procedure as a Python DAG, so ordering, branching, retries and rollback are enforced by the runner rather than described in prose a model…

oaustegardот oaustegard★ 425 звёзд на GitHub

Об этом скилле

NOT SUPERSEDED BY DYNAMIC WORKFLOWS — read first

Claude Code's dynamic workflows orchestrate subagents (separate contexts, fan-out to 16-concurrent / 1000-agent). This skill is a different primitive: single-context control flow over YOUR OWN tool calls, with durable side-effects and checkpoint resume. The workflows runtime explicitly cannot touch the filesystem or shell directly — its agents do the work and the script only coordinates them. Flowing is the inverse: the script does the work.

Use flowing for an in-context pipeline (3+ steps, branches, retries, validation, detached side-effects). Use a workflow when you need many subagents. They compose; they do not compete. Do not abandon flowing for a workflow — you would lose the durable side-effects and the cross-session checkpoint that hub-spoke depends on.

Flowing — Control Flow in Code, Not Prose

When a procedure needs 3+ steps with branches, retries, or contracts, encode it as a DAG of Python tasks instead of prose imperatives. Prose like "first X, then Y, then if Z retry 3×" is read and generated past. A @task graph is structural: a step physically cannot run until its inputs are bound, and gates that fire on bad inputs can't be skipped.

The runner owns control flow — branching, retrying, validating, propagating failures, parallelizing. You provide judgment at the leaves. Runner: scripts/flowing.py.

Quick Start

from flowing import task, Flow

@task
def fetch_data():
    return {"items": [1, 2, 3]}

@task(depends_on=[fetch_data])
def process(fetch_data):          # param name must match the dep's name
    return sum(fetch_data["items"])

@task(depends_on=[process])
def store(process):
    print(f"Result: {process}")

Flow(store).run()                 # topo-sorts, runs each layer, parallel within a layer

Each task receives its dependencies as kwargs named after them. Independent tasks in the same layer run in parallel.

Control-Flow Primitives

Encode branches and contracts as graph structure, not if statements inside task bodies.

when= — conditional gate

Run the task only if the predicate (over gathered dep values) is truthy. Falsy → SKIPPED, and the skip propagates to dependents.

@task(depends_on=[fetch], when=lambda fetch: fetch["needs_processing"])
def process(fetch):
    return transform(fetch["payload"])

validate= — edge contract

Check gathered dep values before the body runs. Raise → FAILED with no retry (bad inputs don't fix themselves). Pass → proceed.

def must_have_items(fetch):
    if not fetch.get("items"):
        raise ValueError("fetch returned empty payload")

@task(depends_on=[fetch], validate=must_have_items)
def process(fetch):
    return sum(fetch["items"])

retry_until= — predicate-driven loop

Run the body, then call retry_until(value). True → done. False → retry, consuming the retry= budget. Use for self-correcting LLM steps: generate, check, regenerate.

@task(retry=4, retry_until=lambda r: r["valid"])
def generate_until_valid():
    candidate = llm_call(...)
    return {"valid": passes_schema(candidate), "candidate": candidate}

Distinct from retry= alone, which only retries on a raised exception.

undo= — rollback on a later failure

When a main task fails, every task that succeeded in this run and declared undo= has undo(value) called with its own return value, in reverse completion order. Undone tasks and everything downstream of them end as ROLLED_BACK, so resume() re-runs them and the journal forgets them. Detached dependents of a rolled-back task skip, so no notification fires for work that was undone.

The common case is edit, test, and restore on red. snapshot(paths) records byte-exact contents (a missing file counts, and is deleted again on restore); restore is its undo:

from flowing import task, Flow, snapshot, restore

@task(undo=restore)
def before():
    return snapshot(["src/tax.py", "src/invoice.py"])

@task(depends_on=[before])
def edit(before):
    rename_everywhere("calculate_tax", "compute_tax")

@task(depends_on=[edit])
def verify(edit):
    r = subprocess.run(["pytest", "-q"], capture_output=True, text=True)
    if r.returncode:
        raise RuntimeError(r.stdout[-3000:])

flow = Flow(verify)
flow.run()   # red tests: both files are back as they were; flow.results["verify"].error holds the output

Put undo= on the step before the risky one. undo only runs for tasks that succeeded, so an edit that fails halfway through its files would never undo itself; the snapshot step that preceded it does.

Limits: an undo that raises is logged, collected in flow.rollback_failures, and leaves its task SUCCEEDED while the rest of the walk continues. Results replayed from the journal are never undone, because their effects belong to an earlier run. Side effects of the failing step itself (a migrated database, a sent message) are only undone if some step's

Полный SKILL.md на GitHub

Установить flowing в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

CHANGELOG.mdREADME.mdreferences/reference.mdscripts/flowing.py

FAQ

Что делает скилл flowing?

Runs a multi-step procedure as a Python DAG, so ordering, branching, retries and rollback are enforced by the runner rather than described in prose a model can generate past, and the whole procedure costs one tool call instead of a model turn per step. Use for "edit these files, run the tests, and restore everything if they fail", "retry the flaky step until the check passes", "fetch, validate, then skip the upload when nothing changed", "make sure these steps cannot be skipped", "resume from where it broke instead of redoing the expensive stages", "run these independent calls at once and merge the results", or any procedure of 3+ steps with branches, input contracts, or side effects. Primitives are depends_on, when=, validate=, retry_until=, undo=, detached= and journal_path=. Not for a single call, for steps needing reasoning between them that no predicate captures, or for async and distributed work. To audit whether one check can go red, use gating. To fan work out across subagents, use a dynamic workflow.

Как установить скилл flowing?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл flowing запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить flowing с