strict-typescript-modelisted
Install: claude install-skill freitasp1/claude-code-skills
# Strict TypeScript Mode
This skill enforces TypeScript best practices based on the State-of-the-Art Guide 2025.
## When to Activate
- When working with `.ts` or `.tsx` files
- On new feature implementations
- During code reviews
- When refactoring JavaScript to TypeScript
## Strict Rules
### 1. NEVER use `any` without documentation
```typescript
// 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;
}
```
### 2. Explicit Types for Public APIs
```typescript
// 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) => { ... };
```
### 3. Use Generic Constraints
```typescript
// 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>(o