AI didn't kill code generators. It made them better.

Generators are not obsolete now that agents can scaffold code. Keep the deterministic parts deterministic: encode your project structure once, then let the agent invoke it.
I point Claude at a pnpm workspace and have it use the Nx Devkit to extract the current project into a local workspace generator, then run that generator to scaffold new libraries, both from the terminal and by asking Claude to do it.
-
🔗 Links:
-
Local generators: https://nx.dev/recipes/generators/local-generators
-
Nx Devkit API: https://nx.dev/nx-api/devkit
-
📖 Chapters:
-
00:00 Monorepos and AI agents
-
00:41 Why Nx has generators
-
00:57 Are generators obsolete?
-
01:19 Combine AI with deterministic steps
-
01:58 Local generators, Nx Devkit
-
02:12 Prompting Claude to extract one
-
03:20 What Claude produced
-
04:00 EJS templates in workspace-tools
-
04:21 Running the generator
-
04:57 Letting the agent invoke it
-
05:38 nx configure ai-agents
-
06:02 Wrap up