Showing 28 verified skills. 284 preview entries are hidden until we confirm a real source. Show preview skills · Why?
Enforce strict TypeScript discipline across your entire project
curl -o .cursorrules https://skills.dev/rules/typescript-strictEnforces strict TypeScript discipline: no any types, explicit return types, exhaustive switch/case, branded types, and discriminated unions.
This is the actual SKILL.md file that powers this skill. Copy it to install.
---
name: cursor-typescript-strict
description: |
Cursor rules enforcing strict TypeScript patterns. Always active when editing
TypeScript files in Cursor. No any types, explicit returns, exhaustive checks.
---
# TypeScript Strict Rules for Cursor
## Core rules
1. **No `any` type.** Use `unknown` for truly unknown values, then narrow
with type guards. Use specific types everywhere else.
2. **Explicit return types** on all exported functions and all functions longer
than 3 lines. Inferred returns are OK for one-liners.
3. **Exhaustive switch/if checks.** Use `satisfies never` in the default case
to catch unhandled union members at compile time.
4. **Readonly by default.** Use `readonly` arrays and `Readonly<T>` for objects
that should not be mutated.
5. **Discriminated unions over optional fields.** Instead of
`{ type?: string; data?: T }`, use `{ type: "a"; data: T } | { type: "b" }`.
## Example: exhaustive check
```typescript
type Status = "active" | "inactive" | "pending";
function getLabel(status: Status): string {
switch (status) {
case "active": return "Active";
case "inactive": return "Inactive";
case "pending": return "Pending";
default: {
const _exhaustive: never = status;
throw new Error(`Unhandled status: ${_exhaustive}`);
}
}
}
```
## tsconfig.json recommendations
```json
{
"compilerOptions": {
"strict": true,
"noUncheckedIndexedAccess": true,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true
}
}
```
## Requirements
- TypeScript 5+
- `strict: true` in tsconfig.json
mkdir -p ~/.claude/skills/cursor-typescript-strict~/.claude/skills/cursor-typescript-strict/SKILL.mdResulting file structure:
~/.claude/
skills/
cursor-typescript-strict/
SKILL.md <-- skill definitionSkills are loaded automatically by Claude Code when you start a new session. The skill name and description in the frontmatter determine when Claude triggers it.
Recommended from shared domain, career, and tool overlap with TypeScript Strict Rules
Generate typed API clients and webhook handlers from specs
Both used by Software Engineer
Audit your UI for WCAG compliance and fix accessibility issues
Both used by Software Engineer
Generate Storybook stories with controls and interaction tests
Both used by Software Engineer
Generate comprehensive error handling with recovery strategies
Both used by Software Engineer
Build GraphQL schemas with resolvers and type-safe client generation
Both used by Software Engineer
Extract strings, manage translations, and validate i18n completeness
Both used by Software Engineer
TypeScript Strict Rules