Skip to main content

file-generation-workflow

A file-generation workflow has Knot produce project documents from other project documents: PRDs in, plans out; plans in, test outlines out. Where a review knot only appends commentary, a generation knot writes real files into your project — which makes this the workflow that runs your overnight build.

Walk it with your agent. Assumes Knot is set up and a rig is initialised (see Getting Started).

The journey​

1. Ask for a generator role​

"Create a profile called planner — a project-planning agent that turns requirements into phased, actionable plans. Generation runs long, so give it a generous timeout."

Your agent runs knot-create. Generation sessions are longer than reviews; the profile is where the timeout budget lives.

2. Ask for the generation knot​

"Create a planning-loom with a knot prd-planner: for each PRD in project/prds/, ensure a matching plan exists at project/plans/ with phased deliverables. If the PRD and plan are already aligned, change nothing."

Notice how the ask is phrased — what should exist, not which steps to perform. Your agent (guided by knot-design) writes the knot that way: goal-focused, so re-triggering is safe.

What you see: rig/planning-loom/prd-planner.md — wiring only: profile reference, watched directory, one-line intent.

3. Feed it​

"Write a PRD for <feature> into project/prds/ and let the rig work."

The file write triggers the knot. Queue several PRDs, or re-touch an existing one (via knot-dispatch), and walk away — the events wait in the disk-backed queue and process in order.

What you see: project/plans/<feature>.md appears in your tree, committed; the tie-off at tie-offs/rig/planning-loom/ records what the agent did; git log shows one commit per knot run.

4. Let the loop tighten things​

Point a second knot back the other way — e.g. a plan-architect that reads plans and records architecture decisions — and you have a feedback loop: PRD change → plan update → ADR note → plan check… The loop converges because every knot is idempotent: it inspects state, finds the goal already met, and reports "no changes needed". If two knots oscillate instead of converging, ask your agent to apply the loop-breaking patterns (one-way authority, status-gating, strand acknowledgement) — knot-design's material, and knot-manage will spot the oscillation in the tie-offs.

The two design cautions​

  1. Goal-focused, not step-focused. "1. Create the plan file 2. Add phase 0…" duplicates on every re-trigger; "ensure the plan exists and matches the PRD; if it already does, make no changes" converges. This is the whole idempotency story — see knot-design.
  2. One editor per document. If two knots both hold write rights over project/plans/<feature>.md, they will fight. One knot owns each document family; others only read or append observations. knot-lint flags multiple editors as a FAIL.

Where the details live​

  • Profile/knot file formats and timeout fields: the knot-create skill (just ask your agent).
  • Idempotency, loop design, loop breaking: the knot-design skill, summarised in the Design Guide.
  • Long-run reliability (timeouts, compaction, wrap-up steering): Concepts and Troubleshooting.