Home
cd ../playbooks
Developer ToolsBeginner

Simplicity First Code Gate

A hard correctness gate against over-complex or oversized code — one ordering principle (human readability first, agent traceability second), five enforceable rules, and a pre-finish checklist that treats unnecessary complexity as a bug, not a style opinion.

2 minutes
By OpenRLHFSource
#code-review#simplicity#engineering-principles#code-quality#readability

A diff that's twice the size it needs to be, or a helper class built for one call site, isn't a style nitpick — it's a comprehension defect that costs the next reader (human or agent) real time, and most reviewers have no crisp rule to point at when they feel it.

Who it's for: engineering teams tired of over-engineered PRs, tech leads writing a house style for AI-assisted code review, solo developers who want a concrete self-check before finishing a change, anyone reviewing diffs where 'this could be simpler' needs to become an enforceable rule instead of a vibe

Example

"Review this PR" → A structural check against five concrete rules (one-pass readability, no redundant code, fewest concepts, no single-call-site helpers, no capability deletion) instead of a vague 'looks complex' comment, plus a finishing checklist the author can run before ever opening the PR

CLAUDE.md Template

New here? 3-minute setup guide → | Already set up? Copy the template below.

Or install from your terminal:
npx ccplaybooks add simplicity-first
# Simplicity First

A simplicity gate for every code change — written, fixed, or reviewed. Invoke it before writing any code change and when reviewing any diff. Treat over-complex or oversized code as a correctness bug, not a style preference.

## The Core Ordering

Human readability comes first; agent traceability is the minimum gate. A human should understand the code in one pass. An agent must at least be able to trace a feature from entry point to executed branch, data structure, and test without reconstructing hidden control flow. Every rule below is an instance of that ordering. These are hard correctness rules, not style preferences — a violation is a bug and must be fixed before the change ships.

## The Five Rules

1. **Code a human can't follow at a glance is a bug.** If a reviewer can't read a function top-to-bottom in one pass, restructure or delete it. Nesting, indirection, and clever constructs count against correctness — cleverness that costs comprehension is a defect, whatever it saves elsewhere.

Get new playbooks like this one

One email a week with new Claude Code workflows. Free, like everything here.

No spam. Unsubscribe anytime.

README.md

What This Does

A simplicity gate applied before writing any code change and while reviewing any diff, built on one ordering principle: a human should understand the code in one pass, and an agent must at minimum be able to trace a feature from entry point to executed branch, data structure, and test without reconstructing hidden control flow. Everything else follows from that ordering — five rules that turn "this feels over-engineered" into something concrete and checkable, treating unnecessary complexity and unnecessary size as correctness bugs rather than taste.

The five rules cover the ground that usually gets debated informally in review: illegible code counts against correctness even if it "works," redundant code is a bug with a rough size heuristic (~20 lines for a one-sentence problem is suspect), simplicity beats cleverness when two designs both work, helpers need three-plus real call sites to justify existing, and — critically — simplicity is never an excuse to delete a real feature, performance knob, or piece of observability. A short pre-finish checklist turns the rules into something you can actually run against a diff before opening the PR.


Quick Start

Step 1: Create a Project Folder

mkdir simplicity-gate && cd simplicity-gate

Step 2: Download the Template

Click Download above, then:

mv ~/Downloads/CLAUDE.md ./

Step 3: Use It

claude

Ask Claude to write or review a change with this file present. It will apply the one-pass-readability test, flag oversized or redundant diffs, resist premature abstraction, and run the finishing checklist before calling the change done.


Tips & Best Practices

  • Apply it both directions: before writing code (design the smallest version first) and while reviewing (catch complexity that crept in during implementation).
  • The "three or more call sites" rule for helpers is deliberately strict — a helper with two call sites is usually cheaper inlined twice than maintained as an abstraction nobody else uses yet.
  • Simplicity is explicitly not an excuse to cut scope. If a rule ever seems to justify removing a real feature or a default-on safety knob, that's a misapplication — re-read rule five.

Limitations

  • A gate, not a design methodology — it tells you when a diff is too complex or too large, not how to architect the simpler alternative.
  • The size heuristics (roughly 20 lines, three-plus call sites) are starting points tuned for typical application code; a systems-level or highly parameterized codebase may need looser thresholds.
  • Works best as a shared, agreed-upon standard — applied inconsistently by only some reviewers, it becomes another subjective opinion instead of an enforceable gate.

