AGENT SKILL

components

Atomic design, container-presentational, reusable components.

License 许可
MIT
最近更新
2026-08-26
Stars
★ 1
Forks
0

01 前言 Front Matter

name
components
description
Atomic design, container-presentational, reusable components.

03 SKILL.md 正文

Components - Atomic Design

Container/Presentational

// ✅ CORRECTO
function UserProfileContainer({ userId }) {
  const { user, loading } = useUser(userId)
  return <UserProfileView user={user} loading={loading} />
}

function UserProfileView({ user, loading }) {
  if (loading) return <Skeleton />
  return <div>{user?.name}</div>
}

// ❌ MIXED (PROHIBIDO)
function UserProfile({ userId }) {
  const [user, setUser] = useState(null)
  // ... todo mezclado
}

Atomic Structure

atoms/      → Button, Input, Label
molecules/  → FormGroup, SearchBar
organisms/  → Header, Sidebar, DataTable
templates/  → AuthLayout, DashboardLayout
pages/      → LoginPage, DashboardPage

Forbidden

  • ❌ Prop drilling > 2 niveles → context
  • ❌ Inline styles → CSS classes
  • ❌ Uncontrolled inputs → controlled
  • ❌ Memory leaks → cleanup useEffect

04 同仓库更多 Skills