patterns-and-refactoring
A Claude Code skill that forces a deliberate design decision before any code gets written, a disciplined, test-backed process before any code gets restructured, and an audit of what was actually built afterwards.

[!NOTE]
This skill is standalone. It needs no MCP server, no other skill, and no runtime. It is Markdown that changes how the model reasons about design. It ships two ways: as a plugin from this repo's marketplace (recommended — versioned, updatable) or as a plain skill directory copied into ~/.claude/skills.

A real-time scene built while distilling idioms/blender-python.md: eroded terrain and sky from Blender, with live water, clouds and light in a WebGL shader. Each failure on the way became a checked lesson.
Table of contents
The problem
An AI coding assistant, left alone, will write code that works. That is a lower bar than it sounds.
It will also, reliably:
- reach for a pattern because the name fits, not because the problem calls for it
- build an interface with exactly one implementation "for flexibility"
- refactor and change behaviour in the same commit
- restructure code that has no tests, and declare it improved
- hand-roll a Chain of Responsibility next to the framework's own
Pipeline
- decide "no pattern needed", then ship a generic
CsvWriter with one caller anyway
- approve a PR labelled "just structure" that swallows exceptions behind eight files of scaffolding
- and, most expensively, produce a design that reads sophisticated while making the next change harder
None of this is a knowledge gap. The catalogue is well documented and well represented in training data. It is a process gap: the decision of whether a pattern is warranted at all gets skipped, because writing the code is more immediately rewarding than justifying its shape.
This skill inserts that decision, and makes it cheap enough to actually happen.
[!IMPORTANT]
"No pattern needed — write the direct code" is a first-class output of this skill. It is a brake as much as a catalogue. A tool that only ever suggests adding abstraction is not helping.
Why this matters now: the legacy modernization wave
The dominant kind of software work is no longer greenfield. It is carrying existing systems onto modern stacks — and pattern literacy is precisely what separates a modernization that pays off from one that reproduces the old design in a new framework.
The scale of the estate
| Metric | Figure | Source |
|---|
| Legacy/application modernization market, 2025 | ~$25–30B | Aggregate of five research firms (Pragmatic Coders) |
| Projected market, 2031–2034 | $66–90B+ (14.9–17.6% CAGR) | Mordor Intelligence |
| COBOL still running in production | ~200–300 billion lines | Pragmatic Coders |
| Average age of a COBOL developer | ~55, with ~10% of the workforce retiring annually | Adalo |
What it costs to not deal with it