Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Applies Code Complete's routine and class design rules at the routine level: cohesion classification, parameter-count thresholds, LSP inheritance verification, and containment-vs-inheritance decision. For routine and class scope, not system architecture (use ca-architecture-boundaries).
.claude/skills/ryanthedev-cc-routine-and-class-design/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 25% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 47% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 49% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 11% | 0% |
| case-10 | ✗→✓ | ▲ Improved | 57% | 0% |
Three checks catch design problems that can't be patched post-hoc (they require architectural change, not a fix):
| Check | What | |---|---| | LSP test | Is "A is a B" literally true? If not, the inheritance is wrong | | Containment default | If LSP feels like purity theater, use containment — it's fixable; inheritance isn't | | Parameter count | Over 7 parameters predicts interface errors — the interface is wrong |
A passing test suite does not clear these: code can pass all tests on day 1 and still carry VIOLATION-level design debt that surfaces during later modification.
Shared thresholds (parameters 7±2, inheritance depth, routine length, cohesion spectrum): Read(${CLAUDE_PLUGIN_ROOT}/references/cc-foundations.md).
Activity) — but "framework examples use inheritance" is not a mandate.Execute the design checklists against routines and classes: Read(${CLAUDE_SKILL_DIR}/checklists.md). Output one row per item: | Item | Status | Evidence | Location |.
| Severity | Criteria | |---|---| | VIOLATION | Fails a checklist item (e.g. 10+ params); breaks LSP/encapsulation (empty override, protected base data) | | WARNING | Near a limit needing justification (8–9 params, 3-level inheritance); a subjective abstraction concern | | PASS | Meets or exceeds the requirement |
Produce class interface designs, inheritance/containment decisions, routine signatures, and cohesion classifications.
| Count | Status | Action | |---|---|---| | 1–5 | PASS | None | | 6–7 | PASS | Minor concern; document if unusual | | 8–9 | WARNING | Justify in review or redesign | | 10+ | VIOLATION | Redesign — parameter object or split responsibilities |
Count all parameters including defaulted ones; variadic (*args/...) counts as 1. Ordering convention (order implies data flow): input-only first, input-output second, output-only third.
If A inherits from B, every place that uses B can substitute A without breaking. Inheritance requires both:
If either fails, use containment.
FINAL CHECK (after deciding INHERIT, before committing): depth < 3 (definitely < 6)? No empty overrides needed? All base data private (not protected)? If any answer is NO → contain instead.
A routine performs one and only one operation. If you need "and" or "then" to name it, it has multiple operations.
ValidateUserInput(), CalculateTotalPrice(), SendWelcomeEmail().ValidateAndSaveUser(), ReadFileThenParseJSON()."One operation" is at the routine's declared abstraction level: CreateUser() is one operation even though it validates, hashes, and inserts — those are at a lower level.
| Type | Definition | Verdict | |---|---|---| | Functional | One and only one operation | ACCEPT | | Sequential | Operations share data step-to-step in required order | ACCEPT w/caution | | Communicational | Operations use the same data but are otherwise unrelated | ACCEPT w/caution | | Temporal | Combined because done at the same time (startup/shutdown) | ACCEPT if it orchestrates calls; FIX if it does the work directly | | Procedural | Ordered by external requirement (UI flow), not logic | REJECT | | Logical | A control flag selects one of several unrelated operations | REJECT | | Coincidental | No discernible relationship | REDESIGN |
"ACCEPT w/caution" = document why this type is acceptable here, review whether functional cohesion is reachable, and add a TODO if it should improve. Caution is permission with accountability, not permission to ignore.
Detecting orchestration (temporal OK): verbs like orchestrates/coordinates/delegates/dispatches/routes suggest orchestration (calls other routines). Verbs like handles/processes/performs/calculates suggest direct work — check the cohesion type and extract the direct work into named routines.
| Type | Steps | |---|---| | Sequential | Split per operation; have the dependent routine call what it depends on | | Communicational | Split into individual routines; reinitialize data near creation; call both from a higher level | | Temporal | Make the routine an organizer that calls doers; name at the right abstraction level | | Logical | One routine per distinct operation; move shared code lower; package into a class |
this are fine; class cohesion = "constructs one type of object".await.This is maintenance data, not shipping data: the gap appears during modification, not first commit.
| After | Next | |---|---| | Design verified | Skill(code-foundations:cc-defensive-programming) |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 15,441 | 3,864 | -75% | 1 | 1 | 0% | 2,386 | 2,302 | -4% | 0 | 0 | — |
case-01 | fail→fail | 4,661 | 4,337 | -7% | 1 | 1 | 0% | 687 | 2,348 | +242% | 0 | 0 | — |
case-02 | fail→pass | 15,487 | 8,379 | -46% | 1 | 1 | 0% | 2,385 | 2,985 | +25% | 0 | 0 | — |
case-03 | fail→fail | 13,400 | 10,528 | -21% | 1 | 1 | 0% | 2,240 | 3,033 | +35% | 0 | 0 | — |
case-04 | fail→pass | 11,459 | 8,581 | -25% | 1 | 1 | 0% | 1,857 | 2,721 | +47% | 0 | 0 | — |
case-05 | fail→pass | 11,935 | 10,146 | -15% | 1 | 1 | 0% | 2,099 | 3,131 | +49% | 0 | 0 | — |
case-06 | pass→pass | 15,174 | 8,321 | -45% | 1 | 1 | 0% | 2,476 | 2,867 | +16% | 0 | 0 | — |
case-07 | fail→pass | 15,951 | 9,821 | -38% | 1 | 1 | 0% | 2,744 | 3,047 | +11% | 0 | 0 | — |
case-09 | pass→pass | 19,916 | 11,316 | -43% | 1 | 1 | 0% | 3,299 | 3,395 | +3% | 0 | 0 | — |
case-10 | fail→pass | 20,381 | 15,065 | -26% | 1 | 1 | 0% | 2,573 | 4,031 | +57% | 0 | 0 | — |
case-11 | pass→pass | 10,461 | 9,088 | -13% | 1 | 1 | 0% | 1,684 | 3,132 | +86% | 0 | 0 | — |
case-12 | pass→pass | 10,143 | 8,019 | -21% | 1 | 1 | 0% | 1,735 | 2,915 | +68% | 0 | 0 | — |
case-13 | fail→pass | 8,343 | 4,027 | -52% | 1 | 1 | 0% | 1,301 | 2,243 | +72% | 0 | 0 | — |
case-14 | pass→pass | 14,929 | 12,030 | -19% | 1 | 1 | 0% | 2,308 | 3,179 | +38% | 0 | 0 | — |
case-15 | fail→pass | 7,254 | 4,082 | -44% | 1 | 1 | 0% | 1,080 | 2,235 | +107% | 0 | 0 | — |
case-16 | fail→pass | 10,101 | 5,994 | -41% | 1 | 1 | 0% | 1,517 | 2,566 | +69% | 0 | 0 | — |
case-17 | pass→pass | 16,839 | 10,359 | -38% | 1 | 1 | 0% | 2,686 | 3,286 | +22% | 0 | 0 | — |
case-18 | fail→pass | 17,450 | 13,877 | -20% | 1 | 1 | 0% | 2,747 | 3,608 | +31% | 0 | 0 | — |
case-19 | pass→pass | 14,165 | 11,328 | -20% | 1 | 1 | 0% | 2,150 | 2,674 | +24% | 0 | 0 | — |
case-20 | pass→pass | 4,524 | 3,446 | -24% | 1 | 1 | 0% | 806 | 2,247 | +179% | 0 | 0 | — |
case-21 | fail→pass | 30,824 | 10,151 | -67% | 1 | 1 | 0% | 2,640 | 3,136 | +19% | 0 | 0 | — |
case-22 | fail→pass | 10,509 | 1,687 | -84% | 1 | 1 | 0% | 1,573 | 1,876 | +19% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 22 cases were attempted. The headline lift of +50 percentage points is the difference between those two pass rates over the 22 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.