// ❌ Hardcoded Tailwind colors
```
---
## Decision Framework
When implementing any feature, follow this checklist:
### Before Writing Code
1. **Check existing patterns** in AGENTS.md
2. **Search for similar implementations** in the codebase
3. **Review relevant skills** in `.agent/skills/`
4. **Consider: Is this a one-off or a pattern?**
### While Writing Code
1. **Extract reusable pieces** into utilities/components
2. **Use centralized configuration** (settings, registries)
3. **Add proper error handling** with AppError
4. **Follow the design system** for all UI
### After Writing Code
1. **Update documentation** if adding new patterns
2. **Add to design system page** if creating UI components
3. **Reference in AGENTS.md** if it's a key pattern
4. **Create a skill** if it's complex enough
---
## Cross-Skill References
| When Working On | Reference Skill |
|-----------------|-----------------|
| New features | `prd-creation` |
| API routes | `api-handler` |
| Database queries | `supabase-patterns` |
| Error handling | `error-handling` |
| UI/Styling | `design-system` |
| Forms | `form-components` |
| After completion | `project-updates` |
---
## Anti-Patterns to Avoid
### 1. The "Quick Fix"
> "I'll just add this inline, it's faster"
**Why it's bad:** Creates tech debt, makes code harder to maintain.
**Instead:** Take 5 extra minutes to do it properly.
### 2. The "Special Case"
> "This component is unique, it needs custom styling"
**Why it's bad:** Breaks consistency, harder to theme.
**Instead:** Use existing components, extend if needed.
### 3. The "Magic Number"
> `if (count > 50) { ... }`
**Why it's bad:** Unexplained, not configurable.
**Instead:** Use settings or named constants.
### 4. The "Silenced Error"
> `try { ... } catch { /* ignore */ }`
**Why it's bad:** Hides bugs, makes debugging impossible.
**Instead:** Use `normalizeError()` and `reportErrorClient()`.
### 5. The "Copy-Paste Component"
> Creating a new component that's 90% the same as existing one.
**Why it's bad:** Duplicated code, inconsistent behavior.
**Instead:** Extract shared logic, use props for variations.
---
## The 3-Time Rule
**If you do something 3 times, extract it.**
| Count | Action |
|-------|--------|
| 1st time | Implement inline |
| 2nd time | Note the pattern |
| 3rd time | Extract to utility/component/skill |
---
## Key Reference Files
| Area | File |
|------|------|
| Error handling | `src/lib/errors.ts` |
| API handler | `src/lib/api/handler.ts` |
| Form components | `src/components/ui/form-fields.tsx` |
| Badge config | `src/lib/badges.ts` |
| Cache registry | `src/lib/cache/serverCache.ts` |
| Menu config | `src/lib/menuConfig.ts` |
| Theme variables | `src/app/globals.css` |
| Settings hook | `src/hooks/useAppSettings.ts` |
---
## Summary
> **Build systems, not solutions.**
>
> Every feature you implement should make the next feature easier to build.