$Related Playbooks

Developer Tools

Slidev Presentation Builder

Build developer-focused presentations with Slidev — Markdown-driven slides with live code, syntax highlighting, Monaco editor embeds, Mermaid/PlantUML diagrams, LaTeX math, click-based animations, and presenter notes, plus a quick-reference table for the exact syntax each feature needs.

5 minutes
Beginner
Developer Tools

Technical Writing Style Guide

Write docstrings, READMEs, commit messages, and PR descriptions that read like human technical documentation instead of LLM output — six concrete 'tells' with before/after rewrites, a smoothness diagnostic for prose that sounds authoritative while stating one fact three times, and industry-metaphor substitution tables ('surfaces' to 'raises/returns/logs', 'wired through' to 'passed as a parameter').

5 minutes
Intermediate
Developer Tools

Three.js Scroll World Builder

Build a scroll-controlled real-time Three.js experience as one persistent 3D world instead of stacked sections — a scene-ledger data model for authoring chapters, native-scroll-to-deterministic-state mapping with separate exact and smoothed progress, cinematic camera composition, a measurable per-device performance budget, and mandatory reduced-motion and WebGL-failure fallbacks.

20 minutes
Advanced
Developer Tools

Visual Explainer HTML Pages

Have Claude Code explain architectures, diffs and plans as self-contained HTML pages with labeled Mermaid diagrams and a deliberate design pass, instead of walls of chat text, terminal ASCII or generic AI-looking pages.

5 minutes
Intermediate
Developer Tools

Web Animation Design Principles

Design web animations that feel natural and purposeful — a decision-first easing blueprint (ease-out for entrances, ease-in-out for movement, ease for hover), duration and frequency rules, spring configuration, the GPU-only performance rule, and mandatory prefers-reduced-motion accessibility patterns with working CSS and Framer Motion code.

5 minutes
Intermediate
Developer Tools

Web Technique to Skill Extractor

Turn a one-off web visual or interaction technique into a reusable, well-scoped skill — the one-sentence mechanism test that separates a real technique from mere styling, a mechanism-vs-staging sort for what belongs in the skill versus the demo, rules anchored to named failures instead of adjectives, and a demo craft bar that treats the acceptance reference as a target, not inspiration.

10 minutes
Advanced
Developer Tools

Planning with Files

Persistent, file-based planning for multi-step AI-agent work — task_plan.md, findings.md, and progress.md on disk, a 2-action rule for capturing multimodal findings before they're lost, a 3-strike error protocol, and a 5-question reboot test to verify state survives a compaction.

5 minutes
Intermediate
Developer Tools

Secret Scan and Rotation

Find committed credentials in a repository's working tree and full history, triage real secrets from test fixtures, and drive rotation-first remediation — with an absolute rule against ever printing a secret's actual value, even during the scan itself.

5 minutes
Intermediate
Developer Tools

Self-Improvement Loop Design

Design systems where the harness itself is the optimization target — an optimization ladder from prompt to context to workflow to harness code, a two-split empirical acceptance gate, an outside-the-loop invariant for the evaluator, and a catalog of documented reward-hacking and collapse failure modes.

10 minutes
Advanced
Developer Tools

Skill Security Inspector

Review an AI agent skill before installing it using two independent lines — static scanner evidence plus source-aware semantic judgment — checking purpose fit, permission fit, sensitive access, external transmission, execution risk, and persistence, down to a clear APPROVE, CAUTION, or REJECT verdict.

10 minutes
Intermediate
Developer Tools

Writing for AI Agents: A Craft Reference

A theory of writing any document an agent consumes — skills, CLAUDE.md, reference docs — built on context pointers, an information hierarchy of steps versus disclosed reference, completion criteria, and leading words that anchor behavior in the fewest tokens.

10 minutes
Advanced
Developer Tools

Windows RDP Connection Doctor

Diagnose Windows App / AVD / W365 remote-desktop connection quality on macOS — transport selection (UDP Shortpath vs WebSocket), VPN/proxy interference with STUN/TURN, and Shortpath failures from the logs.

15 minutes
Intermediate

Browse all Developer Tools playbooks →