run-codegenlisted
Install: claude install-skill zakariaf/CatchLaw
# Run codegen (build_runner)
A deterministic, low-freedom runbook: regenerate all annotation-driven code in
one pass, then analyze. Run the pinned command exactly as written — do not
modify it, add flags, or hand-edit generated files. Applies whenever a source
file carries a codegen annotation (`@freezed`, `@JsonSerializable`,
`@riverpod`, `@DriftDatabase`, a drift table) and its `*.g.dart` /
`*.freezed.dart` / `*.drift.dart` part is missing or stale.
## Non-negotiable rules
1. **Run codegen BEFORE `flutter analyze`.** A fresh clone, branch switch, or
freshly edited annotated file has no generated part on disk. Analyzing that
tree produces misleading "missing part file" and undefined-class errors that
describe the missing output, not a real code defect — regenerate, then
analyze.
2. **Use the pinned command verbatim, always with `--delete-conflicting-outputs`.**
Without it, build_runner refuses to overwrite an output it did not write this
run and fails with a wall of "conflicting outputs" text. That is a stale-file
collision, not a bug — do not go hunting for one.
3. **Never hand-edit a generated file.** The next build silently reverts it and
takes your edit with it. Change the annotated source — the drift table, the
freezed class, the Notifier, the ARB — and rerun.
4. **Never `git add -f` a generated file.** Whether generated code is committed
or gitignored is one decision owned by `codegen-and-toolchain`; whichever the
repo chose, never f