Javascript hints
This skill should be used when writing, reviewing, or refactoring vanilla JavaScript (not TypeScript) — any time files match `**/*.js`, `**/*.mjs`, `**/*.cjs`, or `**/package.json`, or the user mentions JavaScript/ES2022+ conventions, ESM vs. CommonJS, `const`/`let`, arrow functions, destructuring, spread, optional chaining, nullish coalescing, async/await, Promises, `AbortController`, `structuredClone`, `BigInt`, `Number.isNaN`, or JSDoc. Covers general JavaScript language guidance only — conventions and patterns/anti-patterns. Specific third-party tool, framework, or library rules (linters, formatters, bundlers, test runners, validation libraries, web frameworks, ORMs, UI frameworks) belong in their own skills. If the project uses TypeScript, use the `typescript-hints` skill instead.From its SKILL.md
npx -y skills add trphume/daichijoubu --skill javascript-hintsAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
4.5 KB, 947 tokens by cl100k_base, as published. Nobody here has run it
javascript-hints
Project-wide JavaScript language guidance. Apply these rules when authoring or modifying vanilla JavaScript (.js/.mjs/.cjs) in this repository.
Scope
These references cover the JavaScript language (ES2022+) and platform-neutral runtime built-ins (Promise, AbortController, structuredClone, URL, Intl). They do not cover:
- TypeScript-specific features — use
typescript-hintsinstead. - Linters or formatters (ESLint, Biome, Prettier, …)
- Bundlers / build tools (esbuild, webpack, vite, rollup, …)
- Test frameworks (Jest, Vitest, Mocha,
node:test, …) - Validation libraries (Zod, Yup, io-ts, Valibot, …)
- Runtime-specific APIs (Node-only, Deno-only, Bun-only, browser-only)
- Web frameworks, UI libraries, ORMs, state managers
Those belong in dedicated skills.
When to apply
Apply when any of the following is true:
- The task touches a file matching
**/*.js,**/*.mjs,**/*.cjs, or**/package.jsonin a non-TypeScript project. - The user is designing a JavaScript package, service, CLI, or library.
- The user asks about JS idioms, ESM vs. CommonJS, async/await, error handling, or modern syntax.
- The user is writing or reviewing JSDoc annotations.
If the file is .ts/.tsx or the project has a tsconfig.json, prefer typescript-hints.
How to apply
- Before writing or editing JS code, load the reference file(s) relevant to the task. Do not rely on memory — these rules may evolve.
- Prefer the obvious, readable solution. Do not introduce abstractions, closures, or indirection that the task does not require.
- Match the repository's existing patterns before applying a rule — if a file already follows a rule, stay consistent; if it violates one, surface the mismatch rather than silently "fixing" surrounding code.
- If a rule touches a specific third-party tool the project uses, defer to that tool's dedicated skill and do not restate its rules here.
Non-negotiables (quick reference)
- Target ES2022+. Use ES modules (
import/export); do not mix with CommonJS in the same module. constby default;letonly when reassigning; nevervar.- Always
===/!==, never==/!=. - Every promise must be
awaited,returned, or.catch-handled. No floating promises. - Never
awaitinsideArray.prototype.forEach— usefor...oforPromise.all(items.map(...)). - Never wrap an async function's work in
new Promise(async ...)— return the promise directly. - Use
??for default values on nullable data, not||. - Throw
Error(or a subclass). Preserve causes withnew Error("...", { cause: e }). - Use
structuredClone(x)for deep copies, notJSON.parse(JSON.stringify(x)). - Use
Number.isNaN/Number.isFinite, not the global versions. - Prefer named exports over default exports.
- No module-level side effects at import time.
- Document exported symbols with JSDoc.
Reference Files
Load the specific file(s) for the task — do not load both unnecessarily.
references/conventions.md— Target baseline (ES2022+, ESM), strict mode, naming,const/let/no-var, imports/exports (named vs. default), function and class style,#privatefields, equality rules, JSDoc, module hygiene.references/patterns.md— Design principles (KISS, SRP, composition over inheritance, Rule of Three, function size), modern syntax idioms (arrowthis, destructuring, spread/structuredClone, optional chaining, nullish coalescing, array methods), async patterns (async/await,Promise.all/allSettled/any/race,AbortController,Errorcause), numbers and equality (float precision,BigInt,Number.isNaN,Object.is), and an anti-patterns checklist with fix table.
What ships with it: 2 files
13.7 KB alongside SKILL.md
references/
- conventions.md4.2 KB
- patterns.md9.5 KB