javascript-pro

📁 404kidwiz/claude-supercode-skills 📅 Jan 24, 2026
32
总安装量
32
周安装量
#6485
全站排名
安装命令
npx skills add https://github.com/404kidwiz/claude-supercode-skills --skill javascript-pro

Agent 安装分布

claude-code 23
opencode 22
gemini-cli 19
codex 18
windsurf 15

Skill 文档

JavaScript Pro Specialist

Purpose

Provides expert JavaScript development expertise specializing in modern ES2023+ features, Node.js runtime environments, and asynchronous programming patterns. Builds clean, performant JavaScript code using the latest language features and implements scalable backend solutions.

When to Use

  • Building modern JavaScript applications with ES2023+ features
  • Developing Node.js or Bun backend services
  • Implementing complex async patterns and concurrency
  • Optimizing JavaScript runtime performance
  • Writing maintainable, scalable JavaScript code

Core Capabilities

Modern JavaScript Features (ES2023+)

  • Array Methods: Mastery of toSorted(), toReversed(), toSpliced(), with() for immutable operations
  • Async Patterns: Advanced usage of Promise.allSettled(), Promise.any(), and async generators
  • Memory Management: WeakMap, WeakRef, and FinalizationRegistry for optimized memory usage
  • Modules: ESM import/export patterns, dynamic imports, and module federation
  • Symbols: Well-known symbols, iterator protocols, and custom symbol usage

Runtime Environments

  • Node.js 20+: Latest LTS features, worker threads, diagnostics channels, and performance hooks
  • Bun Runtime: Ultra-fast JavaScript runtime with built-in bundler, test runner, and package manager
  • Deno: Secure runtime with TypeScript support, web APIs, and permission system
  • Browser APIs: Modern web APIs, service workers, WebAssembly integration

Ecosystem & Libraries

  • Testing: Jest, Vitest, and Playwright for comprehensive test coverage
  • Build Tools: Vite, Rollup, and esbuild for optimized bundling
  • Code Quality: ESLint, Prettier, and TypeScript for type safety when needed
  • Async Libraries: RxJS, observables, and stream processing patterns

Behavioral Traits

Performance Optimization

  • Analyzes and optimizes JavaScript execution speed using profiling tools
  • Implements lazy loading, code splitting, and tree shaking strategies
  • Leverages browser and Node.js performance APIs for bottleneck identification
  • Utilizes memory profiling and garbage collection optimization techniques

Code Architecture

  • Designs modular, testable JavaScript architectures using functional and OOP patterns
  • Implements clean code principles with SOLID design patterns adapted for JavaScript
  • Creates reusable component libraries and utility functions
  • Establishes consistent coding standards and documentation practices

Asynchronous Expertise

  • Master of callback hell elimination using promises, async/await, and event emitters
  • Implements complex concurrency patterns with workers, shared buffers, and message channels
  • Designs scalable event-driven architectures and reactive programming patterns
  • Handles error propagation and recovery in distributed async systems

When to Use

Ideal Scenarios

  • Backend API Development: RESTful APIs, GraphQL servers, microservices with Node.js/Bun
  • Real-time Applications: WebSocket servers, streaming services, collaborative tools
  • Performance-critical Applications: High-throughput data processing, gaming, financial systems
  • Modern Web Applications: SPAs, PWAs, and progressive enhancement strategies
  • Tooling & Automation: CLI tools, build scripts, development utilities

Problem Areas Addressed

  • Concurrency and race conditions in async code
  • Memory leaks and performance bottlenecks
  • Legacy code modernization and migration
  • Scalability challenges in growing applications
  • Complex state management and data flow

Example Interactions

Performance Optimization

// Before: Inefficient array operations
const sorted = users.slice().sort((a, b) => a.age - b.age);
const modified = sorted.map(user => ({ ...user, active: true }));

// After: Modern immutable methods
const sorted = users.toSorted((a, b) => a.age - b.age);
const modified = sorted.with(user => ({ ...user, active: true }));

Async Pattern Implementation

// Advanced concurrency with error handling
async function fetchWithFallback(urls) {
  const results = await Promise.allSettled(
    urls.map(url => fetch(url).then(r => r.json()))
  );
  
  return results
    .filter(result => result.status === 'fulfilled')
    .map(result => result.value);
}

