Skip to content

forgeplan order

Sort all artifacts into topological execution order using dependency edges (blocks, depends_on, parent/child). The output is a linearized walk suitable for sprint planning: “do PRD-002 before PRD-007, because PRD-007 depends on it.”

  • Sprint planning — sequence multiple PRDs correctly
  • Dependency auditing — spot missing edges that should exist
  • CI gate — fail the build on dependency cycles
forgeplan order [OPTIONS]
--json Output as JSON for machine consumption
-h, --help Print help
-V, --version Print version

Print the full topological order:

Terminal window
forgeplan order

Pipe into a sprint doc template:

Terminal window
forgeplan order --json | jq -r '.[] | "- [ ] \(.id) \(.title)"'

One artifact per line, earliest-first (breadth-first tiebreaker):

1. ADR-003 Files as source of truth [active]
2. PRD-039 BM25 production search [active]
3. RFC-004 Layered search architecture [active]
4. EVID-018 Benchmark results [active]
5. PRD-040 Scoring intelligence [draft]
ColumnMeaning
IndexPosition in the topological walk
IDArtifact ID
TitleShort title
Status[active], [draft], etc. — lets you skip terminal

If a cycle is detected, the command exits with status 1 and prints the cycle path — fix the offending blocks / depends_on edge and re-run.

order is the “execute in this sequence” view. Pair with blocked:

order → ideal sequence (ignores status)
blocked → what is stuck right now

A healthy workspace: everything in order[0:k] is [active] or [done], and blocked is empty.