一键导入
frontend-dev-patterns
Frontend development patterns for Flightdeck. Covers API calls, routing, component conventions, state management, and testing practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Frontend development patterns for Flightdeck. Covers API calls, routing, component conventions, state management, and testing practices.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How the multi-backend adapter system works — AgentAdapter interface, ACP protocol, session resume, and how to add new provider adapters
When debugging why an agent has the wrong provider/model, or when modifying agent creation or delegation flows.
How to get agents to use group chats for peer coordination in flightdeck-based crews. Covers hub-and-spoke anti-pattern, auto-grouping triggers, and file-lock-linked groups. Use when setting up multi-agent crews with 3+ agents or diagnosing why agents aren't collaborating directly.
When fetching from the `/coordination/activity` API and you only need specific action types (e.g., `progress_update`, `task_completed`, `delegated`).
When fetching activity data for UI display, or debugging why activity-based features show empty/stale data.
Architecture decisions and patterns from Flightdeck development (Phases 2–4). Covers feature architecture, state management, component patterns, and API design.
| name | frontend-dev-patterns |
| description | Frontend development patterns for Flightdeck. Covers API calls, routing, component conventions, state management, and testing practices. |
apiFetch() already prepends /api — never write apiFetch('/api/projects'), use apiFetch('/projects').SERVER_PORT env (default 3006). Vite dev server on :5173 proxies /api/* to the server automatically.<Link to="..."> for internal navigation, never <a href="...">. Anchor tags cause full page refreshes and lose client state.React.lazy() for code splitting — follow the pattern in App.tsx.useShallow() on high-frequency update paths (e.g., agent list, token counters) to prevent unnecessary re-renders.setState results in useCallback dependency arrays — causes infinite re-fetch loops.<text> elements ignore CSS — Tailwind classes and CSS variables won't style SVG text. Pass fill directly via tickLabelProps or inline props.#9ca3af (gray-400 equivalent) for axis labels, #6b7280 for secondary text.var(--color-th-text) don't reliably reach SVG — always use hex values.<ProjectTabs> — shared project selector used on Overview, Timeline, Canvas, Mission Control. Always use this for project switching (not dropdowns).useProjects() hook — fetches projects from /projects REST endpoint. Returns { projects, loading }.useHistoricalAgents() hook — derives agent data from keyframes for historical sessions. Use as fallback when live store agents are empty.groupTimeline() — batches sequential chat messages from the same sender. Use in chat/activity views.bg-th-bg, bg-th-bg-alt, text-th-text, text-th-text-alt, text-th-text-muted, border-th-border, bg-th-accent.motion.css — three animation tiers: micro (100-150ms), standard (200-300ms), dramatic (400-600ms). Import and apply via class.chart-theme.css — defines chart color palette as CSS variables. Import in chart components.line-clamp-2 (not truncate) when text may need two lines. Add title={fullText} for tooltip on truncated content.shrink-0 on a sibling outside the scrollable flex-1 min-h-0 overflow-auto container. Never nest fixed controls inside a scrollable area.min-width based on item count (e.g., Math.max(600, agents.length * 80)), let overflow-auto handle the rest.deltaY for vertical, Shift+wheel / deltaX for horizontal, Ctrl+wheel for zoom.react-virtuoso for large lists (chat messages, activity feeds). Only renders visible items — keeps DOM small.components.Header / components.Footer to stable refs — inline definitions cause remounts on every scroll.useProjects() — fetches from /projects. Shared across all pages.useHistoricalAgents(projectId) — derives agent list from keyframes when no live agents. Use as fallback.groupTimeline(messages) — batches sequential messages from same sender. Preserves message integrity.public/fonts/ with @font-face declarations. Never use CDN.font-feature-settings: 'liga' 1, 'calt' 1 on .font-mono for ligatures.font-display: swap for performance.