plugins/review/skills/abstraction-review/SKILL.md
Use this skill to review code for bad abstractions, duplicated parallel implementations, stringly-typed dispatchers, god-functions, parameter sprawl, primitive obsession, and mixed concerns — both in isolation ("review tyhle abstrakce", "je tenhle dispatcher OK?") and as a specialist lens inside deep-review. Invoke whenever a PR or diff adds/modifies a helper, wrapper, dispatcher, shared module, OR consolidates duplicated code, OR when the user asks "zreview mi tyhle abstrakce", "je ta refactor OK", "není to over-DRY", "nemáme tady god-function", "napsal jsem helper — je to dobré?". Complements security-review, database-review, api-design-review as the design-quality lens.
npx skillsauth add petrogurcak/skills abstraction-reviewInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Review-time lens for design-quality issues introduced by abstractions. Catches bad shapes AFTER code is written — symmetric counterpart to development:designing-abstractions which runs BEFORE.
Announce: "Používám abstraction-review — koukám na shapes, concerns a duplicity."
review:deep-review when the diff includes shared logic.security-review) or DB perf (use database-review) — this skill is specifically about design shape.Before reviewing, confirm:
git diff output or a file list).If called from deep-review, these are already in context.
Before judging the new helper's shape, check whether the responsibility already exists elsewhere in the repo:
Grep for:
- Similar function names (send_*, notify_*, validate_*, ...)
- Shared verbs + objects the new code handles
- CLAUDE.md / ACTIVE_CONTEXT.md mentions of the concern
If a sibling helper exists → flag as CRITICAL: "Parallel implementation — X in path/to/existing.py already does this. Consolidate instead of adding a new one."
For each added/modified helper/dispatcher/shared module, check every row:
| # | Red Flag | What to look for | Severity |
|---|----------|------------------|----------|
| 1 | Boolean parameter controlling behavior | def send(invite: bool, ...), if flag: ... else: ... branches in the body | HIGH |
| 2 | Stringly-typed dispatcher | send(type="invite"), action(kind="x"), string-literal switch | HIGH |
| 3 | Parameter sprawl | ≥5 params on one function, especially primitives | HIGH |
| 4 | Primitive obsession | Raw string/int carrying domain meaning passed through >2 layers | MEDIUM |
| 5 | Braid — mixed concerns | One function does transport + logic + persistence / validation + IO | HIGH |
| 6 | Information leakage | Caller must know HOW the module works (e.g., must call init/configure before use) | MEDIUM |
| 7 | God-function / god-class | Sandi Metz thresholds violated — method >5 lines of logic, class >100 lines, >4 params | MEDIUM |
| 8 | N-wrapper pattern | Helper called from N places, each customizing it with flags/overrides | HIGH |
| 9 | Anemic domain model | Value object with only getters/setters, logic lives in a service layer function | LOW |
| 10 | Missing invariants | Dispatcher exists but logging/rate-limit/audit happens per-caller instead of in dispatcher | HIGH |
| 11 | Rule of Three violated backwards | Abstraction created with only 1-2 callers (premature) | MEDIUM |
| 12 | Stable-dependency violation | Core logic depends on volatile transport/UI code (backwards direction) | MEDIUM |
For the new or modified interface, identify the coupling type introduced:
send_invite_email) or hidden behind a stringly-typed dispatcher?__all__ / explicit exports, or does everything spill out?If the added code introduces a dispatcher or shared core:
Produce a structured review block the caller can paste into PR comments or the deep-review output:
## Abstraction Review
**Parallel implementation scan:** [Clean | Found X — see note below]
**Red flags hit:** [0 | count] — [HIGH: n, MEDIUM: n, LOW: n]
### CRITICAL findings
- [file:line] — [red flag #] — [one-sentence explanation]
- Fix: [concrete suggestion referencing a specific principle from designing-abstractions]
### WARNING findings
- [file:line] — ...
### INFO / suggestions
- [file:line] — ...
**Connascence summary:** [Position n → Name n suggested, Algorithm n flagged]
**Public API vs internal:** [OK | concerns leak | mixed]
**Tests at the seam:** [OK | bolted on each wrapper | missing invariant tests]
**Recommendation:** [Approve | Request changes | Block on parallel-implementation issue]
Each CRITICAL finding must reference a specific principle and propose a concrete fix — don't leave the author guessing. Principles live in development:designing-abstractions SKILL.md if a reminder is needed.
Don't inflate severity. If 8 of 12 red flags are clean, say so. Reviewers stop reading when every diff returns a wall of CRITICALs.
| Skill | Relationship |
|---|---|
| review:deep-review | Calls this skill when diff adds/modifies helpers, dispatchers, or shared modules. Output folds into deep-review's Specialist Skills section. |
| development:designing-abstractions | The design-time counterpart. This skill catches what the design-time skill missed or what was built without invoking it. Shares the same 12 principles + red flag taxonomy for consistency. |
| review:security-review | Independent — security concerns overlap with primitive obsession (unvalidated input) but focus differently. |
| review:api-design-review | Overlaps on public API conventions — this skill is broader (internal helpers too), api-design-review is deeper on REST/HTTP specifics. |
| code-simplifier:code-simplifier | After abstraction-review flags issues, simplifier can automate some fixes. |
GOOD — flag this:
src/notifications.py:42 — Red flag #2 (stringly-typed dispatcher)
def send(channel: str, ...): if channel == "email": ... elif channel == "slack": ...
Fix: split into send_email(req) / send_slack(req) (thin wrappers) + _dispatch(NotificationRequest).
See designing-abstractions Principle: "Thin wrappers over fat dispatcher".
GOOD — don't flag this:
src/utils/paths.py:12 — helper used twice, both callers pass the same signature, no concern mixing.
Acceptable — Rule of Three not yet warranted for extraction/abstraction escalation.
BAD — too noisy:
src/db.py:8 — LOW: function name could be more descriptive (currently `get_user`)
(get_user is fine — don't waste reviewer attention on non-issues.)
development
Builds a pre-launch social proof strategy through structured beta programs using D'Souza Brain Audit interviews. Use when launching new products/services and need compelling testimonials, planning a beta cohort, designing interview questions to harvest objection-busting social proof, improving video testimonials for landing pages, or designing case studies with metrics. Trigger phrases include "beta tester program for testimonials", "pre-launch social proof", "Brain Audit testimonial framework", "case study harvest", "reverse testimonial", "video testimonial mechanics", "social proof landing page", "sběr referencí", "beta tester program", "testimonial pro landing page", "social proof před launchem", "rozhovor s klientem", "case study sběr", "reference před spuštěním". NOT for ongoing case study production (use growth-hacking case-study approach), offer design (use offer-creation), or conversion optimization (use ux-optimization).
development
Use when planning a product launch and the product type is unclear or could be either generic (SaaS/app/physical) or info-product. Routes between marketing:launch-strategy (generic launches) and marketing:info-product-launch (courses, memberships, ebooks, cohorts, communities). Trigger phrases - "launch", "spuštění", "go-to-market", "product launch", "release strategy", "uvedení na trh", "launch plan", "spuštění produktu", "launch sequence", "launch strategy". Do NOT trigger when product type is already clear (use specific skill directly).
testing
Specialized 8-week launch cadence for info-products — online courses, cohort programs, memberships, communities, ebooks, masterminds. Combines Jeff Walker's Product Launch Formula (Seed/Internal/JV variants, PLC sequence, open-cart day-by-day) with Stu McLaren's membership mechanics (closed cart, Success Path) and Hormozi Grand Slam Offer stacking. Use when planning "launch online kurzu", "info-product launch", "PLF launch", "course launch", "membership launch", "cohort launch", "ebook launch", "open cart close cart", "8-week launch of online course", "beta cohort to launch sequence", "spuštění kurzu", "launch členské sekce", "open cart strategie". Differentiates from marketing:launch-strategy (generic SaaS/app launches) — info-product-specific. NOT for SaaS launches, physical products, or services.
development
Use when releasing an Expo/React Native mobile app to App Store and Google Play - covers eas submit, ASC "Submit for Review", Play promote Internal→Production, OTA update, and decoding common silent failures (Apple agreement expiry, missing English locale, Background Location declaration, web bundle failure on react-native-maps).