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
Use beforeEach/afterEach for common setup that applies to all tests in a block. Avoid hooks when they obscure test behavior or create hidden dependencies.
Incorrect (hooks hide test behavior):
describe('OrderService', () => {
let service: OrderService
let user: User
let product: Product
let cart: Cart
beforeEach(async () => {
service = new OrderService()
user = await createUser({ tier: 'premium' }) // Why premium?
product = await createProduct({ price: 100 }) // Why 100?
cart = await createCart({ userId: user.id })
await cart.addItem(product.id, 2) // Why 2 items?
})
test('calculates total', () => {
// Reader must check beforeEach to understand test
const total = service.calculateTotal(cart)
expect(total).toBe(200) // Unexplained number, unclear where it comes from
})
})Correct (hooks for infrastructure, tests show data):
describe('OrderService', () => {
let service: OrderService
// Hook for infrastructure only
beforeEach(() => {
service = new OrderService()
})
afterEach(async () => {
await cleanupTestOrders()
})
test('calculates total from item prices and quantities', () => {
// Test shows all relevant data
const cart = createCart({
items: [
{ productId: 'p1', price: 100, quantity: 2 },
{ productId: 'p2', price: 50, quantity: 1 }
]
})
const total = service.calculateTotal(cart)
expect(total).toBe(250) // 100*2 + 50*1, reader can verify
})
test('applies premium discount', () => {
const cart = createCart({
items: [{ productId: 'p1', price: 100, quantity: 1 }],
userTier: 'premium' // Explicit: test is about premium discount
})
const total = service.calculateTotal(cart)
expect(total).toBe(90) // 10% premium discount
})
})Guidelines:
Reference: Jest Setup and Teardown
Install with Tessl CLI
npx tessl i pantheon-ai/test-driven-developmentevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
references