skills/strict-typescript-mode/SKILL.md
Enforces TypeScript best practices when writing code. Automatically enables strict typing for TypeScript projects, prevents `any` usage, and recommends generic constraints. Activate on TS/TSX files, new features, code reviews.
npx skillsauth add svenja-dev/claude-code-skills strict-typescript-modeInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill enforces TypeScript best practices based on the State-of-the-Art Guide 2025.
.ts or .tsx filesany without documentation// FORBIDDEN
function process(data: any) { ... }
// ALLOWED (with justification)
// eslint-disable-next-line @typescript-eslint/no-explicit-any
// Reason: External API returns untyped data, validated at runtime
function processExternal(data: any) { ... }
// BETTER: Use unknown with Type Guard
function process(data: unknown): ProcessedData {
if (!isValidData(data)) throw new Error('Invalid data');
return data as ProcessedData;
}
// FORBIDDEN: Implicit return types on exports
export const calculate = (x, y) => x + y;
// REQUIRED: Explicit types
export const calculate = (x: number, y: number): number => x + y;
// For React Components
interface ButtonProps {
label: string;
onClick: () => void;
variant?: 'primary' | 'secondary';
}
export const Button = ({ label, onClick, variant = 'primary' }: ButtonProps) => { ... };
// FORBIDDEN: Unbounded generic
function getValue<T>(obj: T, key: string) {
return obj[key]; // Error
}
// REQUIRED: Constrained generic
function getValue<T extends object, K extends keyof T>(obj: T, key: K): T[K] {
return obj[key];
}
// Instead of duplication:
interface UserBase { name: string; email: string; }
interface UserCreate { name: string; email: string; }
interface UserUpdate { name?: string; email?: string; }
// Use Utility Types:
interface User { id: string; name: string; email: string; createdAt: Date; }
type UserCreate = Omit<User, 'id' | 'createdAt'>;
type UserUpdate = Partial<Pick<User, 'name' | 'email'>>;
interface Config {
readonly apiUrl: string;
readonly timeout: number;
}
// For arrays
const items: readonly string[] = ['a', 'b'];
// or
const items: ReadonlyArray<string> = ['a', 'b'];
// Without const assertion
const STATUS = { ACTIVE: 'active', INACTIVE: 'inactive' };
// Type: { ACTIVE: string; INACTIVE: string }
// With const assertion
const STATUS = { ACTIVE: 'active', INACTIVE: 'inactive' } as const;
// Type: { readonly ACTIVE: "active"; readonly INACTIVE: "inactive" }
// Instead of optional properties:
interface Response {
data?: Data;
error?: Error;
loading?: boolean;
}
// Use Discriminated Unions:
type Response =
| { status: 'loading' }
| { status: 'success'; data: Data }
| { status: 'error'; error: Error };
{
"compilerOptions": {
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"forceConsistentCasingInFileNames": true
}
}
any without documented reasondevelopment
Protects design and theme files from unintended changes. Locks tailwind.config, global CSS, and theme variables. Requires explicit confirmation before modifying UI components. Activate on changes to CSS, theme config, or layout components.
tools
Proactive token budget assessment and task chunking strategy. Use this skill when queries involve multiple large file uploads, requests for comprehensive multi-document analysis, complex multi-step workflows with heavy research (10+ tool calls), phrases like "complete analysis", "full audit", "thorough review", "deep dive", or tasks combining extensive research with large output artifacts. This skill helps assess token consumption risk early and recommend chunking strategies before beginning work.
development
Erzwingt striktes Test-Driven Development mit Red-Green-Refactor Zyklus. Blockiert Code-Generierung ohne vorherige Tests. Dokumentiert 13 ungueltige Rationalisierungen. Aktivieren bei neuen Features, Bug Fixes, Refactoring.
development
Erarbeitet mit dem User eine Spezifikation bevor Code geschrieben oder an CC/Sonnet delegiert wird. Prueft Kontext, Ziel, Abnahmekriterien, Constraints. Erzeugt SPEC.md oder CC-Prompt mit Self-Fix-Protokoll. Triggern bei: Spec, Spezifikation, SPEC.md, CC-Prompt, Sonnet-Prompt, "delegate an CC", "was brauchst du noch", "plan das erstmal", "bevor du loslegst", groessere Features, mehrstufige Aufgaben, unklare Abnahmekriterien. Im Zweifel User fragen. Ersetzt cc-prompt-builder.