CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

typescript-best-practices

Type design in TypeScript: discriminated unions, branded types, narrowing, exhaustiveness and boundary validation. Use when modelling domain types, tightening strictness or generics, removing `as` casts, or migrating code to stricter types.

Quality

90%

Does it follow best practices?

Run evals on this skill

Adds up to 20 points to the overall score

View guide
SecuritybySnyk

Passed

No findings from the security scan

SKILL.md
Quality
Evals
Security

Quality

Content

82%Weight 40%Scale 1-5

Reviews the quality of instructions and guidance provided to agents. Good implementation is clear, handles edge cases, and produces reliable results.

The body is an exemplary lean rules reference: opinionated, non-obvious guidance with executable Don't/Do examples and no filler. It falls slightly short of top marks on actionability and workflow because a few headline rules (notably boundary validation) lack code and there is no explicit type-check verification step after applying a refactor.

Suggestions

Add a short boundary-validation example (a parse function turning `unknown` into a named domain type) since it is one of the five capabilities named in the description but has no code in the body.

Include a verification checkpoint such as 'run `tsc` after refactoring a cast away to confirm the substitution type-checks' to close the feedback loop for the Earned cast workflow.

Consider moving the extended pattern write-ups into a references/ file, keeping the rules table plus one flagship example in SKILL.md to lower context cost when only the rules are needed.

DimensionReasoningScore

Conciseness

The body is a dense rules table plus short Don't/Do code contrasts; no basic TypeScript concepts are re-explained and there is no padded prose. Every line carries a rule or an example, matching the 'lean and efficient; every token earns its place' anchor.

5 / 5

Actionability

Mostly executable guidance: real, copy-paste TypeScript for discriminated unions, branded types, NonEmpty tuples, exhaustiveness arms, and `satisfies`. Minor gaps remain — boundary validation (a headline capability in the description), schema-derived types, and object args get directive one-liners in the table but no code example.

4 / 5

Workflow Clarity

There is no multi-step procedure to sequence, but the decision heuristics are explicit: 'Earned cast' gives a four-branch diagnostic for refactoring an `as` away, and 'Simplest total type' lists concrete tells (`!`, `arr[0] as T`, a "should never happen" throw). What keeps it below 5 is the absence of any compile-check validation loop (e.g. 'run tsc to confirm the cast is gone').

4 / 5

Progressive Disclosure

A single well-organized file: a rules table for scanning, a Patterns section for depth, and one clearly signaled external link (the attribution). At ~90 lines it exceeds the under-50-line case where a single file alone earns top marks, and some pattern write-ups could live in a references file, so structure is good but not maximally split.

4 / 5

Total

17

/

20

Passed

Description

92%Weight 40%Scale 1-5

Based on the skill's description, can an agent find and select it at the right time? Clear, specific descriptions lead to better discovery.

A strong description: it names a clear niche, enumerates concrete capabilities, and provides an explicit 'Use when' clause with multiple realistic trigger scenarios. The only gap is a handful of natural synonyms (e.g. 'type safety') that would broaden trigger matching.

DimensionReasoningScore

Specificity

The description lists multiple concrete capabilities — "discriminated unions, branded types, narrowing, exhaustiveness and boundary validation" — plus specific actions like "removing `as` casts" and "migrating code to stricter types". Coverage of the type-design domain is comprehensive rather than a partial list, matching the anchor for multiple specific concrete actions.

5 / 5

Completeness

It explicitly answers both: the "what" is "Type design in TypeScript: discriminated unions, branded types, narrowing, exhaustiveness and boundary validation", and the "when" is a concrete "Use when" clause with four trigger scenarios. This matches the anchor that clearly answers both with concrete trigger phrases.

5 / 5

Trigger Term Quality

Natural phrases users would say are present: "removing `as` casts", "tightening strictness or generics", "modelling domain types", "narrowing". A few common variations are missing (e.g. "type safety", "strict mode", "clean up these types"), so it sits at good-but-not-comprehensive keyword coverage rather than the top anchor.

4 / 5

Distinctiveness Conflict Risk

"Type design in TypeScript" carves a clear niche with distinct triggers ("removing `as` casts", "discriminated unions", "branded types") that no adjacent skill (general TS linting, code review) would claim. Overlap with generic TypeScript skills is minimal because the triggers are type-specific.

5 / 5

Total

19

/

20

Passed

Validation

100%

Checks the skill against the spec for correct structure and formatting. All validation checks must pass before discovery and implementation can be scored.

Validation — 16 / 16 Passed

Validation for skill structure

No warnings or errors.

Repository

monkilabs/opencastle

Path

src/orchestrator/skills/typescript-best-practices/SKILL.md

Reviewed

Table of Contents

Is this your skill?

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.