Master Test-Driven Development with deterministic red-green-refactor workflows, test-first feature delivery, bug reproduction through failing tests, behavior-focused assertions, and refactoring safety; use when implementing new functions, changing APIs, fixing regressions, or restructuring code under test.
Does it follow best practices?
Evaluation — 86%
↑ 1.05xAgent success when using this tile
Validation for skill structure
For frequently-tested domain concepts, create custom matchers that express intent clearly and provide helpful failure messages.
Incorrect (repeated complex assertions):
test('creates valid order', () => {
const order = createOrder(orderData)
// Repeated validation logic in every test
expect(order.id).toMatch(/^ORD-\d{8}$/)
expect(order.status).toBe('pending')
expect(order.items.length).toBeGreaterThan(0)
expect(order.total).toBeGreaterThan(0)
expect(order.createdAt).toBeInstanceOf(Date)
})
test('checkout produces valid order', () => {
const order = await checkout(cart)
// Same checks duplicated
expect(order.id).toMatch(/^ORD-\d{8}$/)
expect(order.status).toBe('pending')
expect(order.items.length).toBeGreaterThan(0)
expect(order.total).toBeGreaterThan(0)
expect(order.createdAt).toBeInstanceOf(Date)
})Correct (custom domain matcher):
// test-utils/matchers.ts
expect.extend({
toBeValidOrder(received: unknown) {
const order = received as Order
const errors: string[] = []
if (!order.id?.match(/^ORD-\d{8}$/)) {
errors.push(`Invalid order ID: ${order.id}`)
}
if (order.status !== 'pending') {
errors.push(`Expected status 'pending', got '${order.status}'`)
}
if (!order.items?.length) {
errors.push('Order has no items')
}
if (!order.total || order.total <= 0) {
errors.push(`Invalid total: ${order.total}`)
}
return {
pass: errors.length === 0,
message: () => errors.join('\n')
}
}
})
// Clean, expressive tests
test('creates valid order', () => {
const order = createOrder(orderData)
expect(order).toBeValidOrder()
})
test('checkout produces valid order', () => {
const order = await checkout(cart)
expect(order).toBeValidOrder()
})Good candidates for custom matchers:
Reference: Jest Custom Matchers
Install with Tessl CLI
npx tessl i pantheon-ai/test-driven-development@0.2.4evals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
references