frontend/typescript-rules

Enforce TypeScript rules for type-safe React components and error handling.

225|24|Updated Jul 27, 2025
One-click install
npx skills add https://github.com/shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: frontend/typescript-rules
Source: https://github.com/shinpr/ai-coding-project-boilerplate/tree/main/.claude/skills-ja/frontend/typescript-rules
Command: npx skills add https://github.com/shinpr/ai-coding-project-boilerplate --skill frontend-typescript-rules

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill eliminates type-related bugs in frontend development by enforcing strict TypeScript rules, component design patterns, and error handling standards.

Core Features & Use Cases

  • Props-Driven Development: Design components with clear interfaces and proper type definitions.

Quick Start

Use this Skill to create a new React component with proper type safety, function components, and custom hooks for logic reuse.

Core Features & Use Cases

  • Error Boundary Implementation: Handle React component errors gracefully with proper fallback UI and structured error handling.

Core Features & Use Cases

  • Frontend Type Safety: Use unknown type with type guards for external input validation.

Quick Start

Implement a user authentication form with proper error handling and type-safe event handlers.

Frequently Asked Questions about frontend/typescript-rules

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

FAQPage Schema
How do I prevent type-related bugs in React components with TypeScript?

Type-related bugs in React are prevented by enforcing strict TypeScript rules across components, props design, and error handling. This Skill applies mandatory type definitions for props, explicit return types, function components only, and type guards for external input validation to eliminate runtime errors.

What's the best way to design React component props with type safety?

Design component props by defining explicit Props types as interfaces, using object parameter patterns, and applying strict typing throughout. This ensures clear component interfaces, prevents prop drilling issues, and catches type mismatches at compile time rather than runtime.

How do I handle errors properly in TypeScript React applications?

Handle errors with asynchronous try-catch blocks, structured error classes, Error Boundaries for component failures, and robust logging with privacy considerations. This Skill enforces these patterns to prevent unhandled exceptions and ensure graceful fallback UI rendering.

Can I use class components in a TypeScript React project with these rules?

Class components are prohibited except for Error Boundaries, which must use them for React's error-catching lifecycle. Function components are mandatory throughout your application to maintain consistent patterns and leverage modern hooks for logic reuse.

What type patterns should I use for validating external API data in React?

Use the unknown type with explicit type guards to validate external input from APIs before assignment. This prevents runtime type errors when API responses don't match expectations and enforces frontend type safety at data entry points.

Do I need to avoid specific React patterns to prevent type safety issues?

Avoid oversized components, prop drilling, implicit any types, and missing return type annotations. This Skill enforces guidelines for dependency injection, code formatting, and component size limits to maintain type safety and code quality across your frontend.