typescript

Enforce strict TypeScript patterns for type-safe code.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/fwdarth/agent-teams-lite-domainaware --skill typescript-fwdarth
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript
Source: https://github.com/fwdarth/agent-teams-lite-domainaware/tree/main/.opencode/skills/typescript
Command: npx skills add https://github.com/fwdarth/agent-teams-lite-domainaware --skill typescript-fwdarth

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill addresses common pitfalls and enforces best practices in TypeScript development, leading to more robust, maintainable, and type-safe codebases.

Core Features & Use Cases

  • Const Types Pattern: Ensures a single source of truth for constants and their types.
  • Flat Interfaces: Promotes clear and readable interface definitions by avoiding excessive nesting.
  • Avoid any: Guides developers to use unknown or generics for better type safety.
  • Utility Types & Type Guards: Demonstrates powerful TypeScript features for type manipulation and runtime checks.

Quick Start

Apply the typescript skill to refactor the provided code snippet to adhere to const types patterns.

Frequently Asked Questions about typescript

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

FAQPage Schema
What is the best way to avoid using any in TypeScript?

To avoid using any in TypeScript, use the unknown type or generics for better type safety. This enforces strict type checks and prevents runtime errors by requiring explicit type narrowing.

How do I write flat interfaces in TypeScript?

Writing flat interfaces in TypeScript involves avoiding excessive nesting to promote clear and readable definitions. You should structure interface properties at a single level whenever possible.

How do I apply the const types pattern to a TypeScript codebase?

Apply the const types pattern by ensuring a single source of truth for constants and their types. This pattern maintains strict alignment between constant values and their inferred types.

When do I need utility types and type guards in TypeScript?

You need utility types and type guards in TypeScript when performing type manipulation and runtime checks. These features allow you to safely narrow broad types and transform existing type definitions.

Does strict mode in TypeScript work with generics and interfaces?

Strict mode in TypeScript works seamlessly with generics and interfaces to enforce type-safe code. It ensures that flat interfaces and generic type parameters are rigorously checked at compile time.