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
A flaky test is one that sometimes passes and sometimes fails without code changes. Fix or quarantine flaky tests immediately - they erode trust in the entire suite.
Incorrect (ignoring flaky tests):
test('processes concurrent requests', async () => {
// Race condition - passes 90% of the time
const results = await Promise.all([
service.process(request1),
service.process(request2)
])
// Sometimes fails due to timing
expect(results[0].completedBefore(results[1])).toBe(true)
})
// Team learns to just re-run failed builds
// Eventually ignores all test failures
// Real bugs slip throughCorrect (fix the root cause):
test('processes requests in order received', async () => {
// Control the timing explicitly
const processOrder: string[] = []
const mockProcessor = {
process: jest.fn().mockImplementation(async (req) => {
processOrder.push(req.id)
return { id: req.id, timestamp: Date.now() }
})
}
const service = new RequestService(mockProcessor)
await service.processInOrder([
{ id: 'req-1' },
{ id: 'req-2' }
])
// Assert on the controlled behavior
expect(processOrder).toEqual(['req-1', 'req-2'])
})
// Alternative: fix the async timing issue
test('handles concurrent requests', async () => {
const startTime = Date.now()
const results = await Promise.all([
service.process(request1),
service.process(request2)
])
// Assert on stable properties, not timing
expect(results).toHaveLength(2)
expect(results.every(r => r.status === 'completed')).toBe(true)
})Flaky test triage:
Common causes:
Reference: Flaky Tests Mitigation - Semaphore
Install with Tessl CLI
npx tessl i pantheon-ai/test-driven-developmentevals
scenario-1
scenario-2
scenario-3
scenario-4
scenario-5
references