Document Anti-Pattern
COMMAND: Document code to avoid and the correct alternative.
Execute
- •Parse argument for anti-pattern and correct approach
- •Create patterns/bad/ if needed
- •Add entry to patterns/bad/anti-patterns.md
- •Report what was documented
Input Handling
| Input | Action |
|---|---|
/bad-pattern any type - use unknown | Document with both bad and good |
/bad-pattern inline SQL | Ask for correct approach |
/bad-pattern | Ask what to document |
Anti-Pattern Template
Add to patterns/bad/anti-patterns.md:
markdown
## [Category]: [Description] **Severity:** Critical | High | Medium | Low ### Don't Do This ```[language] [bad code]
Problems:
- •[Issue]
Do This Instead
[language]
[good code]
Why: [Explanation]
code
## Severity Guide - **Critical**: Security, data loss - **High**: Performance, maintenance burden - **Medium**: Code smell - **Low**: Style preference ## Output
Anti-pattern documented in patterns/bad/anti-patterns.md
code
If details missing, use TBD markers.