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
Snapshots are useful for detecting unintended changes but can become meaningless if overused. Use them for stable outputs and review changes carefully.
Incorrect (snapshot everything):
test('user service', () => {
const user = userService.create({ name: 'Alice', email: 'alice@test.com' })
// Snapshot includes timestamps, IDs - breaks on every run
expect(user).toMatchSnapshot()
})
test('renders user list', () => {
const component = render(<UserList users={mockUsers} />)
// 500-line snapshot that nobody reviews
expect(component).toMatchSnapshot()
})
// When snapshot fails, developer just runs `--updateSnapshot`
// without actually reviewing what changedCorrect (targeted snapshots):
test('user has expected structure', () => {
const user = userService.create({ name: 'Alice', email: 'alice@test.com' })
// Snapshot only stable parts
expect({
name: user.name,
email: user.email,
role: user.role
}).toMatchSnapshot()
})
test('error message format', () => {
const error = validateUser({ email: 'invalid' })
// Snapshots work well for error message text
expect(error.message).toMatchSnapshot()
})
// Prefer explicit assertions for behavior
test('renders correct number of users', () => {
const { getAllByRole } = render(<UserList users={mockUsers} />)
expect(getAllByRole('listitem')).toHaveLength(mockUsers.length)
})
// Inline snapshots for small, reviewable outputs
test('formats date correctly', () => {
const formatted = formatDate(new Date('2024-06-15'))
expect(formatted).toMatchInlineSnapshot(`"June 15, 2024"`)
})Snapshot best practices:
Reference: Snapshot Testing - Jest
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