Describe the job
Write: When this situation happens, this user needs to achieve this result, so they can get this benefit. Avoid naming your solution in the problem statement.
Draw the one path
For an invoice reminder tool, the thin path might be upload CSV, validate rows, generate reminders, review, and export. Authentication dashboards and team permissions can wait.
Choose failure behavior
Define what happens with missing data, duplicate records, network errors, and retries. Reliability is part of scope.
Measure the outcome
Pick one activation event that proves the user reached value. Product analytics should answer a decision, not merely collect events.
Working example
from dataclasses import dataclass
@dataclass(frozen=True)
class Reminder:
customer: str
email: str
amount_cents: int
def create_reminder(row: dict[str, str]) -> Reminder:
amount = int(row["amount_cents"])
if amount <= 0:
raise ValueError("amount must be positive")
email = row["email"].strip().lower()
if "@" not in email:
raise ValueError("email is invalid")
return Reminder(row["customer"].strip(), email, amount)