dheerajreddy01/claude-skills/javascript
Claude Code and agent skill by dheerajreddy01/claude-skills
Trust tier 2
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
JavaScript/TypeScript, Node.js, async patterns, and frontend/backend production practices
Install
npx vskill@latest install dheerajreddy01/claude-skills/javascriptSKILL.md
JavaScript / TypeScript
The event loop, the type system, and the dependency graph — used correctly
Applicable Scenarios
- Writing or reviewing JavaScript/TypeScript for frontend, Node.js backend, or full-stack apps
- Diagnosing async bugs (race conditions, unhandled rejections, event loop blocking)
- Choosing package managers, bundlers, or module systems
- Setting up TypeScript strictness, testing, and build tooling
- Reviewing dependency footprint and supply-chain risk
Core Knowledge
Runtime & Module Systems
| Concept | Detail | |
|---|---|---|
| Event loop | Single-threaded; macrotasks (setTimeout, I/O) vs microtasks (Promises) — microtasks always drain before the next macrotask | |
| CommonJS (`require`) | Synchronous, Node's original module system | |
| ESM (`import`/`export`) | Standard, async-capable, tree-shakeable — default for new projects | |
| Node.js | Server-side runtime; non-blocking I/O via libuv thread pool |
Package Managers
| Tool | Notes | |
|---|---|---|
| npm | Default, ships with Node, package-lock.json | |
| pnpm | Content-addressable store, fastest installs, strict by default (no phantom deps) | |
| yarn | Workspaces support, yarn.lock |
Always commit the lockfile. Use npm ci (not npm install) in CI for reproducible, lockfile-exact installs.
TypeScript
- Enable
strict: trueintsconfig.jsonfor new projects — catches null/undefined bugs at compile time anydefeats the type system; preferunknownand narrow explicitly- Structural typing means two unrelated types are compatible if their shapes match — don't assume nominal typing semantics
- Types are erased at runtime — never rely on
typeof/instanceofbehaving like compile-time type checks for structural types
Async Patterns
| Pattern | Use | |
|---|---|---|
Promise.all() | Run independent async ops concurrently, fail fast on first rejection | |
Promise.allSettled() | Run independent async ops concurrently, collect all results/errors | |
async/await | Sequential-looking async code; still needs try/catch for errors | |
| Event emitters / streams | Backpressure-aware, high-throughput I/O |
Best Practices
- Always handle promise rejections — an unhandled rejection can crash a Node process (since Node 15+)
- Use `===`, never `==` — avoid type coercion surprises
- Lock dependencies and audit them —
npm audit, Dependabot/Renovate for updates - Prefer `const`, then `let` — never
var(function-scoped, hoisting footguns) - Type your API boundaries first — request/response shapes, then work inward
- Keep the bundle lean — check bundle size impact before adding a dependency for a trivial utility
Common Mistakes
| Mistake | Correct Approach | |
|---|---|---|
== for comparisons | === / !== | |
Un-awaited promises in a loop (forEach with async callback) | Use for...of with await, or Promise.all(items.map(...)) | |
| Mutating state directly in React | Use immutable updates / state setters | |
any everywhere in TypeScript | unknown + narrowing, or precise types | |
| Blocking the event loop with sync heavy computation | Offload to a worker thread or a queue/worker service |
Sharp Edges
SE-1: Unhandled Promise Rejections Crash the Process
- Severity: critical
- Situation: A background
asynccall that isn't awaited throws, and the entire Node process crashes or silently fails - Cause: Node terminates the process on an unhandled promise rejection by default (as of Node 15+); browsers only log a warning
- Symptoms:
- Process exits with no clear stack trace pointing at the actual caller
- Works fine until a rare error path is hit in production
- Solution: Await every promise, attach
.catch()to fire-and-forget calls, and add a top-levelprocess.on('unhandledRejection', ...)as a safety net (log + alert, don't just swallow)
SE-2: this Binding Loses Context
- Severity: high
- Situation: A method passed as a callback (
element.addEventListener('click', obj.method)) loses itsthisbinding and throws or readsundefined - Cause: Regular functions get
thisfrom how they're called, not where they're defined; only arrow functions lexically bindthis - Symptoms:
Cannot read property 'x' of undefinedinside a callback that worked fine called directly- Solution: Use arrow functions for callbacks that need the enclosing
this, or.bind(this)explicitly, or class fields (method = () => {})
SE-3: Blocking the Event Loop
- Severity: critical
- Situation: A synchronous CPU-heavy operation (large JSON.parse, regex backtracking, tight loop) freezes the whole server — every concurrent request stalls
- Cause: Node is single-threaded for JS execution; nothing else runs until the call stack clears
- Symptoms:
- Latency spikes correlated with specific request types
- Health checks time out under load despite low overall CPU
- Solution: Move CPU-heavy work to a
worker_threadspool or a separate service/queue; avoid catastrophic-backtracking regexes; paginate/stream large payloads - Details: → [extended/checklists.md#event-loop-checklist]
SE-4: Dependency Supply-Chain Risk
- Severity: high
- Situation: A transitive dependency is compromised (malicious postinstall script, typosquat package) and runs arbitrary code during
npm installor at runtime - Cause: Deep, unaudited dependency trees with auto-run install scripts and loosely pinned versions
- Symptoms:
- Unexpected network calls or file writes during install
- Package published under a near-identical name to a popular one
- Solution: Pin exact versions, run
npm audit/Socket/Snyk in CI, disable install scripts where possible (--ignore-scripts), review new dependencies before adding
SE-5: TypeScript any Hides Real Bugs
- Severity: medium
- Situation: A function typed with
any(or an untyped external API response) propagates through the codebase, and a runtimeTypeErrorsurfaces far from the actual bad input - Cause:
anydisables type checking for everything it touches, so the compiler can't catch a mismatched shape - Symptoms:
- Errors happen deep in unrelated code, not at the boundary where bad data entered
- Refactors don't get flagged by the compiler even though they break call sites
- Solution: Type external boundaries with
unknown+ a validation library (Zod, io-ts) that narrows at runtime; forbidanyvia lint rule (@typescript-eslint/no-explicit-any)
Recommended Tools
| Category | Tools | |
|---|---|---|
| Bundlers | Vite, esbuild, webpack | |
| Testing | Vitest, Jest, Playwright | |
| Linting/formatting | ESLint, Prettier, Biome | |
| Runtime validation | Zod, io-ts | |
| Monorepo/workspaces | pnpm workspaces, Turborepo, Nx |
Production Readiness
Full deployment checklist: → [extended/checklists.md#production-readiness-checklist]
Related Resources
MDN Web Docs | TypeScript Handbook | Node.js Docs
Related Domains
[[python]] | [[go]] | [[aws]]
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingenterprise-languages/javascript/skills/javascript/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/dheerajreddy01/claude-skills/javascript)