agentleFS
MazalucasMazalucas/El-DT-Lightweight-Army/.cursor/rules/20-frontend-ui.mdc

El-DT-Lightweight-Army / rules

Cursor rule4 starsChanged 56 days agoMITView on GitHub

Convenciones de frontend, componentes, estado, accesibilidad

The file

Files
20-frontend-ui.mdc
---
description: Convenciones de frontend, componentes, estado, accesibilidad
globs: "**/*.tsx, **/*.vue, **/*.jsx, **/frontend/**/*, **/components/**/*"
alwaysApply: false
---

# Frontend y UI

Stack default del DT: ver regla `08-stack-web-default` y `vitals/data/engineering/web-stack.yaml`.

## Stack default (proyecto web nuevo)

- **Bundler**: Vite
- **UI**: React (componentes funcionales)
- **Backend client**: Firebase JS SDK modular (v9+)
- **Alternativas permitidas**: React solo, Vite solo — según `web-stack.yaml`

Si el repo ya usa otro framework, respetarlo (soft default).

## Componentes

- Usar componentes funcionales
- Extraer hooks para lógica reutilizable
- Colocar estilos cerca de componentes
- Preferir composición sobre herencia

## Estado

- Estado local para UI; estado global solo cuando cruza muchos componentes
- Evitar prop drilling excesivo; considerar context o state management

## Accesibilidad

- Atributos ARIA cuando sea necesario
- Labels en formularios
- Contraste de colores
- Navegación por teclado

## Performance

- Lazy load de rutas/componentes pesados
- Memoización cuando el costo de re-render es alto
- Imágenes optimizadas

## Reutilización (reuse-first)

Regla transversal: `15-engineering-reuse` · skill `frontend` · `DOC-REF-006`.

- **No duplicar componentes** — buscar en `components/`, `ui/`, hooks existentes; variant props antes de archivo nuevo
- **Tokens semánticos** del design system o Atelier — no hex sueltos si hay handoff
- **Handoff Atelier**: implementar `component-specs` tal cual (skill `frontend/references/atelier-handoff.md`)
- **Composición** sobre copiar markup entre páginas

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.