ui-boot
Skill0 starsChanged 2 months agoMITView on GitHub
Get a no-build-step MapLibre app to start in the right order - vendored globals with defer, a module entry point that cannot race them, and why the vendor files are self-hosted. Use when setting up index.html, adding a third-party library, or debugging "X is not defined" at startup.
In this repository15 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- app-adoptSkill
- app-contributeSkill
- app-startSkill
- app-upgradeSkill
- app-verifySkill
- map-cameraSkill
- map-controlsSkill
- map-popupsSkill
- repo-maintainSkill
- ui-furnitureSkill
- ui-iconsSkill
- ui-stowSkill
- ui-themeSkill
- ui-windowSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 28
Do not wrap the app in window.addEventListener('load', ...).
- Distinctive: line 30
Do not poll for the global.
- Very specific: line 31
Do not move the vendor script into the module with a dynamic import().
- Distinctive: line 45
One origin: No third-party DNS, no third-party TLS, nothing to be slow or down.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Boot order
A MapLibre app with no bundler has exactly one ordering problem, and it is solved by two
attributes in app/index.html.
The rule
<script defer src="vendor/maplibre-gl.js"></script>
<script type="module" src="js/main.js"></script>A classic script with defer runs after the document parses, in document order. A
type="module" script is always deferred, and modules execute after deferred classic
scripts. So by the time main.js runs, maplibregl exists. No load event, no polling, no
DOMContentLoaded wrapper, no bundler.
Get this wrong and the symptom is maplibregl is not defined, intermittently, usually only on
a fast connection or only on a slow one.
What NOT to do about it
- Do not wrap the app in
window.addEventListener('load', ...). It works, and it costs you the ability toawaitat module top level, which is where configuration loading belongs. - Do not poll for the global.
- Do not move the vendor script into the module with a dynamic
import(). UMD bundles that assign towindowdo not always survive that.
The one thing that must go before both
Theme restoration. It is an inline blocking script in <head>, and it has to be blocking,
because anything deferred runs after first paint and the reader sees a flash. See
ui-theme.
Self-hosting
app/vendor/ holds pinned copies rather than CDN links. Three reasons, in order of how often
they matter:
- One origin. No third-party DNS, no third-party TLS, nothing to be slow or down.
- Nothing changes without a commit. A CDN version range can move under you; a file in the repo cannot.
- Supply chain. What you reviewed is what ships.
app/vendor/README.md records the project, version and licence of everything in there. Update
it in the same commit as the file, or it stops being true.
Checklist for adding a library
- Copy the built file into
app/vendor/, pinned to a version. - Add a row to
app/vendor/README.md: project, version, licence. - Add
<script defer src="vendor/...">BEFORE the module entry point. - Declare the global in
types/globals.d.ts, ortsc --noEmitwill not know it exists.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

