Loading...
Loading...
Audit code architecture for over-engineering and unnecessary abstractions. Use when user asks to "review architecture", "simplify code structure", "reduce over-engineering", "evaluate abstractions", or mentions premature abstraction, interface proliferation, factory patterns, YAGNI, or enterprise-grade complexity.
npx skill4agent add sweetretry/skills pragmatic-architecture[SEV] file:line flag-id → fixFILE: <path> ✓ SIMPLENovices → Copy-paste everything
Intermediates → Abstract everything
Experts → Know when to do neither| ID | Grep Pattern | Smell | Fix |
|---|---|---|---|
| single-impl | | Interface with 1 impl | Delete interface |
| future-proof | | Pattern with 1 product | Use class directly |
| generic-repo | | Base class with overrides | Inline to each class |
| enterprise-larp | Glob | 11 files for dark mode | 1 useState |
| ID | Grep Pattern | Smell | Fix |
|---|---|---|---|
| deep-call | Private methods > 3 levels deep | | Inline or flatten |
| scattered-flow | Steps A,B,C in separate functions | | Keep linear in one fn |
| hidden-state | Heavy use of | State buried in class members | Pass as explicit params |
| vague-name | | Generic function names | |
| ID | Grep Pattern | Smell | Fix |
|---|---|---|---|
| unsearchable-error | Duplicate error strings | Same "Failed" in 5 places | Unique error codes |
| missing-context | | No diagnostic context | Include why + inputs |
| what-not-why | | Explains what, not why | Document business reason |
# Horizontal: abstraction patterns
Grep("Factory|Strategy|Provider|Builder|Orchestrator", path="<dir>", output_mode="content", -n=true, head_limit=20)
Grep("interface I[A-Z]|abstract class|extends Base", path="<dir>", output_mode="content", -n=true, head_limit=20)
# Vertical: call depth indicators
Grep("private.*\(|this\._[a-z]", path="<dir>", output_mode="content", -n=true, head_limit=20)
Grep("processData|handleEvent|doWork|execute\(\)", path="<dir>", output_mode="content", -n=true, head_limit=20)
# Traceability: error/log patterns
Grep("throw new Error|console\.(error|log)", path="<dir>", output_mode="content", -n=true, head_limit=20)// BAD: scattered
stepA(); stepB(); stepC();
// GOOD: visible
// Step A: validate input
if (!valid) return err;
// Step B: transform
const result = transform(data);
// Step C: persist
await save(result);// BAD: generic
catch(e) { throw new Error("Operation failed") }
// GOOD: searchable
catch(e) { throw new Error("PAYMENT_CALC_001: Monthly total failed", { customerId, month }) }