CtrlK
BlogDocsLog inGet started
Tessl Logo
SkillPublic

typescript-advanced-design-patterns

TypeScript design patterns that use the type system to enforce correctness at compile time — the builder pattern with required-field tracking, type-safe state machines and event emitters, dependency injection, plugin systems, recursive/deep-readonly utility types, type-safe module encapsulation, advanced generic constraints, and typed API clients. Use when structuring a class or module so invalid usage fails to compile rather than throwing at runtime, e.g. "how do I stop `.build()` being called before required fields are set" or "how do I type an event emitter so payloads match their event name".

Quality

92%

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

86%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.

A well-structured overview: executable BAD/GOOD examples, explicit scope boundaries against sibling skills, and an exemplary references table mapping every pattern topic to a real one-level-deep file. The main improvement opportunity is collapsing the redundant 'When to Apply' / 'Use When' sections and making the pattern-selection-to-verification flow explicit.

Suggestions

Merge 'When to Apply' and 'Use When' (and their overlap with the frontmatter description) into a single trigger section to reclaim tokens without losing coverage.

Add a short ordered workflow (identify the invalid usage to forbid → pick the pattern from the References table → apply the reference example → verify with `npx tsc --noEmit`), including what to do when the check fails.

Consider adding one line under Quick Commands showing expected tsc output or the fix-and-recheck loop, turning the verification step into a true checkpoint.

DimensionReasoningScore

Conciseness

The body is disciplined — the Mindset section is one tight paragraph, WHY lines on anti-patterns are one sentence each, and no basic TypeScript concepts are re-explained. But "When to Apply" (10 bullets) and "Use When" (4 quoted queries) substantially duplicate each other and the frontmatter description, which is trimmable padding. Matches 'Efficient; minor instances of over-explanation that could be trimmed', not level 5's 'every token earns its place'.

4 / 5

Actionability

Three anti-patterns each give complete, executable BAD/GOOD TypeScript pairs (builder with `build(this: UserBuilder<true>)`, constrained `createInstance<T extends new (...args: any[]) => any>`, keyed `emit<K extends keyof T>`), plus a runnable verification command `npx tsc --noEmit`. The code is copy-paste ready and covers the highest-frequency cases, matching 'Fully executable; copy-paste ready code or commands; specific examples cover the common cases'.

5 / 5

Workflow Clarity

Navigation to the right pattern is clear (When to Apply → Scope boundaries → References table with per-file 'Covers' descriptions) and the Quick Commands section provides an explicit verification checkpoint (`npx tsc --noEmit`), reinforced by 'not a substitute for `tsc --noEmit`'. It falls short of level 5 because the locate-pattern → read reference → compile-verify sequence is implied by section order rather than stated as steps with an error-recovery loop; no destructive/batch operations apply, so no cap.

4 / 5

Progressive Disclosure

The body is a lean ~155-line overview; all twelve referenced files (`references/builder.md` through `references/advanced-generics.md`) exist in the bundle and are surfaced in a table with a one-line 'Covers' description each — well-signaled, exactly one level deep, no nesting. This matches 'Clear overview with well-signaled one-level-deep references; content appropriately split; easy navigation'.

5 / 5

Total

18

/

20

Passed

Description

96%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: specific capability list, explicit third-person 'Use when...' guidance with verbatim user-voice trigger examples, and a clear compile-time-correctness niche. The only weakness is unspoken boundary risk against closely related TypeScript type-system sibling skills for utility-type queries.

Suggestions

Add a brief boundary clause to the description (e.g. 'for how conditional/mapped types themselves work, see typescript-type-system') to reduce overlap with sibling skills on utility-type and generic-mechanics queries.

DimensionReasoningScore

Specificity

The description enumerates concrete capabilities: "the builder pattern with required-field tracking, type-safe state machines and event emitters, dependency injection, plugin systems, recursive/deep-readonly utility types, type-safe module encapsulation, advanced generic constraints, and typed API clients" — nine specific, distinct capabilities with no vague filler. This matches the anchor 'Lists multiple specific concrete actions; comprehensive coverage' and exceeds the level-4 anchor's 'minor gaps in coverage'.

5 / 5

Completeness

Both questions are answered explicitly: what — "TypeScript design patterns that use the type system to enforce correctness at compile time" followed by the full capability list; when — "Use when structuring a class or module so invalid usage fails to compile rather than throwing at runtime", reinforced with two concrete example trigger queries. This is a textbook match for the level-5 anchor ('Clearly and explicitly answers both what AND when with concrete trigger phrases'), not the level-4 case where the 'when' is only generic.

5 / 5

Trigger Term Quality

Natural user phrasing is embedded directly: "how do I stop `.build()` being called before required fields are set" and "how do I type an event emitter so payloads match its event name", plus everyday terms like "fails to compile rather than throwing at runtime", "builder pattern", "state machines", "dependency injection", "plugin systems". These are exactly the phrases a user would type when needing this skill, satisfying the comprehensive natural-term anchor; file extensions are not applicable to this non-file-format domain.

5 / 5

Distinctiveness Conflict Risk

The niche is sharply framed — "enforce correctness at compile time" / "invalid usage fails to compile" — and the example queries are unmistakably this skill's territory. However, the description itself claims territory ("recursive/deep-readonly utility types", "advanced generic constraints") that plausibly overlaps with closely related sibling skills mentioned in the body (typescript-utility-types, typescript-type-system), which matches the level-4 anchor 'minor overlap risk with closely related skills' rather than level 5's 'minimal conflict risk'.

4 / 5

Total

19

/

20

Passed

Validation

93%

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

Validation — 15 / 16 Passed

Validation for skill structure

CriteriaDescriptionResult

allowed_tools_field

'allowed-tools' contains unusual tool name(s)

Warning

Total

15

/

16

Passed

Repository

pantheon-org/tekhne

Path

skills/development/typescript-advanced/design-patterns/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.