- Date: 2025-12-06
- HAI3 CLI Version: 0.1.0-alpha.15
- Test Screenset: dashboards (AI-generated with known issues)
| File | Violation Type | Expected Detection |
|---|---|---|
| HomeScreen.tsx | Inline component: StatsCards | ESLint warn |
| HomeScreen.tsx | Inline component: RevenueChart | ESLint warn |
| HomeScreen.tsx | Inline component: TrafficChart | ESLint warn |
| HomeScreen.tsx | Inline component: DevicesChart | ESLint warn |
| HomeScreen.tsx | Inline component: ActivityCard | ESLint warn |
| HomeScreen.tsx | Inline data: revenueData | CLI (not implemented) |
| HomeScreen.tsx | Inline data: trafficData | CLI (not implemented) |
| HomeScreen.tsx | Inline data: devicesData | CLI (not implemented) |
| HomeScreen.tsx | Inline data: statsData | CLI (not implemented) |
- PASS
- Violations detected: 5 inline component ERRORS for dashboards screenset
- Expected: 5 inline component errors (excluding main screen export)
- Actual: 5 errors (StatsCards, RevenueChart, TrafficChart, DevicesChart, ActivityCard)
- Note: HomeScreen correctly excluded as main export using Program:exit pattern
- Details:
/src/screensets/dashboards/screens/home/HomeScreen.tsx 128:7 error Inline component "StatsCards" detected 158:7 error Inline component "RevenueChart" detected 206:7 error Inline component "TrafficChart" detected 248:7 error Inline component "DevicesChart" detected 289:7 error Inline component "ActivityCard" detected
- PASS
- Violations detected: 5 inline component errors
- Expected: 5 inline components
- Note: CLI correctly excludes the main exported component (HomeScreen)
- Details:
src/screensets/dashboards/screens/home/HomeScreen.tsx: [inline-component]:128 Inline component "StatsCards" detected [inline-component]:158 Inline component "RevenueChart" detected [inline-component]:206 Inline component "TrafficChart" detected [inline-component]:248 Inline component "DevicesChart" detected [inline-component]:289 Inline component "ActivityCard" detected
- SKIP - Not integrated in this change
- Note: arch:check runs dependency-cruiser and knip, not component validation
- Component validation can be added as separate npm script
- .ai/targets/SCREENSETS.md - Added Component Placement Rules section
- .ai/commands/hai3-new-screenset.md - Added prerequisites check and component planning
- .ai/commands/hai3-new-screen.md - Added prerequisites check and component planning
- .ai/commands/hai3-quick-ref.md - Added Component Placement section
- .ai/commands/hai3-validate.md - Added component violation checks
- .ai/commands/hai3-fix-violation.md - Added component placement fixes
Note: .ai/targets/AI.md does NOT get standalone marker - it is meta-documentation for AI writing guidelines, not guidelines for standalone projects.
- All guideline files under 100 lines
- All files ASCII only (verified with
filecommand) - All guideline files have
<!-- @standalone -->marker
| Rule | Description | Severity | Status |
|---|---|---|---|
| local/no-inline-styles | Detect style={{}} and hex colors | error | Working |
| local/uikit-no-business-logic | Detect business logic imports in components/ui/ | error | Working |
| local/screen-inline-components | Detect React.FC definitions in *Screen.tsx | warning | Working |
hai3 validate components [path]- Validates component structure- Detects: inline components, inline data (partial), uikit impurity, inline styles
- Exit code: 1 if errors found, 0 otherwise
-
ESLint screen-inline-components: Detects main screen component as inline.FIXED: Now uses Program:exit pattern to collect all declarations first, then filters out default export. -
CLI inline-data detection: Pattern is too greedy, only matches first object. Full implementation requires more sophisticated parsing.
-
Hex colors in demo screenset: DataDisplayElements.tsx uses hex colors for chart colors. These should use CSS variables.
-
Inline styles in packages/studio: Studio panel uses inline styles. Should use Tailwind or extract to CSS.
| Check | Status | Notes |
|---|---|---|
| ESLint inline components | PASS | 5 errors detected (arch:check enforced) |
| ESLint inline styles | PASS | Detecting violations |
| ESLint hex colors | PASS | Detecting violations |
| ESLint uikit purity | PASS | Working, correctly ignores screens/uikit/ |
| CLI inline components | PASS | 5 errors detected as expected |
| CLI inline data arrays | PARTIAL | Pattern needs improvement |
| AI guidelines | PASS | All updated with component rules |
| Standalone markers | PASS | All guideline files have markers |
Fix ESLint screen-inline-components to not flag the main exported componentDONE- Improve CLI inline data array detection pattern (future improvement)
- Consider adding component validation to arch:check (optional)
- Fix existing violations in demo screenset (hex colors) and studio package (inline styles) - separate task
Component decomposition rules are implemented and working. ESLint rules detect inline components, styles, and hex colors. CLI command provides additional validation. AI guidelines have been updated to guide proper component placement.
Ready for merge with known issues documented.