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
EcommerceFlow's shopping cart system has been causing customer complaints due to incorrect total calculations. The QA team has identified specific scenarios where the cart total is wrong: bulk discounts aren't being applied correctly, and tax calculations seem inconsistent across different product categories.
The customer support team has escalated this as a high-priority issue because customers are abandoning purchases at checkout when they see unexpected totals. The business team suspects the issue is in the cart calculation logic, but they need the bug reproduced and fixed quickly to prevent further revenue loss.
Your task is to:
The system should calculate cart totals considering:
Required files:
Extract the following existing cart implementation before beginning:
FILE: inputs/cart.ts
export class ShoppingCart {
private items: CartItem[] = [];
addItem(item: CartItem): void {
this.items.push(item);
}
calculateTotal(): number {
const subtotal = this.items.reduce((sum, item) =>
sum + (item.price * item.quantity), 0);
const discount = subtotal > 100 ? subtotal * 0.1 : 0;
const tax = this.items.reduce((sum, item) =>
sum + (item.category === 'books' ? 0 : item.price * item.quantity * 0.08), 0);
const shipping = subtotal > 50 ? 0 : 5;
// Bug: discount not being subtracted correctly
return subtotal + tax + shipping;
}
getItems(): CartItem[] {
return this.items;
}
}
export interface CartItem {
name: string;
price: number;
quantity: number;
category: string;
}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