Apply direct, functional TypeScript and JavaScript coding style preferences. Use when writing, editing, reviewing, or refactoring TS/JS code; deciding whether to introduce classes, factories, helpers, wrappers, utilities, shared modules, types vs interfaces, validation boundaries, or recoverable error handling; or when the user asks for code that matches these personal style preferences.
92
88%
Does it follow best practices?
Impact
100%
1.20xAverage score across 3 eval scenarios
Passed
No known issues
Apply these preferences as an overlay on top of local project conventions. If repository instructions or nearby code clearly require a different pattern, follow the local convention and keep the change consistent.
Prefer direct, functional TypeScript.
Avoid abstractions that only rename obvious operations.
Avoid trivial wrappers — inline instead:
// Don't wrap: const label = parseStringValue(raw.label)
// Do inline: const label = String(raw.label)Prefer — extract when the helper names a real domain concept:
// Worth extracting: encapsulates non-trivial business logic
function resolveSubscriptionStatus(account: Account): SubscriptionStatus {
if (account.trialEndsAt > Date.now()) return "trial";
if (account.cancelledAt) return "cancelled";
return account.planId ? "active" : "free";
}Keep ownership clear and put reusable infrastructure in shared modules.
Avoid — factory function for simple configuration:
function createUserService(db: Database) {
return {
getUser: (id: string) => db.find("users", id),
saveUser: (user: User) => db.insert("users", user),
};
}Prefer — concrete named exports, with an optional grouped object:
export function getUser(db: Database, id: string) {
return db.find("users", id);
}
export function saveUser(db: Database, user: User) {
return db.insert("users", user);
}
// Optional grouping at the end of the module
export const userService = { getUser, saveUser };Use type by default.
type for object shapes, unions, function inputs, and local module types.interface only for an intentional public contract meant to be extended, implemented, augmented, or consumed across module boundaries.Separate reusable schemas and types into obvious local files.
schemas.ts.types.ts.schemas.ts and types.ts files over broad shared files unless the definitions are genuinely shared across features.Prefer explicit tagged errors for recoverable async operations.
tag field.null or undefined as vague failure signals.Example shape:
type FetchUserResult =
| { tag: "success"; user: User }
| { tag: "not_found" }
| { tag: "request_failed"; message: string };Preserve validation and explicitness.
Before finishing a change, scan for style drift:
type unless an extensible public contract is intended?schemas.ts and reusable TypeScript types in types.ts, without splitting single/local-only definitions prematurely?51dd9ad
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.