agentsclimarketplace

Design pattern audit

Skill VictorAurelius/claude-starter-kit/skills/quality/design-pattern-audit

Dùng khi user nói 'design pattern audit', 'pattern check', 'kiểm tra design patterns', 'God service đâu', 'anti-pattern hotspot', hoặc trước một refactor planning cycle. Score code against `.claude/rules/design-patterns.md` §3 BANNED list. Output: hotspot list (file path + LOC + violated pattern) + score /100.From its SKILL.md

Install
npx -y skills add VictorAurelius/claude-starter-kit --skill design-pattern-audit

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

2 things to look at

  • 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
  • runs commandsInstructs the agent to run 4 commands, including `find . -maxdepth 4 -type d -name src 2>/dev/null | grep main/java` and 3 more.

SKILL.md

4.2 KB, 997 tokens by cl100k_base, as published. Nobody here has run it

/design-pattern-audit — Verify Code ↔ Pattern Rules

Score /100. Walk every service module, flag design-patterns.md §3 anti-patterns.

Process

1. Collect Modules

# Adapt the search roots to your repo layout
find . -maxdepth 4 -type d -name src 2>/dev/null | grep main/java

2. Per-Module: 5 Anti-Pattern Categories (20 pts each)

For EACH service module, run detectors and apply rubric in reference/scoring-guide.md:

#Category (20pts)DetectorPass criteria
1God Service / Classfind . -name "*Service.java" -exec wc -l {} +No service > 500 LOC (per design-patterns.md §3.1)
2Status switch/if cascadegrep if.*Status == / switch.*[Ss]tatusState Pattern used for entities with ≥3 lifecycle states (per design-patterns.md §3.3)
3Primitive Obsessiongrep public method signatures with String color|String email|String hexValue objects (e.g. Email, Money) preferred for validated primitives (per design-patterns.md §3.2)
4Leaky Abstractiongrep external-vendor response types outside *adapter* packagesExternal API types isolated to Adapter layer (per design-patterns.md §3.4 / §3.10)
5Direct event publish (no Outbox)grep rabbitTemplate.send|streamBridge.send outside outbox/ packagesEvents go through the outbox writer (per design-patterns.md §3.5)

Detector recipes: reference/anti-pattern-detectors.md

3. Output

Save report to documents/audits/design-pattern-audit-[date].md with structure:

  • Score /100 (sum of 5 categories × 20)
  • Per-module table (rows = modules, columns = 5 categories)
  • Hotspot list — each violation = 1 row (file path + LOC + category + suggested fix)
  • Comparison vs previous audit if exists

4. Hotspot → Gap Pipeline

For each P0/P1 hotspot, follow audit-to-gap-pipeline.md Step 2 (duplicate check) + Step 2.5 (state-check) + Step 3 (gap file). Do NOT fix in audit session.

Grep Scope — CRITICAL

Multi-module repos hide false-negatives behind narrow grep scope. Narrow scope = silent false-positive risk.

# Preferred — broad with extension filter
grep -rnE "pattern" --include="*.java"

# Or — explicit submodules
grep -rn "pattern" */src/ --include="*.java"

Calibration Notes

First-run baseline: expect ~50-65/100. Self-audits tend to overstate 15-20pts vs an independent specialist review. Trust the delta, not the absolute number. Don't treat a first low score as a regression.

Threshold rationale (design-patterns.md §3.1): ">500 lines = refactor required". Adjust ONLY if all modules cluster between 450-550 (legacy noise floor).

Context Management

5-25K tokens depending on module count. Tactics:

  1. Pipe greps| head -30 for cascade detectors (only need count, not full match list)
  2. Per-module staging — score 2 modules deeply, apply pattern to rest
  3. Subagent split — split by module group if >10K tokens

Gotchas

  • Status switches in test files — exclude *Test.java; tests legitimately exercise state transitions via switch
  • Lombok @Builder does NOT trigger Primitive Obsession — generated code, not signature design choice
  • Outbox detector — the outbox publisher's own publish() IS the right path; only flag rabbitTemplate.send OUTSIDE the outbox package
  • God Service threshold — measure wc -l against the .java file, not LOC of method bodies
  • Calibration first run — DO NOT file gaps until baseline reviewed; threshold may need module-specific calibration

Skill Contents

  • reference/scoring-guide.md — Detailed rubric per category with point deductions
  • reference/anti-pattern-detectors.md — Grep one-liners for each category, false-positive avoidance

What ships with it: 2 files

14.3 KB alongside SKILL.md

Gives 0 of the 12 instructions most audit compliance skills give in 997 tokens

Counted across 960 of the 1,589 authors here whose files we hold, read 2026-09-06

  • Read product marketing context before asking questionsin 29 of 960, across 11 files
  • Rank findings by severityin 29 of 960, across 22 files
  • Generate audit reportin 22 of 960
  • Run the audit scriptin 20 of 960, across 19 files
  • Generate a prioritized action plan reportin 19 of 960, across 11 files
  • Ensure one H1 per pagein 15 of 960, across 5 files
  • Ensure sitemap exists and is accessiblein 14 of 960, across 4 files
  • Verify alt text on all imagesin 12 of 960, across 3 files
  • Determine the audit scope before startingin 12 of 960, across 4 files
  • Verify important pages allowed in robots.txtin 11 of 960, across 2 files
  • Detect business type from homepage signalsin 11 of 960, across 7 files
  • Delegate specialized tasks to subagentsin 11 of 960, across 7 files

Said here and by no other author read

  • save report to documents folder
  • Walk every service module
  • Flag anti-patterns
  • Run detectors
  • Follow audit-to-gap pipeline

Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.