Builds the Pixel Office React frontend that integrates the game engine, WebSocket client, and dashboard UI. Creates the complete user-facing application with agent monitoring panel. Triggers when UI features, layout changes, or frontend integration is needed.
이 스킬은 Pixel Office의 React 프론트엔드를 구축한다.
반드시 먼저 확인할 파일:
src/shared/types.ts — 공유 타입src/engine/index.ts — 게임 엔진 public APIsrc/shared/asset-manifest.ts — 에셋 매니페스트src/shared/office-layout.ts — 오피스 레이아웃이 파일들이 존재해야 프론트엔드를 제대로 구축할 수 있다.
index.html:
<div id="root"> 마운트 포인트src/client/main.tsx:
<App /> 렌더src/client/hooks/useWebSocket.tsexport function useWebSocket(url: string) {
// 반환값
return {
isConnected: boolean;
messages: WSMessage[];
connectionState: 'connected' | 'disconnected' | 'reconnecting';
};
}
src/client/hooks/useAgentState.ts)export function useAgentState(messages: WSMessage[]) {
return {
agents: Map<string, AgentState>;
agentList: AgentState[]; // 정렬된 배열
};
}
agent-update (배열) → 전체 교체agent-update (단일) → 해당 에이전트만 업데이트agent-added → 맵에 추가agent-removed → 맵에서 제거src/client/hooks/useGameEngine.ts)export function useGameEngine(
canvasRef: RefObject<HTMLCanvasElement>,
agents: Map<string, AgentState>
) {
return {
engine: PixelOfficeEngine | null;
focusOnAgent: (id: string) => void;
};
}
App.tsx — 메인 레이아웃┌──────────────────────────────────────────┐
│ 🏢 Pixel Office [설정] │ ← Header (48px)
├─────────────────────────┬────────────────┤
│ │ │
│ │ AgentPanel │
│ OfficeCanvas │ (280px 고정) │
│ (나머지 공간) │ │
│ │ │
├─────────────────────────┴────────────────┤
│ ● Connected │ Agents: 3 │ FPS: 60 │ ← StatusBar (32px)
└──────────────────────────────────────────┘
CSS: flexbox 기반, 다크 테마
OfficeCanvas.tsxAgentPanel.tsx에이전트 카드 목록:
┌─────────────────────┐
│ 🟢 Claude-pixel-1 │
│ Status: typing │
│ Writing to App.tsx │
│ 2초 전 │
├─────────────────────┤
│ 🟡 Claude-api-2 │
│ Status: waiting │
│ Awaiting user input │
│ 45초 전 │
├─────────────────────┤
│ ⚪ Claude-test-3 │
│ Status: idle │
│ No recent activity │
│ 3분 전 │
└─────────────────────┘
상태별 색상 인디케이터:
typing → 녹색 (🟢)reading → 파랑 (🔵)executing → 보라 (🟣)waiting → 주황 (🟡) + 깜빡임idle → 회색 (⚪)done → 하늘색 (✅)error → 빨강 (🔴) + 깜빡임카드 클릭 → 해당 캐릭터로 카메라 포커스
StatusBar.tsx하단 상태 바:
Tooltip.tsx캐릭터 호버/클릭 시 팝업:
src/client/styles/)다크 테마 기본:
#1a1a2e (다크 네이비)#16213e (약간 밝은 네이비)#e0e0e0#8B5CF6 (보라)#22C55E, 경고: #F97316, 에러: #EF4444폰트: 'Courier New', monospace (픽셀 아트 느낌)
tsc --noEmit 통과)