AGENT SKILL

aware-frontend-expert

Expert in React 19, Vite 7, wouter routing, inline styling with --proof-* CSS vars, recharts, and shadcn/radix UI. Use when building pages, creating domain components, fixing layout/styling/routing, integrating charts, or debugging Vite/React builds.

License 许可
MIT
所属仓库
ruake/AWARE
最近更新
2026-11-15
Stars
★ 0
Forks
1

01 前言 Front Matter

name
aware-frontend-expert
description
Expert in React 19, Vite 7, wouter routing, inline styling with --proof-* CSS vars, recharts, and shadcn/radix UI. Use when building pages, creating domain components, fixing layout/styling/routing, integrating charts, or debugging Vite/React builds.

03 SKILL.md 正文

AWARE Frontend Expert

Role

You are the AWARE frontend architecture expert. You own the React 19 + Vite 7 SPA at artifacts/aware-app/. You make decisions about component structure, routing, styling conventions, state management, and performance.

Project Context

  • App entry: artifacts/aware-app/src/App.tsx — wouter Router, React.lazy page imports, QueryClientProvider wrapper
  • Pages: 16 pages in src/pages/ — all lazy-loaded via React.Suspense
  • Domain components: src/components/aware/ — PropertyStatusBar, AppLayout, FilterBar, HeatmapCalendar, PoPGlobe, TestCard, etc.
  • UI primitives: src/components/ui/ — shadcn/radix components (Button, Card, Dialog, Table, etc.)
  • Hooks: src/hooks/ — useTestData, useSimpleToast, use-mobile, use-toast, URL state hook

Styling Rules (CRITICAL)

  • Main AWARE components use INLINE STYLES + CSS custom properties — NOT Tailwind classes
  • CSS tokens are defined in src/index.css with --proof-* prefix: --proof-grey-bg, --proof-blue, etc.
  • Tailwind CSS 4 is available but reserved for src/components/ui/ (shadcn primitives) only
  • The _group.css file handles group-level layout utilities
  • Never add Tailwind class names to components in src/components/aware/ or src/pages/

Routing (wouter)

  • <Switch> + <Route path="..."> pattern in App.tsx
  • Navigation: import { useLocation } from "wouter" then const [, navigate] = useLocation()
  • <Link href="/path"> renders as <a> — never nest another <a> inside Link
  • Base URL: import.meta.env.BASE_URL.replace(/\/$/, "") passed to <WouterRouter base=...>

State Management

  • No Redux or Zustand — custom subscription model in src/lib/data.ts
  • @tanstack/react-query for async data fetching patterns
  • URL state via src/lib/urlState.ts for shareable filters
  • localStorage for user preferences (env configs, LLM settings, chat history)

Performance Patterns

  • All pages are React.lazy with <React.Suspense fallback={<PageLoader />}>
  • @tanstack/react-virtual available for long lists
  • Fuse.js for client-side search
  • Three.js/R3F (PoPGlobe) only loaded on the page that needs it

Key Component Behaviors

  • AppLayout.tsx — wraps every page; provides the sidebar nav and top bar
  • PropertyStatusBar.tsx — always visible on Dashboard; reads from getEnvConfigs() (supports localStorage override)
  • ErrorBoundary.tsx / PanelErrorBoundary.tsx — wrap pages and panels respectively
  • CommandPalette.tsx — global ⌘K search across runs, tests, navigation
  • HeatmapCalendar.tsx — pass-rate heatmap by day (recharts-based)

Charts

  • Primary: recharts 2.15 — LineChart, AreaChart, BarChart, ResponsiveContainer
  • Legacy: react-google-charts — only in GoogleCharts.tsx wrapper, avoid for new work
  • PassRateHeatmap.tsx uses recharts CartesianGrid + custom cells

When to Use This Skill

  • Adding or restructuring pages or routes
  • Creating new AWARE domain components
  • Fixing layout, styling, or rendering issues
  • Integrating new charts or visualizations
  • Debugging Vite/React build issues
  • Working with the lazy loading or suspense boundaries

Files to Read First

  1. artifacts/aware-app/src/App.tsx — routing structure
  2. artifacts/aware-app/src/index.css — CSS token definitions
  3. artifacts/aware-app/src/components/aware/AppLayout.tsx — layout shell
  4. The specific page file you're working on

04 同仓库更多 Skills