CodyCody

Authoring workflows

Design guidelines

Eight rules for workflows that produce auditable results, terminate, and survive being run by an agent that remembers nothing between steps.

  1. One job per instruction step. "Scan and fix and verify" as one prompt produces unauditable results. Split into scan → fix → verify so each result is recorded, retryable and usable in templates.
  2. Specify the output contract in every prompt. Later steps only see what the agent puts in output. Show the exact JSON shape you expect.
  3. Decisions: closed label set, a default branch, allowSummaryFallback: false.
  4. Gate before anything irreversible.
  5. Verify, don't trust. After a fix step, add a verification step — re-run the tests via shell — and a decision on the result. For shell output a later step depends on, use captureToFile with verifyHash, and have that later step re-check the file.
  6. Bound your loops. Task loops terminate via EMPTY; retry loops need a counter in set_variable and a decision that exits after N attempts.
  7. Write the description for discovery. It is what an agent reads in ccw_list when deciding what to run. Same for inputSchema: use enum, default and required so callers construct valid input.
  8. Compose via sub-workflows when a fragment is independently useful or the graph exceeds about fifteen steps. Publish bottom-up.