javascript
Best practices for JavaScript/TypeScript development including modern ES6+ patterns, error handling, and performance optimization.
Best use case
javascript is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Best practices for JavaScript/TypeScript development including modern ES6+ patterns, error handling, and performance optimization.
Teams using javascript should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/javascript/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How javascript Compares
| Feature / Agent | javascript | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Best practices for JavaScript/TypeScript development including modern ES6+ patterns, error handling, and performance optimization.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
SKILL.md Source
# JavaScript/TypeScript Best Practices ## Code Style - Use const by default, let when reassignment is needed - Use template literals for string interpolation - Prefer arrow functions for callbacks - Use destructuring for object/array access - Use async/await over .then() chains - Use semicolons consistently (pick a style) ## Error Handling - Always handle promise rejections with .catch() or try/catch - Use try/catch with async/await - Provide meaningful error messages with context - Don't swallow errors silently - Create custom error classes for domain errors ## Modern Patterns - Use optional chaining (?.) and nullish coalescing (??) - Use spread operator for shallow object/array copies - Use Map/Set for complex data structures - Prefer for...of over forEach for iterables - Use Object.entries/keys/values for object iteration - Use Array.from() for array-like conversions ## TypeScript Specific - Prefer interfaces over type aliases for objects - Use strict mode in tsconfig.json - Avoid 'any' type - use 'unknown' if needed - Use generics for reusable type-safe code - Use discriminated unions for type narrowing - Leverage const assertions for literal types ## Performance - Avoid creating functions inside loops - Use object pools for frequent allocations - Debounce/throttle expensive operations - Use Web Workers for CPU-intensive tasks
Related Skills
javascript-typescript-typescript-scaffold
You are a TypeScript project architecture expert specializing in scaffolding production-ready Node.js and frontend applications. Generate complete project structures with modern tooling (pnpm, Vite, N
javascript-testing-patterns
Implement comprehensive testing strategies using Jest, Vitest, and Testing Library for unit tests, integration tests, and end-to-end testing with mocking, fixtures, and test-driven development. Use...
javascript-pro
Master modern JavaScript with ES6+, async patterns, and Node.js APIs. Handles promises, event loops, and browser/Node compatibility.
agent-javascript-pro
Expert JavaScript developer specializing in modern ES2023+ features, asynchronous programming, and full-stack development. Masters both browser APIs and Node.js ecosystem with emphasis on performance and clean code patterns.
javascript-mastery
Comprehensive JavaScript reference covering 33+ essential concepts every developer should know. From fundamentals like primitives and closures to advanced patterns like async/await and functional p...
bgo
Automates the complete Blender build-go workflow, from building and packaging your extension/add-on to removing old versions, installing, enabling, and launching Blender for quick testing and iteration.
linear
Managing Linear issues, projects, and teams. Use when working with Linear tasks, creating issues, updating status, querying projects, or managing team workflows.
lilhomie
Control HomeKit devices via REST API. Use when controlling lights, switches, scenes, or checking device status in the user's home.
lightfriend-add-frontend-page
Step-by-step guide for adding new pages to the Yew frontend
library-writer
This skill should be used when writing software libraries, packages, or modules following battle-tested patterns for clean, minimal, production-ready code. It applies when creating new libraries, refactoring existing ones, designing library APIs, or when clean, dependency-minimal library code is needed. Triggers on requests like "create a library", "write a package", "design a module API", or mentions of professional library development.
Library Management
User library, favorites, and reading progress
library-doc
Index and search library documentation locally for offline use. Invoke when user asks to index docs, search library topics, or list indexed libraries.