
Typescript
Enforces strict TypeScript patterns with a focus on const object mappings over raw union types, flat interfaces, and discriminated unions for coupled optional props. Auto-triggers when you're writing types or interfaces. The const-first pattern is opinionated but solid: you define a const object then extract the type, giving you runtime values and a single source of truth. The coupled optionals section is the most interesting bit, using discriminated unions with never to prevent half-states like having onPageChange without currentPage. Includes type guards, utility type quick reference, and a hard ban on any. Good for teams that want consistency without having to debate these choices in every PR.
- skills.sh installs
- 254
- GitHub stars
- 15.2K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add prowler-cloud/prowler --skill typescript --agent claude-codeInstalls into .claude/skills of the current project.
Files
Const Types Pattern (REQUIRED)
// ✅ ALWAYS: Create const object first, then extract type
const STATUS = {
ACTIVE: "active",
INACTIVE: "inactive",
PENDING: "pending",
} as const;
type Status = (typeof STATUS)[keyof typeof STATUS];
// ❌ NEVER: Direct union types
type Status = "active" | "inactive" | "pending";
Why? Single source of truth, runtime values, autocomplete, easier refactoring.
When you need the ordered list too (iteration, z.enum), a const array works the same way:
// ui/types/severities.ts
export const SEVERITY_LEVELS = ["critical", "high", "medium", "low", "informational"] as const;
export type SeverityLevel = (typeof SEVERITY_LEVELS)[number];
// Known key set -> Record<Union, ...> (typos fail to compile)
export const SEVERITY_DISPLAY_NAMES: Record<SeverityLevel, string> = { /* ... */ };
Flat Interfaces (REQUIRED)
// ✅ ALWAYS: One level depth, nested objects → dedicated interface
interface UserAddress {
street: string;
city: string;
}
interface User {
id: string;
name: string;
address: UserAddress; // Reference, not inline
}
Sponsors
Details
- Repository
- github.com/prowler-cloud/prowler
- Categories
- Frontend Development, Code Review & Quality, Cloud & Infrastructure
- First seen
- Jun 3, 2026