typescript

Enforces TypeScript style and type safety rules when editing TS and TSX code.

1|Updated Aug 11, 2026
One-click install
npx skills add https://github.com/Chia1104/agent-air --skill typescript-chia1104
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/Chia1104/agent-air/tree/main/skills/shared/typescript
Command: npx skills add https://github.com/Chia1104/agent-air --skill typescript-chia1104

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? TypeScript codebases drift into inconsistent patterns over time: implicit any types, sync IO calls, default exports, and swallowed errors accumulate as technical debt. This Skill gives the AI a concrete, opinionated rulebook so every edit to TS/TSX/MTS files follows the same style and type-safety standards. ## Core Features & Use Cases - Type Safety Rules: Enforces accurate typing such as Record<PropertyKey, unknown> over any, interface for object shapes, as const satisfies patterns, and @ts-expect-error over @ts-ignore. - Async-First IO Discipline: Requires promise-based APIs like fs/promises for new IO code, restricting *Sync calls to locked synchronous contracts only. - Import and Export Conventions: Mandates named exports over export default, separate import type statements, and lint-enforced import sorting. - Use Case: When asking the AI to add a new module or refactor a service in a TypeScript monorepo, the generated code automatically uses named exports, async fs APIs, strict types, and proper error logging instead of copying legacy debt patterns. ## Quick Start Review this TypeScript file and rewrite it to follow the project's type safety, async IO, and named export conventions.

Frequently Asked Questions about typescript

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

FAQPage Schema
How do I enforce TypeScript type safety in a codebase?▼

Type safety enforcement means avoiding implicit any, preferring Record<PropertyKey, unknown> over object or any, using interface for object shapes, and applying as const satisfies for literal types. Prefer @ts-expect-error over @ts-ignore so suppressions fail loudly when fixed.

Should I use named exports or default exports in TypeScript?▼

Named exports are preferred because they keep refactor renames and IDE auto-imports in sync and avoid re-naming drift. Reserve export default for framework-required cases like Next.js pages, React.lazy targets, and config files such as vitest.config.ts.

When is it acceptable to use sync fs methods in Node.js TypeScript?▼

Sync methods like readFileSync are acceptable only inside synchronous contracts you do not control, such as existing sync signature chains or sync-only callbacks like process.on('exit'). New IO code and module init should use fs/promises with top-level await.

Why should catch callbacks always log errors in TypeScript?▼

Silent .catch(() => fallback) handlers swallow failures and make debugging impossible. Always log the error with console.error inside catch blocks so failures remain visible while still allowing fallback behavior.

What are the limitations of a style-guide skill for TypeScript?▼

A style guide only shapes code the AI writes or edits; it does not run the compiler, execute lint rules, or verify types at build time. Pair it with ESLint rules like simple-import-sort and consistent-type-imports plus tsc checks for enforcement.