javascript
Skill0 starsChanged 48 days agoMITView on GitHub
Implements or debugs JavaScript/TypeScript language behavior, async work, data transformations, and runtime memory. Use for JS/TS logic issues; React rendering and UI design have separate workflows.
We split this skill into the rules it gives an agent
15 rules. 0 are common, 3 are distinctive, and 12 are very specific to this project.
0
Common
Most of the 9 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Use ===/!==; avoid == (coercion surprises).
- Very specific: line 15
Prefer pure functions and immutable updates ({...obj}, [...arr], .map/.filter/.reduce) over in-place mutation of shared data.
- Very specific: line 17
Use modules (import/export).
- Very specific: line 18
Prefer for...of / array methods over index loops.
- Very specific: line 22
Prefer async/await; always handle rejection (try/catch or .catch).
- Very specific: line 23
Run independent work concurrently with Promise.all.
- Distinctive: line 24
Never leave a floating promise where errors matter — await it or explicitly handle it.
- Very specific: line 25
Don't mix await inside a forEach (it won't wait).
- Very specific: line 42
Prefer copying array methods (toSorted, toReversed, toSpliced, with).
- Very specific: line 43
Use Intl for dates/numbers/currency formatting, not hand-rolled string math.
- Distinctive: line 47
Don't allocate in hot loops.
- Very specific: line 50
Remove event listeners/observers/timers on teardown to avoid leaks.
- Very specific: line 51
Use WeakMap for object-keyed metadata that must not retain its keys.
- Very specific: line 55
Keep strict on; avoid any — use unknown and narrow.
- Distinctive: line 62
Prefer the platform/standard library before adding a dependency.
“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
Modern JS is expressive and fast — most footguns come from async handling, mutation, and equality/coercion surprises. Prefer clarity and immutability; let the engine optimize.
Language baseline
constby default,letwhen reassigning, nevervar.- Use
===/!==; avoid==(coercion surprises). Know thatNaN !== NaN(useNumber.isNaN). - Prefer pure functions and immutable updates (
{...obj},[...arr],.map/.filter/.reduce) over in-place mutation of shared data. - Optional chaining
?.and nullish coalescing??(distinct from||, which also catches0/""). - Use modules (
import/export); no global leakage. Keep imports at the top. - Prefer
for...of/ array methods over index loops;Map/Setover object-as-dict for dynamic keys.
Async done right
- Prefer
async/await; always handle rejection (try/catchor.catch). - Run independent work concurrently with
Promise.all; usePromise.allSettledwhen partial failure is acceptable. - Never leave a floating promise where errors matter — await it or explicitly handle it.
- Don't mix
awaitinside aforEach(it won't wait). Usefor...ofwithawait, or map to promises +Promise.all. - Cancel stale fetches and signal-aware event listeners with
AbortController. Cancel timers withclearTimeout/clearInterval(or an explicit signal-aware wrapper).
// parallel, not serial
const [user, posts] = await Promise.all([getUser(id), getPosts(id)]);
// cancellable fetch
const ac = new AbortController();
const res = await fetch(url, { signal: ac.signal });Data & correctness
- Validate/parse external data at the boundary (a schema lib like Zod, or explicit checks) — don't trust shapes.
- Keep untrusted text out of code/HTML sinks: prefer
textContent; sanitize rich HTML with a reviewed sanitizer beforeinnerHTMLorinsertAdjacentHTML. ATrustedHTMLvalue is safe only if its policy actually validates/sanitizes input; the type alone does not sanitize. Avoidevaland string-form timers. Enforce Trusted Types with CSP where feasible. - Beware floating-point money math; use integer minor units or a decimal lib.
- Prefer copying array methods (
toSorted,toReversed,toSpliced,with); copy-then-mutate only for compatibility. UsestructuredCloneonly for cloneable values and handleDataCloneErrorat untrusted boundaries. - Use
Intlfor dates/numbers/currency formatting, not hand-rolled string math.
Performance & memory
- Don't allocate in hot loops; hoist constants and reused objects out.
- Debounce/throttle high-frequency events (scroll, resize, input); use
requestAnimationFramefor visual updates. - Offload heavy CPU work to a Web Worker to keep the main thread responsive (see
web-performanceandwasm-rust). - Remove event listeners/observers/timers on teardown to avoid leaks; detached DOM nodes held by closures leak.
- Use
WeakMapfor object-keyed metadata that must not retain its keys. ReserveWeakReffor recomputable, best-effort values—collection timing is deliberately nondeterministic.
TypeScript (when present)
- Keep
stricton; avoidany— useunknownand narrow. Type the boundary, infer internally. - Model invalid states out of existence with unions; use exhaustive
switchwith aneverdefault. - Explicit return types on exported functions; avoid unsafe assertions (
as).
Tooling hygiene
- Lint + format (ESLint + Prettier/Biome) and run in CI.
- Prefer the platform/standard library before adding a dependency; check bundle cost.
Reference
- MDN JavaScript reference; "JavaScript guide".
GoogleChrome/modern-web-guidance-src(JS/DOM guides).- MDN:
AbortController, copying array methods,WeakMap/WeakRef,innerHTML, and Trusted Types CSP. - TC39 proposals; "You Don't Know JS" (Kyle Simpson); web.dev performance guides.
Other versions9 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 9
- SynchronetBBS/sbbs★ 111same name
- G1Joshi/Agent-Skills★ 15same name
- DojoCodingLabs/code-sensei★ 14same name
- infiniumtek/code-review-agent★ 4same name
- turkeryildirim/ai-skills★ 4same name
- wewpellex21/code-sensei★ 3same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- Autocss-com/ai★ 1same name
- discourse/skills★ 1same name
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.
Used alongsideProjects with it also use architecture.
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.
AnthropicSkillarchitecture
Create or evaluate an architecture decision record (ADR). Use when choosing between technologies (e.g., Kafka vs SQS), documenting a design decision with trade-offs and consequences, reviewing a system design proposal, or designing a new component from requirements and constraints.
Also in 3 projects that use this
In this repository21 other files it gives its agents.
- ask-dont-assumeSkill
- browser-devtoolsSkill
- cachingSkill
- code-qualitySkill
- cssSkill
- database-guardrailsSkill
- gitSkill
- htmlSkill
- low-level-web-renderingSkill
- react-best-practicesSkill
- react-three-fiberSkill
- securitySkill
- service-workerSkill
- tanstackSkill
- vgpuSkill
- wasm-rustSkill
- web-design-guidelinesSkill
- webglSkill
- webgpuSkill
- web-performanceSkill
- webview2-winuiSkill
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.

