run-codegen

run-codegen is a skill for Claude Code, Codex from zakariaf/Flutter-Skills. It costs 142 tokens per session (1,726 once invoked), scanned A, original, MIT.

A fixed procedure for regenerating Dart and Flutter code produced from source annotations. Code generation creates supporting files automatically for features such as data models, JSON conversion, database definitions, and Riverpod state providers.

In plain words
What is it for?
Use it after changing annotated Flutter/Dart code, switching branches, or cloning a project, before running Flutter’s code checks.
Why use it?
It avoids misleading analysis errors caused by missing or outdated generated files. It also prevents manual edits to files that the next generation run would replace.

Skill for Claude CodeCodex

Part of the flutter plugin — 40 skills shipped together

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.

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

Made for: Claude Code, Codex.

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 run-codegen

README.md
[![agentmods](https://agentmods.dev/badge/skills/zakariaf/flutter-skills/run-codegen.svg)](https://agentmods.dev/skills/zakariaf/flutter-skills/run-codegen)
Your own site
<a href="https://agentmods.dev/skills/zakariaf/flutter-skills/run-codegen"><img src="https://agentmods.dev/badge/skills/zakariaf/flutter-skills/run-codegen.svg" alt="Measured on agentmods" height="20"></a>
Per session 142 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,726 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00142 $0.01726
Opus 5 $0.00071 $0.00863
Sonnet 5 $0.00028 $0.00345
Haiku 4.5 $0.00014 $0.00173

Measured 3d ago against content hash db142adb502b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

run-codegen 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 3d ago.

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/run-codegen/SKILL.md · 149 lines

How it starts

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

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 force-add an artifact past the ignore rules or commit one the current source would not reproduce.
  5. watch is a local-dev convenience, never CI or a pre-commit hook. CI and the pre-analyze step always use the one-shot build.
  6. Fix hand-written source first. The generator reads a resolved AST; it cannot generate from source that does not analyze. An unrelated error anywhere in lib/ can block generation of a table or provider — clear those before blaming codegen.

The canonical command

Read the full file on GitHub · 149 lines

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. 3d ago First seen · 149 lines · 142 tokens per session scan A db142adb502b

Subscribe to this mod's changes

run-codegen is a skill published in the GitHub repository zakariaf/Flutter-Skills (2 stars, last pushed 5d ago), licensed MIT. It adds 142 tokens to every session and 1,726 once invoked, about $0.0007 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.

Related

Other skills, from other repositories

build-teaql-app

Build or change a TeaQL application in Java, Rust, Go, Swift, Python, C#/.NET, or TypeScript, including Kotlin/JVM applications that consume Java-generated libraries. Mandatory order: first draft and save a complete KSML model, then verify the client and evaluate that saved model, repair it through repeated evaluation…

teaql/teaql-agent-kit · 112 tokens

common-feedback-reporter

Pre-write audit for skill violations: checks planned code against loaded skill anti-patterns before any file write. Use when writing Flutter/Dart/TS code or editing SKILL.md files with active project skills. Load as composite; on auto-fixed violation, also load +common/common-learning-log.

HoangNguyen0403/agent-skills-standard · 63 tokens

common-store-changelog

Generate user-facing release notes for the App Store and Google Play from git history (App Store <=4000 chars, Google Play <=500). Use when generating release notes, app store changelog, play store release, or "what's new" text for a mobile app.

HoangNguyen0403/agent-skills-standard · 60 tokens

common-mobile-visual-testing

Standardizes mobile UI audits, performance/scroll checks, RTL verification, and state-specific testing on iOS/Android.

HoangNguyen0403/agent-skills-standard · 30 tokens

quality-engineering-appium-mcp

Drives iOS/Android mobile devices via Appium MCP. Use for verifying mobile bugs, E2E tests, and navigating real device clouds (LambdaTest/BrowserStack).

HoangNguyen0403/agent-skills-standard · 44 tokens

flutter-idioms

Flutter Riverpod 3, freezed, gorouter, const widgets, repository pattern.

irahardianto/awesome-agv · 22 tokens