javascript
Skill1 starsChanged 2 months agoMITView on GitHub
JavaScript rules for projects following the air-gapped, declarative-first architecture. JS is data transport only — it fetches, parses, stores, and injects JSON. It never controls UI state, never manipulates the DOM for presentation, and never uses event listeners. Use whenever writing or reviewing any .js file.
11 other projects use a version of this.
Adopted by
Most recently taken up by
- DaraBoth/skilljmskilltheir own version, first seen Nov 8, 2026
- testdino-hq/google-styleguides-skillstheir own version, first seen Nov 8, 2026
- turkeryildirim/ai-skillstheir own version, first seen Nov 1, 2026
- infiniumtek/code-review-agenttheir own version, first seen Oct 25, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- shreyam1008/shre-skillstheir own version, first seen Oct 9, 2026
Used with
Projects with it also use java and debugging.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
testdino-hqSkilljava
Google's official Java style guide. Covers 2-space indentation, 100-char line limit, naming conventions, braces, imports, Javadoc, exception handling, lambdas, and streams. Enforces @Override annotations and specific imports.
Also in 3 projects that use this
BlockSkilldebugging
Debugging guidelines and best practices
Also in 3 projects that use this
Other versions11 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 11
- SynchronetBBS/sbbs★ 115same name
- G1Joshi/Agent-Skills★ 15same name
- testdino-hq/google-styleguides-skills★ 15same name
- DojoCodingLabs/code-sensei★ 14same name
- infiniumtek/code-review-agent★ 4same name
- turkeryildirim/ai-skills★ 4same name
- wewpellex21/code-sensei★ 3same name
- DaraBoth/skilljmskill★ 2same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- discourse/skills★ 1same name
1 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
We split this skill into the rules it gives an agent
11 rules. 0 are common, 4 are distinctive, and 7 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 31
No other JavaScript files are added without explicit user instruction.
- Distinctive: line 59
No other DOM mutation utilities are added.
- Very specific: line 63
Stateless: No module-level mutable state.
- Very specific: line 88
Never registers event listeners (addEventListener)
- Very specific: line 89
Never reads or writes class, id, or data-* attributes (those don't exist in this architecture's HTML)
- Very specific: line 90
Never injects HTML strings (innerHTML = '<div>' etc.)
- Distinctive: line 91
Never sets inline styles
- Very specific: line 92
Never controls visibility (CSS does that via :empty, :has())
- Distinctive: line 93
Never animates (CSS does that)
- Very specific: line 94
Never tracks UI state in JS variables (state lives in DOM via native checked, open, attributes)
- Very specific: line 95
Never uses eval, Function constructor, or dynamic code generation
“Common” is measured: kept by at least 6 in 10 of the 9 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
JavaScript
JavaScript is data transport only. CRUD against an API. Nothing else.
The only permitted JavaScript responsibilities
- API transport —
fetch()against the configured endpoint base, parsing JSON responses oninputlifecycle — wiring nav radios and form inputs to data fetches via theinputDOM event inoninput.js- Storage — localStorage primary, cookie fallback, in
storage.js - Startup wiring —
console.clear(), programmatic initial nav click, inapp.js - Tour placeholder —
tour.jsreserved for future onboarding logic
Anything else is forbidden.
Only these files exist in assets/js/
assets/js/app.js— entrypoint, startup wiring, console resetassets/js/oninput.js— sharedinputevent lifecycle, binds nav and form inputs, routes API callsassets/js/api.js—fetch(), base URL, endpoint suffix resolution, response parsingassets/js/storage.js— localStorage and cookie utilitiesassets/js/tour.js— placeholder
No other JavaScript files are added without explicit user instruction.
Only these patterns for DOM access
document.querySelector('selector')— the only permitted selector method
Forbidden:
document.getElementById()document.getElementsByClassName()(and there are no classes anyway)document.getElementsByTagName()document.querySelectorAll()is permitted only when iterating a known set; preferquerySelectorchaining- jQuery,
$(), any third-party DOM library
Only these patterns for events
element.addEventListener('input', handler)is forbidden in markup-driven flows. Theinputevent is bound once inoninput.jsvia direct property assignment to the discovered nodes.- The HTML attribute
oninput=and every otheron*=attribute is forbidden in markup. See thehtmlskill. addEventListeneris forbidden anywhere in the project, including inside JS files. Theoninput.jslifecycle uses direct.oninputproperty assignment, which is idempotent.
The reasoning: every event registration is a piece of UI behavior. UI behavior belongs to CSS. The single exception is data transfer triggered by user input, which is the oninput lifecycle.
Only these utilities for unavoidable DOM mutation
The architecture pulls all UI state into CSS. Two utilities exist for cases where CSS cannot reach a particular browser default:
removeInlineStyles(element)— strips any inlinestyleattribute that the browser or a third-party may have insertedclearFieldset(fieldset)— resets a<fieldset>to its empty state for a fresh data render
No other DOM mutation utilities are added. If a need arises, surface it to the user before writing.
Constraints on every function
- Stateless. No module-level mutable state. No
letdeclarations at module scope. - Idempotent. Calling twice produces the same result as calling once.
- No side effects beyond the explicit responsibility (fetching, parsing, injecting data, writing to storage).
- No global state. No
window.foo. No globals.
Lifecycle conventions
- The API base URL is declared once, in
api.js. Only the endpoint suffix varies per page (shell,home,about,products,events,contact). - Initial page load enters the same
oninputlifecycle path via a programmaticelement.click()on the appropriate nav radio. There is no separate "boot" path. - Shell content (header, nav, footer, meta) is fetched and injected once per runtime session, not on every page change.
- Nav radio index maps to page endpoint suffix; the same DOM targets are reused for content injection.
console.clear()runs on startup and on each lifecycle run.
Console policy
- Success: minimal, timestamped, single line.
- Failure: verbose, timestamped, full error context.
console.clear()on startup and on each lifecycle run.
External service failures
When an API call fails (SSL error, network failure, 4xx, 5xx, rate limit), the JS does not retry against a different endpoint, does not redirect to a local fallback, and does not invent data. It surfaces the error to the user with enough detail for them to resolve it. The architecture is never modified to work around external service issues — the user resolves them at the source.
What JavaScript never does
- Never registers event listeners (
addEventListener) - Never reads or writes
class,id, ordata-*attributes (those don't exist in this architecture's HTML) - Never injects HTML strings (
innerHTML = '<div>'etc.) - Never sets inline styles
- Never controls visibility (CSS does that via
:empty,:has()) - Never animates (CSS does that)
- Never tracks UI state in JS variables (state lives in DOM via native
checked,open, attributes) - Never uses
eval,Functionconstructor, or dynamic code generation
Baseline & support
Checked against MDN as of 2026-07-16.
fetch— Baseline Widely available — https://developer.mozilla.org/en-US/docs/Web/API/Window/fetch- ES modules (
import/export) — Baseline Widely available — https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import console.clear()— Baseline Widely available — https://developer.mozilla.org/en-US/docs/Web/API/console/clear_static
Canonical rules: https://github.com/Autocss-com/ai/blob/main/AGENTS.md
References
references/lifecycle.md— the canonicaloninputflow from input event to data injectionreferences/api.md— fetch, base URL, suffix, error handlingreferences/storage.md— localStorage and cookie patternsreferences/forbidden.md— full list of forbidden patterns with reasoning- MDN JavaScript: https://developer.mozilla.org/en-US/docs/Web/JavaScript
- MDN Fetch API: https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API
- ECMAScript spec: https://tc39.es/ecma262/
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.

