Command Palette

Search for a command to run...

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

flow-next-deps

БесплатноБез исполняемых скриптовНе проверен

Show spec dependency graph and execution order. Use when asking 'what's blocking what', 'execution order', 'dependency graph', 'what order should specs run'…

gmickelот gmickel★ 735 звёзд на GitHub

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

Flow-Next Dependency Graph

Visualize spec dependencies, blocking chains, and execution phases.

Preamble

flowctl is bundled with the plugin (not on PATH). Define once; subsequent blocks 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"

Setup

[ -d "$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.flow" ] && echo "OK: .flow/ exists" || echo "ERROR: run $FLOWCTL init"
command -v jq >/dev/null 2>&1 && echo "OK: jq installed" || echo "ERROR: brew install jq"

Step 1: Gather Spec Data

Build a consolidated view of all specs with their dependencies in a single flowctl specs --json call (depends_on_epics is included directly in specs --json, so no per-spec flowctl show loop is needed). Steps 2 and 3 reuse the cached file (bash vars do not survive across prompt turns, so the cache is a file at a literal agent-composed path — compose <suffix> once, e.g. 4 random chars, and reuse the same literal path in every later block):

# ONE gather — Steps 2 and 3 read this file; no per-spec flowctl show loop
SPECS_FILE="${TMPDIR:-/tmp}/flow-deps-specs-<suffix>.json"
"$FLOWCTL" specs --json | jq '[.specs[] | {
  id: .id,
  title: .title,
  status: .status,
  deps: (.depends_on_epics // [])
}]' > "$SPECS_FILE"
jq -r --arg f "$SPECS_FILE" '"Gathered \(length) specs (\([.[] | select(.status != "done")] | length) open) -> \($f)"' "$SPECS_FILE"

Done when

  • $SPECS_FILE exists at the composed literal path and parses as a JSON array with one object per spec returned by flowctl specs --json, including .deps from .depends_on_epics.
  • Data was gathered in one flowctl specs --json call with zero per-spec flowctl show calls. Steps 2 and 3 read that file. A second gather has broken this.

Step 2: Identify Blocking Chains

Determine which specs are ready vs blocked (pure jq, works on any shell):

# Reuse the Step 1 gather — same literal path, NO re-fetch (one gather total)
SPECS_FILE="${TMPDIR:-/tmp}/flow-deps-specs-<suffix>.json"

# Compute blocking status
jq -r '
  # Build status lookup
  (map({(.id): .status}) | add // {}) as $status |

  # Check each non-done spec
  .[] | select(.status != "done") |
  .id as $id | .title as $title |

  # Find deps that are not done
  ([.deps[] | select($status[.] != "done")] | join(", ")) as $blocked_by |

  if ($blocked_by | length) == 0 then
    "READY: \($id) - \($title)"
  else
    "BLOCKED: \($id) - \($title) (by: \($blocked_by))"
  end
' "$SPECS_FILE"

Done when

  • Every non-done spec in $SPECS_FILE emitted exactly one READY: or BLOCKED: line, and each BLOCKED: line names the specific deps holding it.
  • The jq ran against the cached file, not a fresh flowctl specs or flowctl show call.

Step 3: Compute Execution Phases

Group specs into parallel execution phases:

# Reuse the Step 1 gather — same literal path, NO re-fetch (one gather total)
SPECS_FILE="${TMPDIR:-/tmp}/flow-deps-specs-<suffix>.json"

# fence:deps-phases
# Phase assignment algorithm (run in jq for reliability)
jq '
  # Build status lookup
  (map({(.id): .status}) | add // {}) as $status |

  # Filter to non-done specs
  [.[] | select(.status != "done")] as $open |

  # Assign phases until a round places nothing, so a chain of any depth is phased
  {assigned: [], result: [], open: $open, stalled: false} |
  until(.stalled;
    .assigned as $assigned |

    # Find specs not yet assigned whose deps are all done or in earlier phases
    ([.open[] | select(
      ([.id] | inside($assigned) | not) and
      ((.deps // []) | all(. as $d | $status[$d] == "done" or ($assigned | index($d))))
    )] | map(.id)) as $ready |

    if ($ready | length) > 0 then
      .result += [{phase: ((.result | length) + 1), specs: [.open[] | select(.id | IN($ready[]))]}] |
      .assigned += $ready
    else .stalled = true end
  ) |
  # Emit the phases AND the residue: any open spec never assigned can never start.
  # Dropping it silently is the one way /deps gives a WRONG answer (the graph it exists to
  # expose hides the deadlock). Surface it with its unresolved deps and its cause: on a
  # dependency cycle (with the path), a dep that is not among the specs, or blocked only
  # by another deadlocked spec.
  .assigned as $asg |
  ([ $open[] | select(.id as $i | ($asg | index($i)) | not)
     | {key: .id, value: [ (.deps // [])[] | select(. as $d | ($asg | index($d)) or ($status[$d] == "done") | not) ]} ]
   | from_entries) as $unres |
  # Breadth-first walk over unresolved deps back to $id; the path, or null
  def cycle_of($id):
    {queue: [$id], parent: {}, last: null} |
    until((.queue | length) == 0 or .last != null;
      .qu
Полный SKILL.md на GitHub

Установить flow-next-deps в Claude Code и Claude Desktop

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

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

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

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

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

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

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

agents/openai.yaml

FAQ

Что делает скилл flow-next-deps?

Show spec dependency graph and execution order. Use when asking 'what's blocking what', 'execution order', 'dependency graph', 'what order should specs run', 'critical path', 'which specs can run in parallel'.

Как установить скилл flow-next-deps?

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

Скилл flow-next-deps запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

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

Сравнить flow-next-deps с