Auto-generated tile from GitHub (10 skills)
92
94%
Does it follow best practices?
Impact
92%
1.16xAverage score across 44 eval scenarios
Advisory
Suggest reviewing before use
A fintech startup is building a payment processing service that handles accounts, payments, and refunds. After several production incidents — one where a paymentId was accidentally passed to a function expecting an accountId, and another where unvalidated user input reached a database write — the engineering team has decided to add stricter type-level guarantees to the domain model.
The core problems:
refund, chargeback) and some handlers were not updated, causing silent no-ops.The team wants a reference implementation of the domain type layer that future engineers can follow when adding new entity types or event variants.
Produce the following files:
domain-types.ts — branded type definitions for at least AccountId and PaymentId, plus a discriminated union for at least three payment event variants (e.g., deposit, withdrawal, refund).validators.ts — validation utilities: assertion functions for at least two of the branded types, at least one type-predicate function, and a handler function that processes each event variant exhaustively.usage-example.ts — a short example showing:
// @ts-expect-error comment on a line that passes the wrong branded type to a function expecting a different one, proving the type system catches it.All files must compile with TypeScript with zero errors (excluding // @ts-expect-error lines). Include a tsconfig.json if needed.
evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
scenario-10
scenario-11
scenario-12
scenario-13
scenario-14
scenario-15
scenario-16
scenario-17
scenario-18
scenario-19
scenario-20
scenario-21
scenario-22
scenario-23
scenario-24
scenario-25
scenario-26
scenario-27
scenario-28
scenario-29
scenario-30
scenario-31
scenario-32
scenario-33
scenario-34
scenario-35
scenario-36
scenario-37
scenario-38
scenario-39
scenario-40
scenario-41
scenario-42
scenario-43
scenario-44
skills
documentation
fastify
init
linting-neostandard-eslint9
node
nodejs-core
rules
oauth
octocat
snipgrapher