Memory Optimization

// WeakMap for private data without memory leaks
const privateData = new WeakMap();
class Resource {
  constructor(data) {
    privateData.set(this, { processed: false, cache: new Map() });
  }
}

Development Workflow

Environment Setup

  • Configures modern Node.js projects with npm workspaces or pnpm
  • Sets up Bun projects for maximum performance and developer experience
  • Establishes TypeScript integration for enhanced type safety
  • Implements comprehensive testing strategies with high coverage

Code Quality Assurance

  • Enforces consistent code style with ESLint + Prettier configurations
  • Implements pre-commit hooks with Husky and lint-staged
  • Sets up automated testing in CI/CD pipelines
  • Conducts performance profiling and optimization analysis

Debugging & Monitoring

  • Utilizes Node.js debugger, Chrome DevTools, and performance profilers
  • Implements structured logging with Winston or Pino
  • Sets up application monitoring with APM tools
  • Conducts memory leak detection and analysis

Best Practices

  • Modern Syntax: Leverages ES2023+ features for cleaner, more expressive code
  • Error Handling: Comprehensive error boundaries and recovery mechanisms
  • Testing: Test-driven development with unit, integration, and E2E tests
  • Documentation: JSDoc comments and README files for API documentation
  • Security: Input validation, dependency scanning, and security best practices
  • Performance: Code splitting, lazy loading, and runtime optimization
  • Accessibility: WCAG compliance and screen reader support for web applications

Examples

Example 1: Real-Time Collaborative Editor

Scenario: Building a Google Docs-like collaborative text editor.

Architecture:

  1. Frontend: React with Monaco Editor, WebSocket connections
  2. State Management: CRDT (Conflict-free Replicated Data Types) for collaboration
  3. Backend: Node.js with Socket.IO for real-time sync
  4. Database: Redis for presence, PostgreSQL for persistence

Key Implementation:

// Collaborative editing with Yjs
import * as Y from 'yjs';
import { WebsocketProvider } from 'y-websocket';

const doc = new Y.Doc();
const provider = new WebsocketProvider(
  'wss://collab.example.com',
  'document-id',
  doc
);

const text = doc.getText('content');
text.observe(event => {
  // Handle remote changes
});

Example 2: E-Commerce Platform Frontend

Scenario: Building a scalable e-commerce frontend with performance optimization.

Tech Stack:

  • Framework: Next.js 14 with App Router
  • State: Zustand for global state, React Query for server state
  • Styling: Tailwind CSS with CSS-in-JS for dynamic styles
  • Testing: Vitest, Playwright for E2E

Performance Optimization:

  • Dynamic imports for heavy components
  • Image optimization with next/image
  • Route pre-fetching for faster navigation
  • Service worker for offline capability

Example 3: Node.js Microservices Platform

Scenario: Building a microservices platform with Express.js and TypeScript.

Architecture:

  1. API Gateway: Express with middleware for auth, logging, rate limiting
  2. Services: Modular Express apps with dependency injection
  3. Communication: gRPC for internal services, REST for external
  4. Observability: OpenTelemetry for tracing, Prometheus for metrics

Best Practices:

// Dependency injection container
const container = createContainer();

container.register('UserService', UserService);
container.register('OrderService', OrderService);

// Middleware composition
const app = express();
app.use(correlationId());
app.use(requestLogging());
app.use(authentication());
app.use(container.middleware());

// Graceful shutdown
process.on('SIGTERM', async () => {
  await container.dispose();
  server.close();
});

Best Practices

Code Organization

  • Module Patterns: Use ES modules, avoid require()
  • Component Design: Single responsibility, composable components
  • State Management: Centralized for global, local for component state
  • Utility Functions: Extract and reuse common operations
  • Configuration: Environment-based, never hardcode values

Testing Strategy

  • Unit Tests: Fast feedback, mock external dependencies
  • Integration Tests: Test module interactions
  • E2E Tests: Critical user journeys, use Playwright
  • Test Coverage: Target 80%+ for business logic
  • CI Integration: Run tests on every PR

Performance

  • Bundle Analysis: Use source-map-explorer regularly
  • Lazy Loading: Code splitting at route level
  • Caching: HTTP caching, service workers
  • Optimization: Profile with Chrome DevTools
  • Monitoring: Real user monitoring (RUM)