codegen-and-toolchain

codegen-and-toolchain is a skill for Claude Code from zakariaf/Flutter-Skills. It costs 224 tokens per session (2,356 once invoked), scanned A, original, MIT.

A build and code-generation workflow for Flutter and Dart packages. Code generation creates source files automatically from annotations or other definitions.

In plain words
What is it for?
Running code generation before analysis, limiting it to relevant files, managing generated files in version control, and checking the toolchain in CI.
Why use it?
It avoids analyzing missing or outdated generated files and keeps generator scope, SDK versions, and generated-file handling consistent.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin.

Part of the flutter plugin — 40 skills shipped together

Good fit Running code generation before analysis, limiting it to relevant files, managing generated…

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/zakariaf/flutter-skills/codegen-and-toolchain
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add zakariaf/Flutter-Skills --skill codegen-and-toolchain
Clone the repo
git clone --depth 1 https://github.com/zakariaf/Flutter-Skills

Made for: Claude Code.

Or install flutter, the plugin that ships this one along with the rest of its 40 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for codegen-and-toolchain

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/codegen-and-toolchain.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/codegen-and-toolchain)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/codegen-and-toolchain"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/codegen-and-toolchain.svg" alt="Measured on agentmods" height="20"></a>
Per session 224 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,356 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00224 $0.02356
Opus 5 $0.00112 $0.01178
Sonnet 5 $0.00045 $0.00471
Haiku 4.5 $0.00022 $0.00236

Measured 6d ago against content hash a937e9e27b17, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

codegen-and-toolchain scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

The scan reads SKILL.md. This mod also ships 2 executable files (scripts/check-codegen-hygiene.sh, scripts/regen.sh), listed below but not scanned — reading those needs a real analyzer, not pattern matching.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/codegen-and-toolchain/SKILL.md · 192 lines

How it starts

The opening of the file, as written. The whole thing — 192 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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 takes your edit with it. Change the annotated source and rerun codegen.
  4. Scope every builder with generate_for: in a per-package build.yaml. A change in one directory must not regenerate the whole tree. Point each glob at the narrowest directory that owns the annotation.
  5. Decide commit-vs-gitignore ONCE, back it with the matching CI gate. Gitignored → CI regenerates first, before analyze. Committed → CI regenerates then runs git diff --exit-code as a freshness gate. Either is valid; a policy without its gate is not (see references/commit-vs-gitignore.md).
  6. Mirror generated-file globs into the analyzer AND coverage excludes. A glob that lints machine output wastes review; a glob missing from lcov inflates coverage. Exclude the emitted suffix — verify it, do not guess.
  7. Pin the SDK; local must equal CI. The CI Flutter/Dart version must match the pinned local version (.fvmrc under FVM, or the tool the repo standardizes on). A drift here reproduces "works on my machine" format/codegen churn.
  8. watch is a local edit-loop tool only. CI and the pre-analyze step always use the one-shot build command.

Read the full file on GitHub · 192 lines

Files

What ships with it

7 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 192 lines · 224 tokens per session scan A a937e9e27b17

Subscribe to this mod's changes

codegen-and-toolchain is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 8d ago), licensed MIT. It adds 224 tokens to every session and 2,356 once invoked, about $0.0011 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.