coding-standards

Applies universal coding standards and best practices for TypeScript, JavaScript, React, and Node.js development.

Updated Aug 17, 2026
One-click install
npx skills add https://github.com/prabaljainn/my-claude-code-setup --skill coding-standards-prabaljainn
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: coding-standards
Source: https://github.com/prabaljainn/my-claude-code-setup/tree/main/claude/skills/coding-standards
Command: npx skills add https://github.com/prabaljainn/my-claude-code-setup --skill coding-standards-prabaljainn

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent code style, missing error handling, and anti-patterns like mutation and deep nesting slow down reviews and create maintenance debt across TypeScript and React projects. ## Core Features & Use Cases - Code Quality Principles: Enforces readability, KISS, DRY, and YAGNI principles with concrete good/bad examples. - Language & Framework Standards: Covers TypeScript type safety, immutability patterns, async/await parallelism, React component structure, custom hooks, and state management. - API & Testing Conventions: Defines REST endpoint design, Zod-based input validation, consistent response formats, and AAA-pattern test structure. - Use Case: When starting a new Next.js module or reviewing a pull request, activate this skill to check naming, immutability, error handling, and code smells like magic numbers and deep nesting. ## Quick Start Review this TypeScript file against the coding standards and flag any violations of immutability, error handling, or naming conventions.

Frequently Asked Questions about coding-standards

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I enforce coding standards in a TypeScript project?▼

Apply consistent naming conventions, immutability via spread operators, comprehensive try/catch error handling, and proper type definitions instead of any. Activate this skill during code reviews or when scaffolding new modules to check code against these rules.

What are React best practices for components and hooks?▼

Use functional components with typed props interfaces, extract reusable logic into custom hooks like useDebounce, and update state with functional setters to avoid stale values. Memoize expensive computations with useMemo and callbacks with useCallback.

How should I validate API request bodies in Node.js?▼

Use Zod schemas to define expected shapes, then parse incoming JSON and return a 400 response with error details on ZodError. Pair this with a consistent ApiResponse structure containing success, data, and error fields.

Why should I avoid mutating objects and arrays directly?▼

Direct mutation breaks React's change detection and causes unpredictable state bugs. Use the spread operator to create updated copies, such as {...user, name: 'New Name'} or [...items, newItem], keeping updates immutable.

What code smells indicate a function needs refactoring?▼

Watch for functions over 50 lines, nesting deeper than a few levels, and unexplained magic numbers. Split long functions into smaller units, use early returns to flatten nesting, and replace literals with named constants like MAX_RETRIES.