Use when CI fails in flutter_rust_bridge - before deep investigation
59
67%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Fix and improve this skill with Tessl
tessl review fix ./.claude/skills/frb-fix-ci/SKILL.mdNote: Check your user-level
remote-testingrules before running commands. Tests and codegen may require remote execution. Note: When reproducing FRB failures remotely, do not run multiple remote commands in parallel against the same workspace/container. Serialize them unless you have isolated workspaces.
CI failures in flutter_rust_bridge often have simple fixes. Try the appropriate approach below before deep investigation.
Core principle: Start with lazy fixes (re-run, copy diff, --fix) before expensive investigation.
If the CI failure or PR state is caused by merge/rebase conflicts, especially conflicts in generated files after master and a PR both added tests or APIs, read the /frb-fix-merge-conflict skill before resolving them.
Use this order before diving into individual failure types:
./frb_internal ... command from CI, but first check your user-level remote-testing rules instead of assuming local execution is correct.
If reproducing remotely, keep one remote workspace single-writer: do not run multiple FRB reproduction commands in parallel against that same workspace.
Also do not trust a dirty remote workspace by default: FRB remote runs often leave stray generated or untracked files behind, so prefer git reset --hard HEAD && git clean -fdx before a meaningful reproduction.Generate, Integrate, or a high-relevance Generate Internal stage) or a downstream symptom (Build :: Flutter, native tests)?Do not answer from stale CI state. Read the latest relevant run or job information first.
When CI feedback is slow and only one job family matters for the current investigation, read frb-ci-filter before using ci_filter, the ci-manual-dispatch label, or related workflow configuration.
| Symptom | Fix |
|---|---|
| Flaky test (passes sometimes) | gh run rerun --failed |
| Git diff shown in CI | git apply OR regenerate |
| Lint/format errors | Add --fix flag |
| Can't reproduce locally | Use same ./frb_internal command from CI, following remote-testing rules |
When several related jobs are failing, use this dependency graph instead of treating all failures as peers:
Legend: rectangles are files or directories. Ovals are CI operations. In each oval, the first line is the CI job name and the second line in parentheses is the corresponding ./frb_internal ... command when there is one.
flowchart LR
CodegenSources["frb_codegen/src/** + codegen config"]
Versions["pinned Flutter / Dart / Rust versions"]
Templates["frb_codegen/assets/integration_template/**"]
Cargokit["cargokit"]
PureDart["frb_example/pure_dart/**"]
GeneratedOutputs["frb_example/**/frb_generated.*"]
PureDartGenerated["frb_example/pure_dart/**/frb_generated.*"]
ExampleOutputs["integrate outputs under frb_example/**"]
PureDartPde["frb_example/pure_dart_pde/**"]
PureDartPdeGenerated["frb_example/pure_dart_pde/**/frb_generated.*"]
NativeTests(["Test :: Flutter :: Native::*\n(./frb_internal test-flutter-native ...)"])
Generate(["Generate :: FRB Codegen :: Command Generate\n(./frb_internal generate-run-frb-codegen-command-generate)"])
Integrate(["Generate :: FRB Codegen :: Command Integrate\n(./frb_internal generate-run-frb-codegen-command-integrate)"])
Build(["Build :: Flutter\n(./frb_internal build-flutter ...)"])
subgraph GenerateInternal["Generate Internal stages"]
GenerateInternalPureDart(["Generate Internal :: frb_example pure_dart chain\n(./frb_internal generate-internal-frb-example-pure-dart)"])
GenerateInternalRust(["Generate Internal :: Rust\n(./frb_internal generate-internal-rust)"])
GenerateInternalOther(["Other internal stages\n(book-help / dart-source /\nbuild-runner / contributor / readme)"])
end
CodegenSources -->|used by| Generate
Versions -->|used by| Generate
Generate -->|writes| GeneratedOutputs
CodegenSources -->|used by| GenerateInternalPureDart
Versions -->|used by| GenerateInternalPureDart
PureDart -->|read by| GenerateInternalPureDart
GenerateInternalPureDart -->|rewrites| PureDart
GenerateInternalPureDart -->|derives| PureDartPde
GenerateInternalPureDart -->|writes| PureDartGenerated
GenerateInternalPureDart -->|writes| PureDartPdeGenerated
CodegenSources -->|used by| GenerateInternalRust
Versions -->|used by| GenerateInternalRust
Versions -->|used by| GenerateInternalOther
CodegenSources -->|used by| Integrate
Versions -->|used by| Integrate
Templates -->|used by| Integrate
Cargokit -->|used by| Integrate
Integrate -->|writes| ExampleOutputs
GeneratedOutputs -->|consumed by| Build
GeneratedOutputs -->|consumed by| NativeTests
PureDartGenerated -->|consumed by| Build
PureDartPdeGenerated -->|consumed by| Build
ExampleOutputs -->|consumed by| Build
ExampleOutputs -->|consumed by| NativeTestsRead the graph as artifact and input dependencies, not as a literal GitHub Actions job graph.
frb_codegen/assets/integration_template/ + cargokit -> integrate outputs under frb_example/**
If Flutter integrate examples, example platform files, Build :: Flutter, and native Flutter tests regress together, suspect these template inputs first. Do not hand-edit generated example outputs. If the bug is actually inside the embedded cargokit submodule, it is acceptable to edit that submodule directly and push to fzyzcjy/cargokit, then update the submodule ref.create/integrate does not reproduce checked-in Apple files such as .metadata iOS stanzas, ios/**, example/ios/**, macos/Podfile, or Apple-specific pubspec.yaml fragments, do not treat that as proof the checked-in files are wrong. In this repo, checked-in mac-generated Apple scaffold may be the source of truth, and Linux integrate may explicitly apply it before diff comparison.Generate Internal + frb_example/pure_dart/** -> frb_example/pure_dart_pde/**
If pure_dart_pde is failing, do not only refresh pure_dart_pde. First check whether ./frb_internal generate-internal-frb-example-pure-dart --set-exit-if-changed ... is still changing frb_example/pure_dart.Use this graph when several nearby categories start failing together in the same run, especially when earlier nodes such as Generate, Integrate, or the high-relevance Generate Internal stages are already red and later failures look consistent with missing, stale, or mismatched generated files or platform files.
Prefer fixing prerequisite nodes before symptom nodes. If a prerequisite node is still unstable, treat later failures as propagated symptoms until proven otherwise. If this pattern keeps repeating across multiple commits or CI runs, jump to Whack-a-Mole Prevention.
This section is about history across multiple commits or CI runs, not a single failing job.
Use it when the same area keeps becoming green and then red again, especially with commits like refresh, regenerate, sync, and revert.
What this usually means:
What to do:
frb_codegen/src/**, frb_codegen/assets/integration_template/**, pinned Flutter/Dart/Rust versions, generation order, or package relationshipGenerate sync commits with very similar generated Dart drift in one session or across adjacent CI runs, stop the package-by-package loop and escalate to a clean remote ./frb_internal precommit-generateCommon FRB patterns:
frb_codegen/assets/integration_template/ and cargokit; do not hand-edit generated example outputs. If the real fix belongs in cargokit, patch the submodule and update its ref instead of only patching copied outputs.pure_dart and pure_dart_pde:
if both are moving, stabilize frb_example/pure_dart first and treat pure_dart_pde as a dependent outputGenerate failures across different example packages:
if the same Generate :: FRB Codegen :: Command Generate symptom keeps rotating across packages with similar generated Dart diffs, stop fixing one package at a time. Re-run clean remote ./frb_internal precommit-generate and treat that full run as the source of truth for the whole Generate chain. Only after that full run stabilizes should you accept any remaining per-package tail diff.
Practical cutoff:
after two similar package-level sync fixes, the burden of proof switches. Do not add a third similar package sync until you have checked whether clean remote precommit-generate collapses the whole diff surface.Trigger this protocol if both are true:
Generate :: FRB Codegen :: Command Generate family across the current session or adjacent CI runsfrb_generated.dart, frb_generated.io.dart, frb_generated.web.dart, generated API wrapper files, or nearby formatting/layout churn, with no evidence yet of a package-specific semantic bug or hand-written file changeThen do this, in order:
./frb_internal precommit-generateprecommit-generate as the authoritative Generate source and debug the shared generation workflow before touching more package-level symptomsExample:
dart_minimal, then rust_ui_counter--ui, then gallery fail in separate Generate jobs with similar generated Dart drift, stop after the second one and escalate to clean remote precommit-generateSometimes CI fails due to timing issues, not real bugs. Rerun only failed jobs:
gh run rerun --failedIf it passes on retry -> flaky, not your bug.
When CI shows a diff, you have two options:
Option A: git apply (faster)
CI already ran the generator. Just apply what it computed:
# Copy the diff from CI, then:
pbpaste | git apply # macOSOption B: Regenerate (slower but more "proper")
./frb_internal precommit-generateAfter codegen: Check your user-level
remote-testingrules. If codegen was run remotely, pull changes back to local.
Both are correct. Option A is faster; Option B is more thorough.
Do not hand-edit generated files as the final fix.
You may use CI diffs only as a diagnosis aid to understand what changed, but the final accepted output should come from re-running the appropriate generation workflow in a clean matching environment.
CI shows the command it ran. Before running it, check your user-level remote-testing rules to determine whether this repo requires remote execution.
Before reproducing, make sure the toolchain versions match CI closely enough to be meaningful. In practice this usually means Flutter, Dart, Rust, cargo subcommands, and any pinned template or helper dependency should match the versions used by CI.
If reproducing remotely, clean the remote workspace first unless you have a specific reason not to. In FRB this often matters because old generated files and untracked outputs can survive earlier runs and create fake diffs:
git reset --hard HEAD && git clean -fdxThen run the same command:
# CI shows: ./frb_internal test-dart --package frb_example/pure_dart
./frb_internal test-dart --package frb_example/pure_dartFor clippy, dart analyze, or format errors, use --fix:
./frb_internal lint --fixThis runs:
cargo clippy --fix - Rust lint fixescargo fmt - Rust formatdart format - Dart formatdart fix --apply - Dart auto fixesWhen lint/format failures happen on generated files, do not default to hand-editing those files just to match formatter output.
Instead:
Command Integrate FailuresWhen Generate :: FRB Codegen :: Command Integrate fails because integrated output is wrong, do not hand-edit the generated integrate example outputs.
Instead:
frb_codegen/assets/integration_template/cargokit submodule, fix and push fzyzcjy/cargokit, then update the submodule refSpecial case: Apple scaffold
create/integrate drops checked-in Apple files, do not describe the current fix as "restoring old scaffold" unless it really is an accidental workaround.If CI previously failed mainly in Generate while other jobs passed, and after accepting generated changes additional non-Generate jobs start failing, treat this as strong evidence that the accepted generated outputs are incorrect or incomplete.
In that situation:
Generate regressionsIf the symptom is not one package but a sequence of packages failing with very similar generated Dart drift, prefer validating clean remote ./frb_internal precommit-generate before accepting more package-by-package sync commits.
If clean remote precommit-generate reduces the remaining diff surface to one small tail package, accept that tail from the same clean run and rerun CI. Do not go back into a long per-package loop unless a new failure class appears.
When Test :: Dart :: Web (...) fails after the web build and server startup already succeeded, and the failure is:
Exception: Websocket url not found.treat it as a likely browser / puppeteer startup flake first, not an immediate code regression.
In that situation:
dart compile js, and local web server startup already succeededgit apply first when CI provides a diffGeneratefrb_codegen/assets/integration_template/cargokit submodule changes are off-limits when the real bug is thererefresh/regenerate/sync diffs without re-checking the upstream generation inputsGenerate sync commits after two similar generated Dart drifts, instead of escalating to clean remote precommit-generateci-manual-dispatch and rerun normal CI before treating the PR as readyfrb-code-generation - Which generation commands to runfrb-debugging - Deep debugging when simple fixes don't work1d5348b
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.