home / skills / pluginagentmarketplace / custom-plugin-typescript / fundamentals
This skill helps you master TypeScript fundamentals, enabling safe typing with basic types, interfaces, and type annotations for robust code.
npx playbooks add skill pluginagentmarketplace/custom-plugin-typescript --skill fundamentalsReview the files below or copy the command above to add this skill to your agents.
---
name: fundamentals
description: TypeScript type system fundamentals and basic typing patterns
sasmp_version: "1.3.0"
bonded_agent: 01-typescript-fundamentals
bond_type: PRIMARY_BOND
---
# TypeScript Fundamentals Skill
## Overview
Master TypeScript's type system fundamentals including basic types, interfaces, and type annotations.
## Topics Covered
### Basic Types
- Primitive types (string, number, boolean)
- Arrays and tuples
- Enums
- Any, unknown, never, void
- Null and undefined handling
### Type Annotations
- Variable annotations
- Function parameters and returns
- Object type annotations
- Type inference
- Type assertions
### Interfaces
- Interface declaration
- Optional properties
- Readonly properties
- Index signatures
- Interface extension
### Type Aliases
- Type alias syntax
- Union types
- Intersection types
- Literal types
- Type narrowing
### Functions
- Function type expressions
- Call signatures
- Overloads
- Generic functions
- Rest parameters
## Prerequisites
- JavaScript fundamentals
- ES6+ features
## Learning Outcomes
- Write type-safe code
- Use interfaces effectively
- Apply type narrowing
- Understand type inference
This skill teaches TypeScript type system fundamentals and common typing patterns to help you write safer, more predictable code. It covers primitive and composite types, interfaces, type aliases, function typing, and essential concepts like type inference and narrowing. By the end, you will be able to add clear, maintainable types to JavaScript projects.
The skill presents concise explanations and examples for each core topic: basic types, annotations, interfaces, aliases, and function types. It highlights practical patterns such as optional and readonly properties, union/intersection types, generics, and overloads, and shows how type inference and assertions interact with explicit annotations. Each concept is framed around typical coding scenarios so you can apply types incrementally to an existing codebase.
When should I use an interface vs a type alias?
Use interfaces to describe object shapes and support declaration merging; use type aliases for unions, intersections, primitives, and more complex type expressions.
Is it okay to use any during migration?
Temporary use of any can speed migration, but prefer unknown or gradual typing techniques to avoid losing type safety permanently.