用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arbazkhan971/godmode --skill pattern命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | pattern |
| description | Design pattern recommendation and anti-pattern detection. |
/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 |