Enforce Coding Standards and Best Practices
A universal coding standards skill covering naming, immutability, error handling, React patterns, and REST API design.
Why it matters
Elevate your codebase quality by implementing universal coding standards and best practices. This asset ensures consistency, readability, and maintainability across all your projects.
Outcomes
What it gets done
Define and enforce code readability, KISS, DRY, and YAGNI principles.
Implement TypeScript/JavaScript standards for naming, immutability, and error handling.
Establish best practices for React components, custom hooks, and state management.
Define REST API conventions, response formats, and input validation schemas.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/ag-cc-skill-coding-standards | bash Overview
Coding Standards & Best Practices
This skill documents universal coding standards: readability/KISS/DRY/YAGNI principles, TypeScript naming and immutability, React component and hook patterns, and REST API design with schema validation. Use it as a reference for writing or reviewing code against a consistent quality bar across any project, regardless of domain.
What it does
A skill documenting universal coding standards and best practices applicable across projects, organized around four code-quality principles - readability first (clear names, self-documenting code over comments, consistent formatting), KISS (simplest solution that works, no premature optimization), DRY (extract common logic, reusable components, no copy-paste), and YAGNI (don't build speculative features, start simple and refactor when needed) - followed by concrete good-versus-bad code examples across several domains. TypeScript/JavaScript standards cover descriptive variable and verb-noun function naming, an immutability rule (always use spread operators, never mutate objects/arrays directly), comprehensive try/catch error handling with explicit status checks, parallel async execution via Promise.all instead of unnecessary sequential awaits, and proper typed interfaces instead of any. React best practices cover typed functional components with explicit prop interfaces, reusable custom hooks (a useDebounce example), functional state updates (setCount(prev => prev + 1) instead of referencing stale state directly), and clear conditional rendering with && guards instead of nested ternary chains. API design standards cover REST conventions (GET/POST/PUT/PATCH/DELETE with resource-based URLs and query-parameter filtering), a consistent ApiResponse<T> response envelope (success/data/error/meta with pagination fields), and Zod schema-based input validation with explicit min/max/type constraints before processing a request body.
When to use - and when NOT to
Use this skill as a reference for writing or reviewing code against a consistent, universal quality bar - naming, immutability, error handling, async patterns, typed React components, and REST API conventions - across any project regardless of its specific domain.
Inputs and outputs
Given a piece of code or an API design question, it produces a good-versus-bad comparison and the recommended pattern to follow, grounded in the four core principles (readability, KISS, DRY, YAGNI) - for example flagging a direct array mutation like items.push(newItem) in favor of the spread-operator equivalent, or a nested ternary chain in favor of sequential && guards.
Integrations
TypeScript/JavaScript and React conventions, REST API design patterns, and Zod for schema-based input validation - framework-agnostic guidance rather than tied to a specific stack beyond those examples.
Who it's for
Developers and code reviewers who want a consistent, opinionated set of coding standards - naming conventions, immutability, error handling, async patterns, typed React components, and REST API/response conventions - to apply uniformly across a codebase rather than reinventing style decisions project by project - deliberately framework-agnostic in its four core principles, even though the worked examples happen to draw on TypeScript, React, and REST API conventions specifically.
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.