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
Run independent tests in parallel to reduce total suite execution time. Design tests to be isolation-safe for parallel execution.
Incorrect (sequential execution):
// jest.config.js
module.exports = {
maxWorkers: 1 // Forces sequential execution
}
// Tests share database state
describe('UserService', () => {
beforeAll(async () => {
await db.users.deleteMany({}) // Clears ALL users
})
test('creates user', async () => {
await userService.create({ id: 'user-1', name: 'Alice' })
const count = await db.users.count()
expect(count).toBe(1) // Assumes no other tests created users
})
})
// Other test file accessing same table
describe('OrderService', () => {
test('associates order with user', async () => {
// Fails if UserService tests haven't run yet
const order = await orderService.create({ userId: 'user-1' })
expect(order.userId).toBe('user-1')
})
})Correct (parallel-safe tests):
// jest.config.js
module.exports = {
maxWorkers: '50%' // Use half of available CPUs
}
// Tests use unique identifiers
describe('UserService', () => {
test('creates user', async () => {
const userId = `user-${Date.now()}-${Math.random()}`
await userService.create({ id: userId, name: 'Alice' })
const user = await db.users.findById(userId)
expect(user).toBeDefined()
})
})
// Each test is independent
describe('OrderService', () => {
test('associates order with user', async () => {
// Creates its own test data
const user = await createTestUser()
const order = await orderService.create({ userId: user.id })
expect(order.userId).toBe(user.id)
})
})Parallel-safety checklist:
Configuration:
maxWorkers in configthreads optionpytest-xdist pluginReference: Jest Configuration - maxWorkers
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