Flutter3d generated output

From pleiondev/flutter3d · View interactive version

Flutter3d generated output is an AI agent skill from the GitHub repository pleiondev/flutter3d. Use when editing a generator or a file a generator wrote — anything a tool produces is regenerated in CI and diffed against what is committed, and every one of those steps has been wrong at least once.

How to use this skill

Skill file

Anything a tool produces is regenerated and diffed

The committed artefact is not the source of truth; the generator is. So CI runs

the generator and compares. If the diff is not empty, the committed thing is not

the thing the generator makes any more, and one of the two has to move.

The steps, in the order tool/ci.sh runs them:

| What | How it is checked |

|---|---|

| Application icons | python3 tool/check_icons.py |

| Template models and dungeon models | make_models.py, then a diff |

| Level documents, tracks and templates | flutter3d_editor_core's tool/regenerate_levels.dart, then a diff of apps |

| The WebGL shader table | flutter3d_webgl/tool/generate_shaders.dart, then a diff |

| Shader bundles | built here rather than committed, and a test asserts it happened |

Each of these is a fix for something that actually went wrong

The icons were compared by a make_icons.py && git diff pair whose

pathspecs named directories with a * in them — which in git matches the

directory and nothing inside it, so it compared three files out of forty-three.

Then it compared bytes, which Pillow's per-platform LANCZOS does not reproduce

across operating systems. Hence a script rather than a diff.

The levels were the gap ARCHITECTURE.md claimed did not exist. §13 said

anything a tool produces is regenerated and diffed; the icons, the models and

the WebGL table were, and the Python generators that write every level document

in the repository were not, with their outputs tracked.

And then the hand-kept list of those generators went stale, which is why there

is no list any more: it named six and said all six were byte-reproducible, when

there were twelve and two had never been run there at all.

tool/regenerate_levels.dart in flutter3d_editor_core reads generatedBy out

of the documents themselves, so a new level is covered the day it is committed.

The generators are Dart now; a document keeps naming the Python script that

first wrote it, because the name is part of its digest, and

tool/levels/shipped.dart maps each name to its function.

The pathspec, again. apps and not apps/*/assets, because a wildcard in

the middle of a path matches nothing here — so the diff passed whatever the

generators wrote. A check that cannot fail is worse than the stale list it

replaced. It was found by breaking a generator and watching the step stay green.

The WebGL table had "there is no check that this file is current" in its own

header, and when somebody finally regenerated it, it was holding a sky shader

from before the sky was rewritten. The browser was drawing a different sky from

Impeller and no test could see it.

The shader bundle is gitignored on purpose: its format is tied to the

Flutter version, so a committed one would be stale for anybody on a different

SDK and would hide the need to rebuild. A test asserts it was built —

deliberately a failure rather than a skip, because "CI built only one bundle" is

one of the traps that test exists to catch.

Two things to carry away

A generated file that reaches a published archive has to be regenerated by the

publisher, not by the consumer, and .gitignore reaches into pub publish —

pub drops ignored files from the archive. Two releases of flutter3d_impeller

shipped without their shader bundle for exactly that reason.

And when you add a generator: break it once and confirm the step goes red. Every

failure listed above was a step that was running, passing, and looking at

nothing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.