DOC-002 critical general

Complex systems documented

Complex systems (e.g., payment gateways, order fulfillment, admin features, third-party integrations) have dedicated documentation explaining flows, edge cases, and integration points.

Question to ask

"What happens to your payment flow if your main dev quits?"

Pass criteria

  • Each complex system has dedicated documentation
  • Docs explain the flow, not just API reference
  • Includes edge cases, error handling, integration points

Fail criteria

  • Complex system exists in code but no corresponding documentation
  • Only code comments, no prose explanation
  • Docs exist but are outdated (describe old flow)

Related items

DOC-001 Feature documentation exists (human + AI readable) TODO: Section 3 item ID (Auth system documented) TODO: Section 15 item ID (Admin features)

Verification guide

Severity: Critical

Check automatically:

  1. Search for documentation of known complex areas:
# Payment/billing docs
grep -riE "payment|billing|stripe|checkout" docs/ *.md 2>/dev/null | head -10

# Order fulfillment docs
grep -riE "fulfillment|order.?flow|shipping" docs/ *.md 2>/dev/null | head -10

# Admin feature docs
grep -riE "admin|back.?office|management" docs/ *.md 2>/dev/null | head -10
  1. Identify complex systems in codebase that need docs:
# Find payment-related code
find . -type f \( -name "*.ts" -o -name "*.js" \) -exec grep -l -iE "stripe|paypal|payment|checkout" {} \; | head -5

# Find admin routes/controllers
find . -type f \( -name "*.ts" -o -name "*.js" \) -path "*/admin/*" | head -10

Cross-reference with:

  • DOC-001 (general docs exist)
  • TODO: Section 3 item ID (Auth system documented)
  • TODO: Section 15 item ID (Admin features)

Ask user:

  • What are the complex systems in this project? (e.g., payment gateways, order fulfillment, admin features, third-party integrations)
  • Are these documented? Where?

Pass criteria:

  • Each complex system has dedicated documentation
  • Docs explain the flow, not just API reference
  • Includes edge cases, error handling, integration points

Fail criteria:

  • Complex system exists in code but no corresponding documentation
  • Only code comments, no prose explanation
  • Docs exist but are outdated (describe old flow)

Evidence to capture:

  • List of complex systems identified
  • Documentation status for each
  • Gaps (complex code without docs)

Section

14. Documentation

Observability