Doubt-Driven Development
Overview
The first workable idea gets defended; a better second idea never gets considered. This skill institutionalizes doubt at the moments it pays: before committing to a decision that is expensive to reverse, deliberately attack it — enumerate failure modes, steelman one alternative, and try to break the plan on paper where breaking is free. Doubt is a tool applied at decision points, not a mood applied to everything.
When to Use
- Architecture decisions: module boundaries, offline/sync model, state management approach (see
android-architecture)
- Data migrations: Room schema changes, DataStore format changes — anything touching persisted user data (see
android-data-persistence)
- Adopting or replacing a dependency the codebase will grow around
- Public or cross-team API contracts (see
api-and-interface-design)
- minSdk/targetSdk bumps and platform-behavior migrations (see
deprecation-and-migration)
Skip when: The decision is cheap to reverse (naming, private helpers, a screen's internal layout). Applying this to every choice is procrastination with extra steps.
Core Process
Step 1: Write the Decision Down First
- One paragraph, falsifiable: what is being decided, what it optimizes for, what it deliberately gives up. If it can't be written down, it can't be attacked.
Decision: store sync state in a Room table per entity (not a global
DataStore flag). Optimizes for per-item retry and conflict tracking.
Gives up: simpler global "is syncing" UI state.
Step 2: Attack It
- Enumerate concrete failure modes — Android-specific ones first:
- Process death mid-sync: is a row ever stuck in SYNCING forever?
- Migration: what happens to existing rows when the enum gains a value?
- Doze: WorkManager retry backoff vs. per-row retry counts — double retry?
- 10k tasks: does the per-row model create N WorkRequests?
- Steelman exactly one alternative. Argue for it as its best advocate would — not a strawman you can dismiss:
Alternative: single sync journal table (append-only ops log).
Best case for it: trivially answers "what happened", replay-safe after
process death, one WorkRequest drains the log. Our chosen model has to
reinvent ordering; the journal gets it for free.
- Try to kill your plan on paper: for each failure mode, either show why it can't happen, change the design, or accept it explicitly with a mitigation. "Probably fine" is not one of the three options.
Step 3: Decide and Record
Make the call and record it as an ADR (see documentation-and-adrs) — including the failure modes considered and why the steelmanned alternative lost. The doubt is only worth its cost if the reasoning survives for the next person.
Convert surviving risks into checks: each accepted failure mode becomes a test, an assertion, or a monitored metric (see observability-and-instrumentation) — doubt that doesn't turn into a check evaporates.
// Failure mode "row stuck in SYNCING after process death" → a test
@Test
fun `rows in SYNCING older than timeout are reset to PENDING on start`() { ... }
Common Rationalizations
| Shortcut |
Why It Fails |
| "I already thought about the tradeoffs" |
Thinking about tradeoffs while defending a choice is advocacy. The steelman forces the perspective switch advocacy avoids. |
| "We don't have time for this ceremony" |
The ceremony is an hour. Reversing a shipped Room migration or a published API contract is weeks. |
| "The alternative is obviously worse" |
If it's obvious, the steelman takes five minutes and costs nothing. "Obviously worse" usually means "not actually considered". |
| "Doubt everything, ship nothing" |
Inverted failure: this skill applies to hard-to-reverse decisions only. Cheap decisions get made, not doubted. |
| "The team lead already approved it" |
Approval of an unattacked plan transfers blame, not correctness. Bring the failure-mode list to the approval. |
Red Flags
- An ADR whose "alternatives considered" section is one dismissive sentence
- Room schema migration merged with no process-death or downgrade discussion
- New dependency adopted with no note on its abandonment/replacement cost
- Failure modes listed but none converted into tests or metrics
- The steelman reads like a strawman (weakest version of the alternative)
- Doubt applied to a trivial reversible choice while a migration ships unexamined
Verification
1---2name: doubt-driven-development3description: Use when a decision is high-stakes and hard to reverse — architecture choices, data migrations, dependency adoption, public API contracts. Adversarial self-review that attacks the chosen approach before the code does, instead of defending the first idea that worked.4---56# Doubt-Driven Development78## Overview910The first workable idea gets defended; a better second idea never gets considered. This skill institutionalizes doubt at the moments it pays: before committing to a decision that is expensive to reverse, deliberately attack it — enumerate failure modes, steelman one alternative, and try to break the plan on paper where breaking is free. Doubt is a tool applied at decision points, not a mood applied to everything.1112## When to Use1314- Architecture decisions: module boundaries, offline/sync model, state management approach (see `android-architecture`)15- Data migrations: Room schema changes, DataStore format changes — anything touching persisted user data (see `android-data-persistence`)16- Adopting or replacing a dependency the codebase will grow around17- Public or cross-team API contracts (see `api-and-interface-design`)18- minSdk/targetSdk bumps and platform-behavior migrations (see `deprecation-and-migration`)1920**Skip when:** The decision is cheap to reverse (naming, private helpers, a screen's internal layout). Applying this to every choice is procrastination with extra steps.2122## Core Process2324### Step 1: Write the Decision Down First25261. **One paragraph, falsifiable:** what is being decided, what it optimizes for, what it deliberately gives up. If it can't be written down, it can't be attacked.2728```markdown29Decision: store sync state in a Room table per entity (not a global30DataStore flag). Optimizes for per-item retry and conflict tracking.31Gives up: simpler global "is syncing" UI state.32```3334### Step 2: Attack It35362. **Enumerate concrete failure modes** — Android-specific ones first:3738```markdown39- Process death mid-sync: is a row ever stuck in SYNCING forever?40- Migration: what happens to existing rows when the enum gains a value?41- Doze: WorkManager retry backoff vs. per-row retry counts — double retry?42- 10k tasks: does the per-row model create N WorkRequests?43```44453. **Steelman exactly one alternative.** Argue *for* it as its best advocate would — not a strawman you can dismiss:4647```markdown48Alternative: single sync journal table (append-only ops log).49Best case for it: trivially answers "what happened", replay-safe after50process death, one WorkRequest drains the log. Our chosen model has to51reinvent ordering; the journal gets it for free.52```53544. **Try to kill your plan on paper:** for each failure mode, either show why it can't happen, change the design, or accept it explicitly with a mitigation. "Probably fine" is not one of the three options.5556### Step 3: Decide and Record57585. **Make the call and record it as an ADR** (see `documentation-and-adrs`) — including the failure modes considered and why the steelmanned alternative lost. The doubt is only worth its cost if the reasoning survives for the next person.59606. **Convert surviving risks into checks:** each accepted failure mode becomes a test, an assertion, or a monitored metric (see `observability-and-instrumentation`) — doubt that doesn't turn into a check evaporates.6162```kotlin63// Failure mode "row stuck in SYNCING after process death" → a test64@Test65fun `rows in SYNCING older than timeout are reset to PENDING on start`() { ... }66```6768## Common Rationalizations6970| Shortcut | Why It Fails |71|----------|-------------|72| "I already thought about the tradeoffs" | Thinking about tradeoffs while defending a choice is advocacy. The steelman forces the perspective switch advocacy avoids. |73| "We don't have time for this ceremony" | The ceremony is an hour. Reversing a shipped Room migration or a published API contract is weeks. |74| "The alternative is obviously worse" | If it's obvious, the steelman takes five minutes and costs nothing. "Obviously worse" usually means "not actually considered". |75| "Doubt everything, ship nothing" | Inverted failure: this skill applies to hard-to-reverse decisions only. Cheap decisions get made, not doubted. |76| "The team lead already approved it" | Approval of an unattacked plan transfers blame, not correctness. Bring the failure-mode list to the approval. |7778## Red Flags7980- An ADR whose "alternatives considered" section is one dismissive sentence81- Room schema migration merged with no process-death or downgrade discussion82- New dependency adopted with no note on its abandonment/replacement cost83- Failure modes listed but none converted into tests or metrics84- The steelman reads like a strawman (weakest version of the alternative)85- Doubt applied to a trivial reversible choice while a migration ships unexamined8687## Verification8889- [ ] Decision written down in falsifiable form (optimizes for / gives up)90- [ ] Concrete failure modes enumerated, including process death, migration, and background-limits cases where relevant91- [ ] Exactly one alternative steelmanned in writing92- [ ] Every failure mode: refuted, designed away, or accepted with mitigation93- [ ] ADR recorded with the losing alternative's best case (see `documentation-and-adrs`)94- [ ] Surviving risks exist as tests, assertions, or monitored metrics — point to them