typescript
This skill establishes a TypeScript development environment with strict compiler options, ESLint rules, and Jest test coverage. It provides project structure templates, tooling configuration, and GitHub Actions workflows to maintain code quality and type safety across your codebase.
TypeScript skill configures strict mode, ESLint linting, and Jest testing for type-safe development.
AI-generated summary based on this skill's SKILL.md
Install
alinaqi/maggy/typescript · repository language: Python
git clone https://github.com/alinaqi/maggy
cp -r maggy/skills/typescript ~/.claude/skills/typescriptnpx skillfed install alinaqi/maggy/typescriptFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How do I configure TypeScript strict compiler options?
TypeScript's strict mode enables multiple compiler flags that enforce type safety. In your tsconfig.json, set "strict": true to activate all strict checks at once, or enable individual flags like "noImplicitAny", "strictNullChecks", "strictFunctionTypes", and "noImplicitThis". This skill provides templates showing which strict options work best for different project types and how to gradually adopt them in existing codebases.
What's the best way to set up TypeScript with strict mode, ESLint, and Jest?
TypeScript setup combines three layers: configure tsconfig.json with strict mode enabled, install ESLint with typescript-eslint parser and recommended rules, then add Jest with ts-jest preset for type-aware testing. This skill walks through each tool's configuration, shows how they integrate, and provides a complete starter template that includes pre-commit hooks via Husky to catch issues before code reaches your repository.
How should I organize a TypeScript project structure?
TypeScript project structure best practices emphasize clear separation of concerns: keep source code in src/, tests alongside or in a dedicated test/ folder, configuration files at the root, and build output in dist/. This skill provides folder templates for different project types—libraries, APIs, full-stack apps—with guidance on where to place types, utilities, domain logic, and infrastructure code for maximum maintainability.
What are TypeScript type safety patterns and anti-patterns to avoid?
TypeScript type safety patterns include branded types for domain-specific values, discriminated unions for exhaustive type narrowing, and type guards over assertions. Anti-patterns to avoid include using any, over-relying on type assertions, and loose union types without discrimination. This skill covers these patterns with real examples, showing how each improves code reliability and how to refactor unsafe code into safer alternatives.
How do I set up automated quality gates with GitHub Actions?
TypeScript quality gates combine type checking, linting, and test coverage in CI/CD pipelines. This skill provides GitHub Actions workflow templates that run tsc for type checking, ESLint for code quality, and Jest with coverage thresholds. The workflows fail the build if type errors occur, linting rules are violated, or test coverage drops below your threshold, ensuring every merged commit meets your standards.
How can I implement runtime validation with Zod in TypeScript?
Zod provides runtime schema validation that generates TypeScript types automatically, bridging the gap between compile-time and runtime safety. This skill shows how to define Zod schemas for API responses, form data, and configuration, then extract TypeScript types using z.infer<>. Examples include validating external data, creating type-safe API clients, and handling validation errors gracefully in your application.
SKILL.md
rendered from the published skill — quoted content, verbatim
TypeScript Skill
Strict Mode (Non-Negotiable)
// tsconfig.json
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true
}
}
Project Structure
project/
├── src/
│ ├── core/ # Pure business logic
│ │ ├── types.ts # Domain types/interfaces
│ │ ├── services/ # Pure functions
│ │ └── index.ts # Public API
│ ├── infra/ # Side effects
│ │ ├── api/ # HTTP handlers
│ │ ├── db/ # Database operations
│ │ └── external/ # Third-party integrations
│ └── utils/ # Shared utilities
├── tests/
│ ├── unit/
│ └── integration/
├── package.json
├── tsconfig.json
└── CLAUDE.md
Tooling
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 1 file
skills/typescript/SKILL.md