rule-typescript

Enforce strict TypeScript conventions across src/**/*.ts files.

1|Updated Apr 17, 2025
One-click install
npx skills add https://github.com/carrot-foundation/schemas --skill rule-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rule-typescript
Source: https://github.com/carrot-foundation/schemas/tree/main/.agents/skills/rule-typescript
Command: npx skills add https://github.com/carrot-foundation/schemas --skill rule-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

TypeScript conventions and best practices are applied to ensure consistent, safe, and maintainable code across a schemas package.

Core Features & Use Cases

  • Enforces strict mode in tsconfig across the codebase to catch edge cases early.
  • Prohibits the use of any and enforces explicit return types and clear interfaces, reducing runtime surprises.
  • Encourages disciplined use of interfaces vs types and consistent import patterns to improve readability and maintainability.
  • Use case: when extending or refactoring the schemas package, apply these conventions to ensure strong typing and predictable APIs.

Quick Start

Enable strict mode in tsconfig, prohibit any, and enforce explicit return types and interfaces across src/**/*.ts.

Frequently Asked Questions about rule-typescript

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

FAQPage Schema
How do I enforce strict TypeScript conventions across my codebase?

TypeScript strict mode enforces rigorous type checking by enabling tsconfig strict flags, prohibiting any, and requiring explicit return types across all src/**/*.ts files to catch edge cases early and improve codebase maintainability.

What is the best way to prohibit any and enforce explicit return types in TypeScript?

The best way to prohibit any and enforce explicit return types is by applying strict TypeScript conventions that require explicit export types and clear interfaces across all source files, reducing runtime surprises and improving predictable APIs.

How does Zod runtime validation work with TypeScript interfaces?

Zod runtime validation complements TypeScript interfaces by enforcing consistent type schemas at runtime, ensuring that data structures validated by Zod align with strict TypeScript types defined across the src/**/*.ts source files for predictable APIs.

When do I need explicit interfaces and strict mode for TypeScript refactoring?

You need explicit interfaces and strict mode for TypeScript refactoring when extending a schemas package to guarantee strong typing, consistent import patterns, and predictable APIs while avoiding runtime surprises during codebase modifications.

Can I use TypeScript strict mode conventions for a schemas package?

Yes, you can use TypeScript strict mode conventions for a schemas package by applying consistent interfaces, explicit return types, and Zod runtime validation across all source files to ensure strong typing and maintainability.

Why does TypeScript code quality require consistent interfaces and import patterns?

TypeScript code quality requires consistent interfaces and import patterns to improve readability and maintainability, ensuring disciplined use of types versus interfaces while reducing edge cases and runtime surprises across the codebase.