
Mastering Typescript
Apply strict TypeScript and ESLint 9 flat-config patterns so solo builders ship typed code with fewer runtime surprises.
Overview
Mastering TypeScript is an agent skill most often used in Build (also Ship review) that equips agents to enforce strict TypeScript and ESLint 9 flat-config standards in real repositories.
Install
npx skills add https://github.com/spillwavesolutions/mastering-typescript-skill --skill mastering-typescriptWhat is this skill?
- Drop-in eslint.config.js for ESLint 9+ using typescript-eslint flat config with strictTypeChecked and stylisticTypeCheck
- Parser uses projectService and tsconfigRootDir for accurate type-aware linting without brittle project paths
- Enforces consistent type-imports (inline-type-imports) for better tree-shaking
- Blocks floating and misused promises, await-thenable mistakes, and nudges nullish coalescing and optional chaining
- Unused bindings allowed only with underscore prefix via argsIgnorePattern and varsIgnorePattern
- ESLint 9+ flat config template using typescript-eslint strictTypeChecked and stylisticTypeChecked presets
- Type-aware parser options with projectService: true and tsconfigRootDir
- Eight explicitly documented custom @typescript-eslint rule overrides in the sample config (unused vars, type imports, pr
Adoption & trust: 553 installs on skills.sh; 21 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
You are shipping TypeScript fast but keep hitting subtle type holes, sloppy imports, and promise bugs that only show up in production or code review.
Who is it for?
Solo builders on ESLint 9+ who want typescript-eslint strict presets and copy-paste eslint.config.js guidance without hiring a platform team.
Skip if: Pure JavaScript repos with no TypeScript migration plan, or teams that need organization-specific compliance rules not covered by the bundled template.
When should I use this skill?
You are writing, refactoring, or reviewing TypeScript and need strict lint and type-import conventions applied via ESLint 9 flat config.
What do I get? / Deliverables
Your project gains a strict, type-aware ESLint flat config and consistent TS conventions agents can apply across modules so refactors and new features stay type-safe end to end.
- Root-level eslint.config.js aligned with the skill’s flat-config pattern
- Consistent type-import and async/promise lint coverage across targeted source files
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Canonical shelf is Build because the skill centers on day-to-day TypeScript authoring, imports, and project tooling—not a one-off launch or ops task. Frontend is the primary shelf for UI-heavy solo SaaS and extension work where TypeScript + ESLint setup is most common, though the same rules apply to Node/API TS projects.
Where it fits
Agent scaffolds eslint.config.js and aligns React or Next components with consistent type-imports before you add new UI routes.
Agent hardens an Express or Hono API handler layer by enabling no-floating-promises and no-misused-promises on async route code.
Before merge, the agent runs type-aware lint fixes on a PR that touched shared DTO types and async jobs.
After a production bug from an unawaited promise, you invoke the skill to extend the same rules to previously exempt modules.
How it compares
Use instead of one-off chat snippets for tsconfig or ESLint—this is a packaged skill that standardizes type-aware lint rules across the whole repo.
Common Questions / FAQ
Who is mastering-typescript for?
It is for solo and indie builders using Claude Code, Cursor, Codex, or similar agents on TypeScript SaaS, APIs, or CLIs who want strict typing and lint gates baked into how the agent edits code.
When should I use mastering-typescript?
During Build when scaffolding or refactoring TS frontends and shared packages; during Ship review before merging risky async or import changes; and during Operate iterate when tightening quality after incidents caused by type or promise mistakes.
Is mastering-typescript safe to install?
Treat it like any third-party agent skill: review what the agent will change in your repo and check the Security Audits panel on this Prism page before relying on it in production workflows.
SKILL.md
READMESKILL.md - Mastering Typescript
// eslint.config.js - ESLint 9+ Flat Config for TypeScript // Copy this file to your project root as eslint.config.js import eslint from '@eslint/js'; import tseslint from 'typescript-eslint'; export default tseslint.config( // Base ESLint recommendations eslint.configs.recommended, // TypeScript strict type-checking ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked, // TypeScript parser configuration { languageOptions: { parserOptions: { projectService: true, tsconfigRootDir: import.meta.dirname } } }, // Custom TypeScript rules { rules: { // Allow unused vars with underscore prefix '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }], // Enforce type imports for better tree-shaking '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', fixStyle: 'inline-type-imports' }], // Prevent unhandled promises '@typescript-eslint/no-floating-promises': 'error', '@typescript-eslint/no-misused-promises': 'error', // Prevent awaiting non-promises '@typescript-eslint/await-thenable': 'error', // Prefer nullish coalescing '@typescript-eslint/prefer-nullish-coalescing': 'error', // Prefer optional chaining '@typescript-eslint/prefer-optional-chain': 'error', // Consistent type assertions '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'as', objectLiteralTypeAssertions: 'never' }], // Naming conventions '@typescript-eslint/naming-convention': [ 'error', { selector: 'interface', format: ['PascalCase'] }, { selector: 'typeAlias', format: ['PascalCase'] }, { selector: 'enum', format: ['PascalCase'] } ] } }, // Ignore patterns { ignores: [ 'dist/**', 'build/**', 'node_modules/**', 'coverage/**', '*.config.js', '*.config.ts' ] } ); { "$schema": "https://json.schemastore.org/tsconfig", "compilerOptions": { // Language and Environment "target": "ES2024", "lib": ["ES2024"], "module": "ESNext", "moduleResolution": "bundler", // Strict Type Checking (Enterprise-Grade) "strict": true, "noUncheckedIndexedAccess": true, "exactOptionalPropertyTypes": true, "noImplicitOverride": true, "noPropertyAccessFromIndexSignature": true, "noFallthroughCasesInSwitch": true, "forceConsistentCasingInFileNames": true, // Module Handling "esModuleInterop": true, "allowSyntheticDefaultImports": true, "isolatedModules": true, "verbatimModuleSyntax": true, // Output "declaration": true, "declarationMap": true, "sourceMap": true, "outDir": "./dist", "rootDir": "./src", // Path Aliases (adjust as needed) "baseUrl": ".", "paths": { "@/*": ["./src/*"] }, // Performance "skipLibCheck": true, "incremental": true, "tsBuildInfoFile": "./node_modules/.cache/tsbuildinfo" }, "include": ["src/**/*"], "exclude": ["node_modules", "dist", "**/*.test.ts", "**/*.spec.ts"] } # Enterprise Patterns Reference > **Load when:** User asks about error handling, validation, project architecture, migration strategies, or large-scale TypeScript patterns. Proven patterns for building maintainable TypeScript applications. ## Contents - [Error Handling](#error-handling) - [Validation Patterns](#validation-patterns) - [Project Organization](#project-organization) - [Migration Strategies](#migration-strategies) - [Security Patterns](#security-patterns) --- ## Error Handling ### Result Type Pattern Instead of throwing exceptions, return typed results: ```typescript // Define Result type type Result<T, E =