skills/pattern/SKILL.md
Design pattern recommendation and anti-pattern detection.
npx skillsauth add arbazkhan971/godmode patternInstall 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.
/godmode:pattern, "what pattern should I use"find src/ -name "*.ts" | xargs wc -l \
| sort -rn | head -20
npx madge --circular src/
Problem: <design challenge>
Language: <primary language>
Framework: <if applicable>
Existing patterns: <detected>
Creational (object creation problems): Factory, Builder, Singleton (last resort -- use DI), Prototype, Abstract Factory.
Structural (composition problems): Adapter, Decorator, Facade, Proxy, Composite, Bridge.
Behavioral (communication problems): Strategy, Observer, Command, State, Chain of Responsibility, Mediator, Iterator, Template Method.
Distributed (resilience/consistency): Circuit Breaker, Saga, Outbox, CQRS, Strangler Fig, Bulkhead, Sidecar.
For each candidate:
IF roles < 10 and stable: pure Strategy sufficient. IF >3 switch/case on same type: consider State pattern. IF files > 500 LOC: God Object -- extract classes.
find src/ -name "*.ts" | xargs wc -l \
| sort -rn | head -20
npx jscpd src/ --min-lines 10 --min-tokens 50
grep -rn "email: string\|price: number" \
--include="*.ts" src/
Key anti-patterns:
Save: docs/patterns/<feature>-pattern-analysis.md
Commit: "pattern: <feature> -- <pattern> (<confidence>)"
Append .godmode/pattern-results.tsv:
timestamp feature pattern category confidence antipatterns language files verdict
KEEP if: tests pass AND complexity reduced
AND code no more complex than necessary.
DISCARD if: pattern adds more complexity than it
removes OR tests fail.
STOP when FIRST of:
- Design problem resolved with tested implementation
- Anti-pattern scan complete, findings prioritized
- Pattern recommended with trade-offs + alternative
On failure: git reset --hard HEAD~1. Never pause.
| Failure | Action | |--|--| | Pattern adds complexity | Revert, simple code wins | | Refactoring breaks tests | Smaller steps, test each | | Team unfamiliar | Document with codebase example | | Conflicts with framework | Prefer framework conventions |
development
Web performance optimization. Lighthouse, bundle analysis, code splitting, image optimization, critical CSS, fonts, service workers, CDN.
development
Webhook design, delivery, retry, HMAC verification, event subscriptions, dead letter queues.
development
Vue.js mastery. Composition API, Pinia, Vue Router, Nuxt SSR/SSG, Vite optimization, testing.
development
Evidence gate. Run command, read full output, confirm or deny claim. No trust, only proof.