web-code-style

Enforces readability and control-flow style rules for React and TypeScript UI code.

1|Updated Feb 2, 2026
One-click install
npx skills add https://github.com/rockcookies/skills --skill web-code-style-rockcookies
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: web-code-style
Source: https://github.com/rockcookies/skills/tree/main/skills/custom/web-code-style
Command: npx skills add https://github.com/rockcookies/skills --skill web-code-style-rockcookies

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? React and TypeScript UI codebases often accumulate deeply nested conditionals, wall-style if/else chains, overloaded function signatures, and JSX templates stuffed with business logic, making code hard to read and review. This Skill provides concrete, judgment-based style rules for writing and reviewing web UI code so teams stay consistent beyond what a formatter can enforce. ## Core Features & Use Cases - Control flow rules: Early returns for errors and edge cases, removal of redundant else branches, and named booleans for conditions with three or more operands. - Function and component design: Options objects when parameters exceed roughly four, components limited to presentation concerns, and a defined declaration order within files. - JSX and review support: Guidance on lifting complex derived values out of templates, readonly props, why-focused comments, plus a parallel audit mode using up to five subagents for large codebases. - Use Case: While reviewing a pull request, ask the assistant to check a diff for deep nesting, long parameter lists, and business logic embedded in JSX, and receive concrete refactoring suggestions aligned with the project style. ## Quick Start Review this React component for deep nesting, long parameter lists, and logic that should be lifted out of the JSX template.

Frequently Asked Questions about web-code-style

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

FAQPage Schema
How do I reduce deeply nested conditionals in React TypeScript code?▼

Handle errors and edge cases first with early returns so the main path stays at the shallowest indentation. Remove else blocks after if branches that end in return, throw, or continue, and use default-value-then-override for simple assignments.

When should a function use an options object instead of parameters?▼

Switch to an options object when a function has roughly four or more parameters, since positional arguments become hard to read and extend. Name the fields in the options type and add new optional fields there instead of lengthening the parameter list.

What logic should be moved out of JSX templates?▼

Lift multi-step array transformations, nested ternaries, and non-obvious derived values into the component body as plain functions or derived variables. Simple expressions like a single optional chain, one ternary, or an && guard can stay inline in the JSX.

Does this style guide cover naming conventions or React performance?▼

No, naming conventions are delegated to the web-naming skill, and React performance plus hooks rules belong to react-best-practices. This skill covers only readability concerns like control flow, function design, JSX complexity, and comments.

When should I not apply these code style rules?▼

Prioritize consistency with the existing file and repository when a rule conflicts with local conventions. When you intentionally ignore a rule, add a short comment next to the code explaining the reason.