diff --git a/.rules b/.rules index bf77bd6c..ce1baad2 100644 --- a/.rules +++ b/.rules @@ -1,6 +1,6 @@ # IGNY8 AI Agent Rules -**Version:** 1.1.3 | **Updated:** December 27, 2025 +**Version:** 1.2.0 | **Updated:** January 2, 2026 --- @@ -8,8 +8,10 @@ **BEFORE any change, read these docs in order:** 1. [docs/INDEX.md](docs/INDEX.md) - Quick navigation to any module/feature -2. Module doc for the feature you're modifying (see INDEX.md for paths) -3. [CHANGELOG.md](CHANGELOG.md) - Recent changes and version history +2. [docs/30-FRONTEND/COMPONENT-SYSTEM.md](docs/30-FRONTEND/COMPONENT-SYSTEM.md) - **REQUIRED** for any frontend work +3. [docs/30-FRONTEND/DESIGN-TOKENS.md](docs/30-FRONTEND/DESIGN-TOKENS.md) - Color tokens and styling rules +4. Module doc for the feature you're modifying (see INDEX.md for paths) +5. [CHANGELOG.md](CHANGELOG.md) - Recent changes and version history --- @@ -21,6 +23,10 @@ | Frontend | `frontend/src/` | React + TypeScript SPA | | Docs | `docs/` | Technical documentation | | AI Engine | `backend/igny8_core/ai/` | AI functions (use this, NOT `utils/ai_processor.py`) | +| Design Tokens | `frontend/src/styles/design-system.css` | **Single source** for colors, shadows, typography | +| UI Components | `frontend/src/components/ui/` | Button, Badge, Card, Modal, etc. | +| Form Components | `frontend/src/components/form/` | InputField, Select, Checkbox, Switch | +| Icons | `frontend/src/icons/` | All SVG icons (import from `../../icons`) | **Module → File Quick Reference:** See [docs/INDEX.md](docs/INDEX.md#module--file-quick-reference) @@ -45,6 +51,104 @@ --- +## 🎨 DESIGN SYSTEM RULES (CRITICAL!) + +> **🔒 STYLE LOCKED** - All UI must use the design system. ESLint enforces these rules. + +### Color System (Only 6 Base Colors!) + +All colors in the system derive from 6 primary hex values in `design-system.css`: +- `--color-primary` (#0077B6) - Brand Blue +- `--color-success` (#2CA18E) - Success Green +- `--color-warning` (#D9A12C) - Warning Amber +- `--color-danger` (#A12C40) - Danger Red +- `--color-purple` (#2C40A1) - Purple accent +- `--color-gray-base` (#667085) - Neutral gray + +### Tailwind Color Classes + +**✅ USE ONLY THESE** (Tailwind defaults are DISABLED): +``` +brand-* (50-950) - Primary blue scale +gray-* (25-950) - Neutral scale +success-* (25-950) - Green scale +error-* (25-950) - Red scale +warning-* (25-950) - Amber scale +purple-* (25-950) - Purple scale +``` + +**❌ BANNED** (These will NOT work): +``` +blue-*, red-*, green-*, emerald-*, amber-*, indigo-*, +pink-*, rose-*, sky-*, teal-*, cyan-*, etc. +``` + +### Styling Rules + +| ✅ DO | ❌ DON'T | +|-------|---------| +| `className="bg-brand-500"` | `className="bg-blue-500"` | +| `className="text-gray-700"` | `className="text-[#333]"` | +| `