typescriptWrite type-safe TypeScript with proper narrowing, inference patterns, and strict mode best practices.
Install via ClawdBot CLI:
clawdbot install ivangdavila/typescriptUser needs TypeScript expertise — from basic typing to advanced generics. Agent handles type narrowing, inference, discriminated unions, and strict mode patterns.
| Topic | File |
|-------|------|
| Generic patterns | generics.md |
| Utility types | utility-types.md |
| Declaration files | declarations.md |
| Migration from JS | migration.md |
anyunknown forces you to narrow before use — any silently breaks type safetyunknown, never anyunknown, not anyfilter(Boolean) doesn't narrow — use .filter((x): x is T => Boolean(x))Object.keys(obj) returns string[], not keyof typeof obj — intentional, objects can have extra keysArray.isArray() narrows to any[] — may need assertion for element typein operator narrows but only if property is in exactly one branch of unionlet x = "hello" is string — use const or as const for literal type{ status: "ok" } has status: string — use as const or type annotationfn() can't infer, pass a value or annotatetype or kind field to each variant — enables exhaustive switchdefault: const _never: never = x — compile error if case missedsatisfies vs Type Annotationconst x: Type = val widens to Type — loses literal infoconst x = val satisfies Type keeps literal, checks compatibility — prefer for config objects?. returns undefined, not null — matters for APIs expecting null?? only catches null/undefined — || catches all falsy including 0 and ""! should be last resort — prefer narrowing or early returnimport type for type-only imports — stripped at runtime, avoids bundler issuesexport type { X } — prevents accidental runtime dependency.d.ts augmentation: use declare module with exact module pathGenerated Mar 1, 2026
This scenario involves converting existing JavaScript projects to TypeScript to improve type safety and maintainability. It addresses common migration pitfalls like handling dynamic types and ensuring strict mode compliance, which reduces runtime errors in production.
In this scenario, developers build REST or GraphQL APIs using TypeScript, focusing on proper type definitions for request/response payloads. It emphasizes using unknown over any for external data and implementing discriminated unions for error handling, enhancing reliability in fintech or e-commerce applications.
This scenario involves designing shared TypeScript libraries that leverage generics and utility types for flexibility across projects. It tackles inference limits in nested generics and uses satisfies for config objects, ideal for enterprise software teams aiming for code reusability.
Here, developers integrate TypeScript into React or Angular applications to enforce type safety in UI components. It covers literal type traps with const assertions and module boundaries with import type, reducing bugs in dynamic web interfaces for media or retail industries.
This scenario focuses on extending or fixing type definitions for older JavaScript libraries using .d.ts files. It involves discriminated unions for state management and narrowing failures with filter methods, supporting industries like healthcare where system updates are gradual.
Offer expert guidance to companies migrating to TypeScript, including code audits, training, and best practices implementation. Revenue is generated through hourly or project-based fees, targeting mid-sized tech firms seeking to reduce technical debt.
Develop a cloud-based tool that scans TypeScript codebases for anti-patterns like any usage or narrowing failures, providing automated reports and fixes. Revenue comes from subscription tiers based on team size and features, appealing to large enterprises.
Create online courses and certifications focused on advanced TypeScript topics such as generics and strict mode. Revenue is generated from course sales and certification fees, targeting individual developers and corporate training programs in the education sector.
💬 Integration Tip
Use import type for type-only dependencies to avoid runtime bloat, and leverage satisfies for configuration objects to maintain literal types while ensuring compatibility.
Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.
Provides a 7-step debugging protocol plus language-specific commands to systematically identify, verify, and fix software bugs across multiple environments.
A comprehensive skill for using the Cursor CLI agent for various software engineering tasks (updated for 2026 features, includes tmux automation guide).
Write, run, and manage unit, integration, and E2E tests across TypeScript, Python, and Swift using recommended frameworks.
Control and operate Opencode via slash commands. Use this skill to manage sessions, select models, switch agents (plan/build), and coordinate coding through Opencode.
Coding style memory that adapts to your preferences, conventions, and patterns for consistent coding.