R173 · Agent principles and patterns › Workflows over agents

Codemod Workflow v2: the migration workflow becomes a TypeScript program

Read the original

Authors Dev Agrawal, Alex Bit (shared)

workflowscode-migrationdurable-executionvendor

Sources: Alex Bit (Codemod CEO) on LinkedIn, resharing Dev Agrawal's announcement; Dev Agrawal, "Your migration workflow is a program, so we made it one", codemod.com blog, 2026-11-18. Vendor content: the product is Codemod's own, and the release is an alpha.

The claim in one paragraph

In large code migrations the rewrite rules are rarely the hard part. The hard part is deciding when to run them: whether a project needs the migration at all, which files each group of rules should touch, and when to stop and ask before rewriting. Codemod's Workflow v2 makes those decisions part of the workflow by making the workflow a TypeScript program (workflow.ts) instead of YAML plus a launcher script. The pitch is aimed at agent-driven migrations: agents can already write transforms, and what they need is a workflow engine that can gate, scope and resume them reliably.

What changed, using their worked example

The example is a Solid 1.9 to Solid 2 migration assistant: 44 read-only analysis rules and 9 rewrites, run against Tasks.md, an open-source Solid task board.

ConcernBefore (v1)After (v2)
Where the logic lives953 lines across two YAML files, plus a Node launcher that read dependenciesDependency checks and rule selection in workflow.ts
Should this run at allLauncher reported dependency issues before calling the workflowWorkflow skips projects that don't depend on solid-js and stops on ones already on Solid 2
Which filesEvery rule ran on the same file setEach stage picks its own files; on Tasks.md the store rules ran on 1 of 20 source files and the router rules on 2
When to askOutside the workflowMigrate mode pauses for approval when a dependency has no known Solid 2 release; analyze mode only reports and never edits

The post is candid that YAML already supported conditions, approvals and file selectors. The change is where the decisions live: next to the steps, in a language that can compute them from earlier results.

Architecture worth noting

Tradeoffs

Failure modes to expect

Review checklist for a v2 migration workflow

  1. Is there a reason this is a program and not a standalone transform or YAML (does a step's result change what runs next)?

  2. Is decision code deterministic given cached step results, so resume reproduces the same plan?

  3. Are analyze and migrate modes separated, with rewrites possible only in migrate mode?

  4. Does every approval gate state what blocked it and what will change after approval?

  5. Is per-stage file selection tested against files that should and should not match?

  6. When porting, were the v1 and v2 runs compared on the same starting revision, both the source diff and the findings report?

  7. Is the CLI version pinned and the shared-state API usage checked against the migration guide?

Cited in field guides

Connections

See R173 on the knowledge map

Part of the Research notes on nowucca.com. Figures and claims are the source's own unless the summary says otherwise.