forge-typescript

Detect unsafe TypeScript typing and boundary-handling patterns in production code.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-typescript
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: forge-typescript
Source: https://github.com/f4rkh4d/forge-skill/tree/main/skills/backend/forge-typescript
Command: npx skills add https://github.com/f4rkh4d/forge-skill --skill forge-typescript

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes assets (resource) components.

What problem does it solve?

Prevents TypeScript codebases from silently degrading into unsafe patterns that break in production, especially through misuse of any, unchecked parsing, weak type boundaries, and missing exhaustiveness.

Core Features & Use Cases

  • Type-safe boundaries with schema validation: Treats external inputs as unknown and validates them before use (e.g., JSON.parse, env vars, API responses).
  • No any, disciplined casting, and banned escape hatches: Enforces rules against any, @ts-ignore/@ts-nocheck, non-null assertions in production paths, and unprincipled as casts.
  • Exhaustive discriminated unions and branded domain types: Uses assertNever for complete variant handling and branded primitives to prevent cross-domain identifier bugs.
  • Result-first error handling and strict TS configuration: Encourages Result types for expected failures and exceptions for unexpected ones, backed by a strict tsconfig baseline.
  • Built-in verification workflow: Provides a verifier script that flags common TS-discipline violations.

Quick Start

Run the TypeScript discipline verifier against a file to catch forbidden patterns like any, @ts-ignore, non-null assertions, and schema-less JSON parsing.

Frequently Asked Questions about forge-typescript

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

FAQPage Schema
How do I enforce type safety and prevent unsafe TypeScript patterns in production?▼

You can enforce type safety in TypeScript by detecting unsafe typing and boundary-handling patterns. This discipline forbids `any`, bans `@ts-ignore` without linked issues, and validates external inputs using schemas before use.

What is the best way to validate API responses and environment variables in TypeScript?▼

The best way to validate external inputs in TypeScript is treating them as `unknown` and applying schema validation before use. This approach ensures JSON, environment variables, and API responses are safely typed at boundaries.

How do you handle exhaustive union checking for discriminated unions?▼

Exhaustive union handling for discriminated unions is achieved using an `assertNever` pattern. This ensures complete variant handling across state modeling, preventing missing cases from silently breaking production logic.

Should I use Result types or exceptions for error handling in TypeScript?▼

You should use Result types for expected failures and reserve exceptions for unexpected ones. This strict error-handling design pairs with a strict `tsconfig` baseline to keep TypeScript code correct and predictable.

How do I eliminate `any` and unprincipled type casting from my TypeScript codebase?▼

You can eliminate `any` and unprincipled casting by enforcing rules against `as` casts and non-null assertions in production paths. A built-in verifier script flags these forbidden escape hatches automatically.

Can I use this TypeScript discipline verifier on my existing production code?▼

You can use the verifier on existing production code authoring and reviewing workflows. It flags common TypeScript discipline violations like missing schema validation and unsafe `any` usage to keep codebases correct.