Claude-skill-registry lang-javascript
This skill should be used when the user asks to "write JavaScript", "debug a Node.js/Bun app", "create a Hono server", "configure Biome", "run tests with bun test", or mentions .js/.mjs files. Covers ES2024+, Bun, and Hono patterns.
git clone https://github.com/majiayu000/claude-skill-registry
T=$(mktemp -d) && git clone --depth=1 https://github.com/majiayu000/claude-skill-registry "$T" && mkdir -p ~/.claude/skills && cp -r "$T/skills/data/lang-javascript" ~/.claude/skills/majiayu000-claude-skill-registry-lang-javascript && rm -rf "$T"
skills/data/lang-javascript/SKILL.md<skill_doc> <trigger_keywords>
Trigger Keywords
Activate this skill when the user mentions any of:
File Extensions:
.js, .mjs, .cjs, package.json, bun.lockb
JavaScript Core: JavaScript, ES2024, ES2025, ESM, CommonJS, import/export, async/await, Promise, Set methods, Object.groupBy, Map.groupBy, toSorted, toReversed, toSpliced
Runtime: Bun, Bun.serve, Bun.file, Bun.write, bun:sqlite, bun:test, Node.js alternative
Web Frameworks: Hono, hono/cors, hono/jwt, edge-first, Cloudflare Workers, c.json, c.text, middleware
Validation: Valibot, @hono/valibot-validator, v.object, v.string, v.pipe, schema validation
Testing: bun test, describe, it, expect, mock, beforeEach, afterEach, --coverage
Linting: Biome, biomejs, biome.json, linter, formatter, biome check
Database: bun:sqlite, Drizzle ORM, SQLite, prepared statements </trigger_keywords>
⛔ Forbidden Patterns
- NO
: Always usevar
orconst
. Block scope is mandatory.let - NO
in ESM: Userequire
/import
syntax unless explicitly in a CJS context or interacting with legacy CJS-only packages in a compatible way.export - NO Promise Constructors for Async/Await: Avoid
wrappers around functions that already return promises. Usenew Promise()
directly.async/await - NO Loose Equality: Always use
and===
instead of!==
and==
.!= - NO Ignoring Floating Point Precision: Be aware of
. Use libraries like0.1 + 0.2 !== 0.3
for financial calculations if needed.decimal.js
🤖 Agent Tool Strategy
- Discovery: Check for
first. If it exists, usejustfile
to list recipes and preferjust -l
commands over language-specific CLIs (npm, cargo, poetry, etc.). Then, readjust
to understand the project type (package.json
vs "commonjs"), dependencies, and scripts.type: "module" - File Operations:
- Use
orbun init
(via Bash) only if creating a new project.npm init - Use
to inspect existing code before modifying.Read
- Use
- Testing: Prefer running tests via
orbun test
after changes to verify correctness.npm test - Linting: Check for
orbiome.json
and respect the project's linting rules.eslint.config.js
Quick Reference (30 seconds)
JavaScript ES2024+ Development Specialist - Modern JavaScript with Bun runtime and Hono framework.
Auto-Triggers:
.js, .mjs, .cjs files, package.json, JavaScript projects
Core Stack:
- ES2024+: Set methods, Promise.withResolvers, immutable arrays, import attributes
- Bun: Fast all-in-one runtime, bundler, test runner, package manager
- Hono: Ultrafast, edge-first web framework
- Testing: Bun's built-in test runner
- Linting: Biome (linter + formatter)
- Validation: Valibot (tree-shakable)
Quick Commands:
# Create new project bun init # Install dependencies bun install bun add hono valibot bun add -d @biomejs/biome # Run development server bun run --watch src/index.js # Run tests bun test # Bundle for production bun build ./src/index.js --outdir=./dist --target=bun
Implementation Guide (5 minutes)
See patterns.md for detailed implementation patterns covering:
- ES2024 Key Features (Set Operations, Promise.withResolvers)
- ES2025 Features (Import Attributes, RegExp.escape)
- Bun Runtime (File I/O, HTTP Server, SQLite)
- Hono Web Framework (Basic Setup, Validation, JWT, Error Handling)
- Testing with Bun
- Biome (Linter + Formatter)
Quick Troubleshooting
Bun Issues:
# Check version bun --version # Upgrade Bun bun upgrade # Clear cache bun pm cache rm
Module System:
# Check package.json type # (Use the Read tool to inspect package.json) # ESM: "type": "module" - use import/export # CommonJS: "type": "commonjs" or omitted - use require/module.exports
Common Fixes:
# Delete cache and reinstall rm -rf node_modules bun.lockb && bun install # Check for outdated packages bun outdated
Advanced Patterns
For comprehensive documentation including advanced async patterns, module system details, performance optimization, and production deployment configurations, see:
- patterns.md - Implementation patterns (Bun, Hono, Biome)
- reference.md - Complete API reference, Context7 library mappings, Bun APIs
- examples.md - Production-ready code examples, full-stack patterns, testing templates
Context7 Integration
// Bun - mcp__context7__get_library_docs("/oven-sh/bun", "runtime bundler test", 1) // Hono - mcp__context7__get_library_docs("/honojs/hono", "middleware validators routing", 1) // Valibot - mcp__context7__get_library_docs("/fabian-hiller/valibot", "schema validation", 1) // Drizzle - mcp__context7__get_library_docs("/drizzle-team/drizzle-orm", "queries migrations", 1)
Quick Troubleshooting
Bun Issues:
# Check version bun --version # Upgrade Bun bun upgrade # Clear cache bun pm cache rm
Module System:
# Check package.json type # (Use the Read tool to inspect package.json) # ESM: "type": "module" - use import/export # CommonJS: "type": "commonjs" or omitted - use require/module.exports
Common Fixes:
# Delete cache and reinstall rm -rf node_modules bun.lockb && bun install # Check for outdated packages bun outdated
</skill_doc>