simplicity-patterns

Guides C, Go, Rust, and Zig code toward simple designs using YAGNI and Tidy First principles.

Updated Jul 4, 2023
One-click install
npx skills add https://github.com/kohdice/dotfiles --skill simplicity-patterns-kohdice
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: simplicity-patterns
Source: https://github.com/kohdice/dotfiles/tree/main/config/agents/skills/simplicity-patterns
Command: npx skills add https://github.com/kohdice/dotfiles --skill simplicity-patterns-kohdice

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Codebases accumulate unnecessary abstractions: wrapper-only functions, single-implementation interfaces, unused generics, and speculative configuration options that add maintenance cost without delivering value. This Skill provides concrete criteria for deciding whether an abstraction is justified and for auditing existing code for needless complexity. ## Core Features & Use Cases - Abstraction justification test: Indirection must enforce an invariant, serve as a genuine seam in use today, isolate a volatile dependency, or be a published API; otherwise prefer the direct call. - Language-specific pattern catalog: Flags known anti-patterns in Go (producer-side interfaces, stdlib wrapper packages), Rust (invariant-free newtypes, single-impl traits), Zig (single-instantiation comptime generics), and C (single-implementation vtables, opaque handle layers). - Tidy First workflow: Separates pure structural changes (deleting dead code, inlining wrappers) from behavior changes, keeping them in distinct commits with tidyings first. - Use Case: When reviewing a Rust pull request that introduces a trait with one implementation and no test double, apply the catalog to recommend replacing it with a concrete type until a second consumer appears. ## Quick Start Review this Go package for unnecessary abstractions and YAGNI violations, and suggest which wrappers or interfaces to remove.

Frequently Asked Questions about simplicity-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I decide if an abstraction is necessary in my code?▼

An abstraction is justified if it enforces an invariant, is a genuine seam used today (multiple implementations or a real test double), isolates a volatile dependency like FFI or I/O, or is a published API requiring stability. If none apply, prefer the direct call.

What are common YAGNI violations in code reviews?▼

Common violations include interfaces with exactly one implementation and no test double, generics instantiated with a single concrete type, parameters always passed the same value, unused feature flags, and manager or factory layers with one caller and one product.

How does Tidy First separate refactoring from behavior changes?▼

Tidy First defines a tidying as a pure structural change, such as deleting dead code or inlining a wrapper, that leaves observable behavior identical. Behavior changes like removing a public API are separate decisions and belong in their own commits, with tidyings landing first.

When is a Rust newtype or Go interface actually justified?▼

A Rust newtype earns its keep when it enforces units, validity, or orphan-rule workarounds. A Go interface is justified when defined at the consumer with multiple implementations or a test double genuinely used in the test suite.

Which abstractions should not be flagged during a simplicity audit?▼

Do not flag wrappers enforcing invariants, interfaces with real test doubles, boundaries around FFI, I/O, clocks, or third-party APIs, published library APIs with stability requirements, idiomatic language ceremony, or anything whose removal would change observable behavior.