strict-typing

Enforce strict TypeScript typing with Zod schemas and explicit return types.

Updated Mar 12, 2026
One-click install
npx skills add https://github.com/Hashzin-0/Curion --skill strict-typing-hashzin-0
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: strict-typing
Source: https://github.com/Hashzin-0/Curion/tree/main/.opencode/skills/strict-typing
Command: npx skills add https://github.com/Hashzin-0/Curion --skill strict-typing-hashzin-0

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Prevents unsafe TypeScript usage that leads to silent runtime errors and security gaps by removing untyped values and enforcing explicit contracts across modules and APIs.

Core Features & Use Cases

  • Enforce no use of any and require unknown plus validation at trust boundaries to stop type leakage and runtime crashes.
  • Infer TypeScript types from Zod schemas to keep a single source of truth and reduce drift between validation and types.
  • Require explicit return types on all exported functions, use utility types to avoid duplicated interfaces, and use discriminated unions for multi-state data.
  • Use case: validate and type-check incoming API payloads with Zod, infer DTOs, and export stable function signatures so downstream consumers never experience unexpected shape changes.

Quick Start

Run the strict-typing checks on the current TypeScript file, replace any uses of any with unknown plus Zod validation where appropriate, and add explicit return types to all exported functions.

Frequently Asked Questions about strict-typing

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

FAQPage Schema
How do I eliminate any types and enforce strict TypeScript typing in my codebase?

To eliminate any types and enforce strict TypeScript typing, replace any with unknown for untrusted input, add Zod validation at trust boundaries, and require explicit return types on all exported functions to prevent runtime errors.

How do I infer TypeScript types from Zod schemas to keep a single source of truth?

Infer TypeScript types from Zod schemas by using Zod schema inference to generate DTOs, which keeps a single source of truth and reduces drift between runtime validation and static types across API payloads and function signatures.

When do I need to use unknown instead of any for external data in TypeScript?

You need to use unknown instead of any when handling external data or untrusted input at trust boundaries, ensuring you apply Zod validation before processing to stop type leakage and runtime crashes.

What's the best way to type multi-state data in TypeScript without unsafe casting?

The best way to type multi-state data in TypeScript without unsafe casting is using discriminated unions for multi-state data, alongside utility types to avoid duplicated interfaces and ensure explicit contracts across modules.

Do I need specific tsconfig options to enforce strict type safety and prevent silent runtime errors?

Yes, you need strict tsconfig options enabled to enforce type safety, prevent silent runtime errors, and ensure that explicit return types, discriminated unions, and unknown handling are validated during development and pre-PR checks.