codegen-and-toolchainlisted
Install: claude install-skill zakariaf/CatchLaw
# Codegen and toolchain
One deterministic codegen pass is the source of truth for every generated file;
run it first, scope it tightly, and decide once whether its output lives in git.
Applies whenever a project uses `build_runner` or `gen-l10n`.
Read the reference for the task at hand:
- `references/codegen-scoping.md` — the generator inventory, `generate_for:`
scoping tables, error-to-fix recovery map.
- `references/commit-vs-gitignore.md` — the two committed/gitignored strategies,
their tradeoffs, and the exact CI gate each one requires.
- `references/toolchain-and-workspace.md` — SDK pinning, analyzer/coverage
excludes, and the multi-package workspace layering (fenced, opt-in).
Run `scripts/regen.sh` (codegen → format → analyze) before a PR, and
`scripts/check-codegen-hygiene.sh` to verify excludes and commit-policy parity.
## Non-negotiable rules
1. **Codegen runs FIRST, before `flutter analyze`.** Generated files may be
absent on a fresh clone or stale after editing an annotation. Analyzing that
tree emits misleading "missing part file" and "undefined class `_$Foo`"
errors. Regenerate, then analyze — never chase the symptom at the call site.
2. **Always pass `--delete-conflicting-outputs`.** Without it `build_runner`
refuses to overwrite an output from a renamed/deleted source and fails with a
wall of "conflicting outputs" text. That is not a bug to investigate.
3. **Never hand-edit a generated file.** The next build silently reverts it and