Install any skill in seconds. Free to start, no credit card required.
Get Started Free →zrosenbauer/ts-best-practices
This skill should be used when the user wants to write, review, or refactor TypeScript code to follow industry best practices. Common triggers include "follow ts best practices", "review this typescript", "fix the typescript style", "make this idiomatic typescript", "apply typescript conventions", and "audit this ts file". Bakes in branded types, discriminated unions, ts-pattern for multi-branch logic, JSDoc on exports, kebab-case file naming, and *Params/*Options object-arg conventions. Skip wh
Passed 17 of 25 test cases with the skill, and 13 of 25 without it.
and 8 more in the full report
9 fixed8 passed either way3 still failing5 broke
Tokens, turns and time describe resource use, not a dollar price.
One of 9 test cases the skill fixed. Same model, same prompt, with and without the skill.
Write TypeScript declarations for maximum retry limit (integer 5) and an object mapping environment names ('development', 'staging', 'production') to their API URLs.
| Checked | Without skill | With skill |
|---|---|---|
| Uses SCREAMING_SNAKE_CASE for constant names | Passed | Passed |
| Applies as const to the environment mapping object definition | Missed | Passed |
The instructions your model reads when the skill loads.
Write, review, and refactor TypeScript code to follow battle-tested conventions: object-arg parameters, JSDoc on exports, discriminated unions for variants, branded types for IDs, ts-pattern for multi-branch logic, and exports-first file structure.
| Element | Convention | Example |
|---|---|---|
| Files | kebab-case.ts | user-service.ts, auth-types.ts |
| Variables | camelCase | userId, isAuthenticated |
| Functions | camelCase (verbs) | createUser, parseHeaders |
| Types/interfaces | PascalCase | User, CreateUserParams |
| Constants | SCREAMING_SNAKE_CASE | MAX_RETRIES = 3 |
| Const objects | SCREAMING_SNAKE_CASE keys with as const | GITHUB_EVENTS = { PUSH: 'push' } as const |
Object properties: prefer nested when properties form a logical group; flat for standalone values.
Top-to-bottom order in every .ts file:
@pkg/*, relative — blank line between groups)test cases passed, vs 13 / 25 without
Published skills whose descriptions closely match this one, with their headline benchmark lift.
More skills from the same source and nearby in the registry, with their headline benchmark lift.