rules-typescript

Enforce TypeScript coding rules for strict typing and async safety.

4|1|Updated Apr 7, 2026
One-click install
npx skills add https://github.com/NSObjects/specpowers --skill rules-typescript
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rules-typescript
Source: https://github.com/NSObjects/specpowers/tree/main/skills/rules-typescript
Command: npx skills add https://github.com/NSObjects/specpowers --skill rules-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill ensures TypeScript code stays aligned with strict project conventions, preventing unchecked anys, inconsistent naming, and unsafe async handling that slip through generic guidance.

Core Features & Use Cases

  • Naming & Formatting Guidance: Clarifies PascalCase patterns for interfaces, generics, and files, plus rules for constants and barrel files so TypeScript exports stay predictable.
  • Typing & Testing Discipline: Enforces strict: true, discriminated unions, readonly defaults, and test-first workflows with TypeScript-aware runners to keep typings meaningful.
  • Async, Error, and Dependency Safety: Requires awaited Promises, Result-type error handling, AbortController cleanup, and dependency-aware dependency injection patterns when vetting PRs that introduce new services.

Quick Start

Describe your TypeScript module and ask for a review that aligns it with these rules.

Frequently Asked Questions about rules-typescript

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

FAQPage Schema
How do I enforce strict TypeScript coding rules during code review?

To enforce strict TypeScript coding rules during code review, apply guidelines covering strict mode, discriminated unions, readonly defaults, and typed tests. This ensures codebases prevent unchecked anys, inconsistent naming, and unsafe async handling.

What is the best way to prevent floating promises and unsafe async patterns in TypeScript?

Preventing floating promises in TypeScript requires enforcing awaited Promises, Result-type error handling, and AbortController cleanup. These async safety rules ensure proper execution flow and resource management when reviewing modified modules.

Can I use this to enforce TypeScript naming conventions and file organization?

Yes, you can enforce TypeScript naming conventions and file organization by applying rules for PascalCase patterns across interfaces, generics, and files. This also covers constant naming and barrel file exports to keep project styles predictable.

Does this TypeScript review guidance require strict mode and typed testing?

Yes, this TypeScript review guidance requires strict mode and typed testing. It enforces strict: true configurations, discriminated unions, and test-first workflows using TypeScript-aware runners to maintain meaningful type safety.

How do I vet dependency injection patterns in TypeScript PRs?

To vet dependency injection patterns in TypeScript PRs, evaluate new services against dependency-aware rules. This review process ensures safe dependency or DI patterns are correctly structured before merging.