Expert TypeScript developer specializing in advanced type system usage, full-stack development, and build optimization. This skill should be used PROACTIVELY when working on any TypeScript code - implementing features, reviewing configurations, or debugging type errors. Use unless a more specific subagent role applies.
Enforces strict TypeScript development with zero-tolerance for `any` types, dangling promises, and unsafe patterns while proactively reviewing configurations.
npx claudepluginhub rbergman/dark-matter-marketplaceThis skill inherits all available tools. When active, it can use any tool Claude has access to.
references/eslint.config.jsreferences/gitignorereferences/integration.mdreferences/patterns.mdreferences/tsconfig.strict.jsonSenior-level TypeScript expertise for production projects. Focuses on strict type safety, zero-any tolerance, and TypeScript's full type system capabilities.
tsconfig.json and eslint.config.js for project conventionsRequired:
any - use unknown and narrowas any, as unknown as T)Foundational Principles:
Pin Node version with mise: mise use node@22 (creates .mise.toml — commit it). Team members run mise install. See mise skill for setup.
# Initialize
npm init -y
npm install -D typescript typescript-eslint @eslint-community/eslint-plugin-eslint-comments vitest husky
# Add scripts to package.json:
npm pkg set scripts.typecheck="tsc --noEmit"
npm pkg set scripts.lint="eslint src/"
npm pkg set scripts.test="vitest run"
npm pkg set scripts.check="npm run typecheck && npm run lint && npm run test"
npm pkg set scripts.prepare="husky"
# Set up pre-commit hook
npm run prepare
echo "npm run check" > .husky/pre-commit
chmod +x .husky/pre-commit
# Verify
npm run check
Required Config Files: Copy references/gitignore → .gitignore, then create tsconfig.json and eslint.config.js per the templates below.
git clone <repo> && cd <repo>
just setup # Runs mise trust/install + npm ci
just check # Verify everything works
Or manually:
mise trust && mise install # Get pinned Node version
npm ci # Get dependencies
Why strict configs? Type errors caught at compile time are 10x cheaper than runtime bugs. Strict linting prevents any from leaking through the codebase.
Invoke the just-pro skill for build system setup. It covers:
references/package-ts.just)Alternative: Use npm scripts directly if just is unavailable.
Auto-Fix First - Always try auto-fix before manual fixes:
npx eslint src/ --fix # Fixes style, imports, etc.
npx tsc --noEmit # Type check without emit
Verification:
npm run check # typecheck + lint + test
npm audit --omit=dev --audit-level=high # vulnerability check (production deps only)
Or via just (which combines both):
just check
Pre-commit Hook (automatic if husky configured):
npm run check before every commitIMPORTANT: When creating a new project, use this complete template. Do not omit rules.
import tseslint from 'typescript-eslint';
import eslintComments from '@eslint-community/eslint-plugin-eslint-comments';
export default tseslint.config(
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
files: ['src/**/*.ts', 'src/**/*.tsx'],
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
'@eslint-community/eslint-comments': eslintComments,
},
rules: {
// === TYPE SAFETY (non-negotiable) ===
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unsafe-argument': 'error',
'@typescript-eslint/no-unsafe-assignment': 'error',
'@typescript-eslint/no-unsafe-call': 'error',
'@typescript-eslint/no-unsafe-member-access': 'error',
'@typescript-eslint/no-unsafe-return': 'error',
'@typescript-eslint/no-unsafe-type-assertion': 'error',
'@typescript-eslint/no-non-null-assertion': 'error',
// === PROMISES ===
'@typescript-eslint/no-floating-promises': ['error', { ignoreVoid: true, ignoreIIFE: true }],
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/promise-function-async': 'error',
// === COMPLEXITY LIMITS (enforced) ===
'complexity': ['error', { max: 10 }],
'max-depth': ['error', 4],
'max-lines-per-function': ['error', { max: 60, skipBlankLines: true, skipComments: true }],
'max-lines': ['error', { max: 400, skipBlankLines: true, skipComments: true }],
'max-params': ['error', 4],
// === BLOCK DISABLING CRITICAL RULES ===
'@eslint-community/eslint-comments/no-restricted-disable': ['error',
'@typescript-eslint/no-explicit-any',
'@typescript-eslint/no-unsafe-assignment',
'@typescript-eslint/no-unsafe-argument',
'@typescript-eslint/no-floating-promises',
'complexity', 'max-lines-per-function', 'max-lines',
],
'@eslint-community/eslint-comments/require-description': ['error', { ignore: ['eslint-enable'] }],
// === COMMENTS ===
'@typescript-eslint/ban-ts-comment': ['error', {
'ts-expect-error': 'allow-with-description',
'ts-ignore': true,
'ts-nocheck': true,
minimumDescriptionLength: 10,
}],
// === CONSISTENCY ===
'@typescript-eslint/explicit-module-boundary-types': 'error',
'@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
},
},
// Relax for tests
{
files: ['**/*.test.ts', '**/*.spec.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'max-lines-per-function': 'off',
'max-lines': 'off',
'complexity': 'off',
'@eslint-community/eslint-comments/no-restricted-disable': 'off',
},
},
{ ignores: ['dist/', 'node_modules/', 'coverage/', '*.js', '*.cjs', '*.mjs'] },
);
| Limit | Value | Purpose |
|---|---|---|
max-lines | 400 | Prevent god modules |
max-lines-per-function | 60 | Single responsibility |
complexity | 10 | Cyclomatic complexity cap |
max-depth | 4 | Avoid arrow code |
max-params | 4 | Use options objects |
Critical rules cannot be disabled via eslint-disable comments - the config blocks it.
| Pattern | Use |
|---|---|
unknown over any | Safe default for unknown types |
| Type guards | Runtime narrowing with type safety |
| Discriminated unions | State machines, tagged unions |
| Branded types | Domain modeling (UserId vs string) |
satisfies operator | Validate without widening |
as const | Literal types from values |
| Pattern | Use |
|---|---|
Result<T, E> type | Explicit success/failure |
never exhaustive check | Catch unhandled cases |
| Custom error classes | Typed error discrimination |
| Zod validation | Runtime + compile-time safety |
inferT[K])project/
├── src/
│ ├── index.ts # Entry point / exports
│ ├── types/ # Shared type definitions
│ └── lib/ # Implementation
├── tsconfig.json
├── eslint.config.js
├── package.json
└── justfile
Rules: One module = one purpose. Use barrel exports sparingly. Avoid circular dependencies.
as any or as unknown as T type assertions@ts-ignore instead of @ts-expect-error with reasoneslint-disable to bypass type safety or complexity rules (blocked by config)x! operator) instead of proper narrowingReact 19+: Explicit props typing (avoid FC), use satisfies for configs.
Next.js: Type server components, use Metadata types, type API routes.
Express/Fastify: Type request handlers, use generic route parameters.
See references/integration.md for detailed framework patterns.
Before writing code:
tsconfig.json for compiler options and strict settingseslint.config.js for project-specific lint rulesWhen writing code:
unknown and narrow with type guards - never anyBefore committing:
just check (includes typecheck + lint + test + vulnerability audit)npm run check && npm audit --omit=dev --audit-level=highjust check or turbo run checknpx eslint src/ --fix && npx tsc --noEmit && npm testCreating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code, generative art, algorithmic art, flow fields, or particle systems. Create original algorithmic art rather than copying existing artists' work to avoid copyright violations.
Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.
Create beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations.