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
Create shared test utilities for common operations. Keep them in a dedicated location so all tests can use consistent patterns.
Incorrect (duplicated test code):
// user.test.ts
test('creates user', async () => {
const response = await request(app)
.post('/api/users')
.set('Authorization', `Bearer ${await getTestToken()}`)
.set('Content-Type', 'application/json')
.send({ email: 'test@example.com', name: 'Test' })
expect(response.status).toBe(201)
})
// order.test.ts
test('creates order', async () => {
// Same boilerplate repeated
const response = await request(app)
.post('/api/orders')
.set('Authorization', `Bearer ${await getTestToken()}`)
.set('Content-Type', 'application/json')
.send({ items: [{ productId: '123', quantity: 1 }] })
expect(response.status).toBe(201)
})Correct (extracted utilities):
// test-utils/api.ts
export function createApiClient(token?: string) {
const client = {
async post<T>(path: string, body: unknown): Promise<ApiResponse<T>> {
const req = request(app)
.post(path)
.set('Content-Type', 'application/json')
if (token) {
req.set('Authorization', `Bearer ${token}`)
}
return req.send(body)
},
// get, put, delete...
}
return client
}
export async function authenticatedClient() {
const token = await getTestToken()
return createApiClient(token)
}
// user.test.ts
test('creates user', async () => {
const api = await authenticatedClient()
const response = await api.post('/api/users', {
email: 'test@example.com',
name: 'Test'
})
expect(response.status).toBe(201)
})
// order.test.ts
test('creates order', async () => {
const api = await authenticatedClient()
const response = await api.post('/api/orders', {
items: [{ productId: '123', quantity: 1 }]
})
expect(response.status).toBe(201)
})Common test utilities:
Reference: Jest Manual - Setup Files
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