mastering-typescript

Guide TypeScript development for Deno 2.x and Triggerfish with strict patterns.

8|1|Updated Feb 9, 2026
One-click install
npx skills add https://github.com/greghavens/triggerfish --skill mastering-typescript-greghavens
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mastering-typescript
Source: https://github.com/greghavens/triggerfish/tree/main/skills/bundled/mastering-typescript
Command: npx skills add https://github.com/greghavens/triggerfish --skill mastering-typescript-greghavens

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides comprehensive guidance on writing robust, type-safe TypeScript code specifically for the Deno 2.x runtime and the Triggerfish AI platform, ensuring adherence to best practices and project standards.

Core Features & Use Cases

  • Deno 2.x Best Practices: Covers dependency management (deno.json), built-in tooling (deno fmt, deno lint, deno test), and permission handling.
  • Strict TypeScript: Enforces strict mode, prohibits any, and promotes the use of unknown with type guards.
  • Result Pattern: Details the use of Result<T, E> for error handling instead of exceptions.
  • Type Safety: Explains branded types for ID safety and advocates for interface over type for object shapes.
  • Immutability: Guides on using factory functions over classes and ensuring all data structures are immutable.
  • Module Organization: Outlines the project's module structure, including barrel exports via mod.ts and JSDoc comments.
  • Use Case: When developing new TypeScript features for Triggerfish or reviewing existing code, consult this Skill to ensure all code adheres to the project's strict quality and safety standards.

Quick Start

Review the TypeScript code in src/core/utils/formatting.ts to ensure it follows the project's immutability and strictness guidelines.

Frequently Asked Questions about mastering-typescript

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

FAQPage Schema
How do I handle errors in TypeScript without throwing exceptions?

To handle errors in TypeScript without throwing exceptions, implement the Result<T, E> pattern, which forces callers to handle both success and failure paths explicitly for safer runtime behavior.

What's the best way to enforce strict type safety in Deno 2.x projects?

The best way to enforce strict type safety in Deno 2.x projects is enabling strict mode, prohibiting the any type, and using unknown alongside type guards for robust runtime validation.

How do I configure dependencies and tooling for a Deno 2.x TypeScript project?

Configure dependencies and built-in tooling like deno fmt, deno lint, and deno test in a Deno 2.x project by defining them centrally within the deno.json configuration file.

When should I use branded types and immutable interfaces in TypeScript?

Use branded types in TypeScript to prevent ID mix-ups at compile time, and apply immutable interfaces alongside factory functions to ensure all data structures remain immutable.

Does this TypeScript guidance require using classes or factory functions?

This TypeScript guidance requires using factory functions over classes, ensuring all object shapes are defined using interface instead of type to maintain strict immutability.

How do I organize modules and exports in a strict TypeScript project?

Organize modules in a strict TypeScript project by structuring them with barrel exports via mod.ts and adding JSDoc comments to ensure code quality and adherence to project conventions.