Back to Skills Library
ArchitectureSystem DesignRulesAI Agent Skill

codebase-design

Software architecture decision frameworks separating deterministic domain rules from stochastic AI pipelines.

mattpocock/skills
445.3k stars
445.3k installs
Updated: 2026-07-29

Install Options

Install into Claude Code, Cursor, Codex, or Antigravity with:

$ npx skills add mattpocock/skills@codebase-design

Real Work Situation Solved

Deterministic rules or an AI model - how do you decide?

The problem in front of you could be solved with if-else or with AI - which do you pick, and why?

5-Step Action Framework

  1. 1Ask: can the rule be written as a finite list that doesn't change with context? If yes → use a deterministic rule.
  2. 2Ask: does the system need to explain its decision to users or auditors? Rules are easier to explain than models.
  3. 3Ask: is the input varied, ambiguous, or does it keep shifting over time? If yes → a model is the better fit.
  4. 4Compare the cost of being wrong: a bad rule is a one-line fix; a bad model needs retraining and re-evaluation - which risk can this problem tolerate?
  5. 5When unsure, start with a rule for the 80% common cases and reserve AI for the harder-to-predict remainder.
Before

"Just use AI, it'll probably be more accurate."

After

"Approving refunds under $20: a deterministic rule (clear conditions, must be explainable to customers). Fraud detection: an AI model (input is varied, patterns keep shifting)."

Related Course Lesson

AI LiteracyLesson 1

Go to Lesson

SKILL.md Source Instructions

SKILL.md • Read-only preview
# Codebase Design Skill

Evaluate whether a problem requires static business logic or dynamic probabilistic reasoning.