← ClaudeAtlas

run-codegenlisted

Runs the deterministic build_runner codegen pass (drift_dev, freezed, json_serializable, riverpod_generator) as one pinned command with --delete-conflicting-outputs, always before flutter analyze, never hand-editing or force-committing generated *.g.dart / *.freezed.dart / *.drift.dart output, watch only in local dev. Use when regenerating codegen, fixing "missing part file" / "conflicting outputs" / undefined generated-class analyzer errors, after editing a drift table or DAO, a freezed value object, a riverpod Notifier or provider, or a json_serializable model, or after a fresh git clone, branch switch, or pull.
zakariaf/CatchLaw · ★ 0 · Code & Development · score 58
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