一键导入
standards
Type safety, design tokens, UI states, React/Next.js patterns from production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Type safety, design tokens, UI states, React/Next.js patterns from production.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | standards |
| description | Type safety, design tokens, UI states, React/Next.js patterns from production. |
| user-invocable | false |
| disable-model-invocation | true |
| allowed-tools | Read, Grep, Glob |
| model | opus |
Senior developer judgment. Patterns learned from production.
Every component handles: loading → error → empty → content
if (isLoading) return <Skeleton />;
if (error) return <ErrorState message={error.message} />;
if (!data?.length) return <EmptyState />;
return <Content data={data} />;
Every page works at 3 breakpoints: mobile (375px), tablet (768px), desktop (1280px+).
md:block hidden)grid-cols-1 md:grid-cols-2 lg:grid-cols-3)<button> for actions, <a>/<Link> for navigation (not <div onClick>)aria-label<label> or aria-labelalt (or alt="" if decorative)focus-visible:ring-* (not bare outline-none)touch-action: manipulation on touch targetstype and inputmode on inputsautocomplete on form fieldsprefers-reduced-motiontransform/opacity (compositor-friendly)transition: all)value need onChange (or use defaultValue)'use client' only for state/effects/handlers<img> needs explicit width and height (prevents CLS)loading="lazy"; above-fold: priority or fetchpriority="high"virtua or content-visibility: auto| Rule | Wrong | Right |
|---|---|---|
No any or @ts-ignore | data as any | Proper typing |
| Single source of truth | Define type in 3 files | Define once, import |
| Complete Records | Missing union members | Include all members |
| Supabase typing | Untyped .insert() | Database['table']['Insert'] |
| Safe access | obj[key] | 'key' in obj && ... |
| Rule | Wrong | Right |
|---|---|---|
| No nested interactives | <button><button> | role="button" |
| Hooks at top level | onClick={() => useState()} | Hooks in component body |
| No conditional hooks | if (x) useEffect() | useEffect(() => { if (x) }) |
// Auth errors — fail closed (deny by default)
if (!session) {
redirect('/login'); // ALWAYS deny first
return;
}
// Only after auth passes, proceed with protected logic
// Fetch errors — always check response
const res = await fetch('/api/data');
if (!res.ok) {
throw new Error(`API error: ${res.status}`);
}
const data = await res.json();
// Validate external data shape before casting
const parsed = schema.safeParse(data);
if (!parsed.success) {
throw new Error('Unexpected API response shape');
}
// Auth errors
if (error?.error_type === 'reauth_required') {
toast.error('Session expired');
}
// Storage quota
try {
localStorage.setItem(key, value);
} catch (e) {
if (e.name === 'QuotaExceededError') {
toast.error('Storage full');
}
}
export const queryKeys = {
reports: {
all: ['reports'] as const,
detail: (id: string) => ['reports', id] as const,
}
} as const;
Fix in this order — earlier items have bigger impact:
// Bad - sequential (600ms)
const user = await getUser(id);
const posts = await getPosts(id);
// Good - parallel (200ms)
const [user, posts] = await Promise.all([getUser(id), getPosts(id)]);
Promise.all() for independent operationsReact.cache() for per-request deduplication<Suspense> for streamingindex.ts re-exports) — they prevent tree-shakingdynamic(() => import('./Chart'), { ssr: false })import format from 'date-fns/format' not import { format } from 'date-fns''use client' as low as possible in the component treeReact.cache() to deduplicate identical server-side fetchesCache-Control headers for static datauseEffect + fetchstaleTime to avoid refetching on every mountuseCallback for handlers passed to memoized childrenuseState(() => expensiveComputation())// Bad - boolean prop explosion
<Card isCompact isHighlighted hasBorder isClickable />
// Good - composition
<Card variant="compact">
<Card.Highlight>Content</Card.Highlight>
</Card>
forwardRef (React 19+), use use() instead of useContext()user-scalable=no or maximum-scale=1transition: alloutline-none without focus-visible replacement<div>/<span> with click handlers (should be <button>)Intl.*)text-foreground, not text-gray-500)p-4, not p-[15px])as unknown as Type on DB/API data — validate shape with Zod firstfetch() without error handling — always check res.ok and wrap in try/catchif (!session) redirect must be the DEFAULT, not if (session) allow/dashboard/*, /api/* route must be auth-checkedtext-foreground, bg-background, text-muted-foreground)p-4, not p-[15px])Log errors to .claude/mistakes.md:
## [Category]: [Description]
**Task:** ID
**Error:** What
**Fix:** How
**Prevention:** Rule
Categories: Type Safety, React, API, Performance, A11y
Be concise. Short responses = more runway.
Show token / tool usage stats from the local telemetry log. Use when you want to know "which tools am I burning context on", "which skills are expensive", or "was yesterday's session mostly Read/Grep or actually productive".
Parallel quality audit with 7 specialized agents (Opus). Finds bugs, violations, and quality issues. Use audit for fixes, brainstorm for features.
Manage environment variables with Doppler — auto-install CLI, login, link projects, wrap commands with `doppler run`. Replaces scattered .env files with a hub/spoke architecture.
Scaffolds new projects or onboards existing ones. Detects stack, creates monorepo/single-app, configures strict tooling. Use for greenfield or first-time setup.
Archives completed stories from prd.json to reduce token usage.
Autonomous task execution with testing and security. Works through all tasks without stopping.