This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm run dev # Dev server (Vite)
npm run build # TypeScript check + Vite build
npm run lint # ESLint
npm run test # Vitest (unit, run once)
npm run test:watch # Vitest (watch mode)
npm run test:e2e # Playwright (requires build first: npm run build && npm run preview)Run a single test file:
npx vitest run src/test/parser.test.tsPre-commit validation:
npm run lint && npm run test && npm run buildflowdive is a single-page React app (Vite + TypeScript + Tailwind v4) that visualizes GitHub Actions workflows with drill-down navigation.
There are four drill levels: orchestrator → job → step (or orchestrator → job → workflow → job → step when a job calls a reusable workflow). The active position is tracked in DrillState (types.ts) and synced to URL search params (?level=...&orc=...&wf=...&job=...).
- orchestrator level: Shows workflows that contain at least one
uses:job (reusable workflow callers). If none exist, falls back to showing all workflows. - job level: Shows jobs of the selected orchestrator or workflow.
- step level: Shows steps of the selected job.
- workflow level is only used in breadcrumbs when drilling through a
uses:-referencing job into a reusable workflow.
YamlLoader(file drop / GitHub API / paste) → callsonLoadwith raw{ name, content }[]parseMultipleFilesinparser.ts→ producesWorkflowData[]+OrchestratorData[]App.tsxholds all state:workflows,drillState,breadcrumb,popupcurrentItems()derives the displayed card list fromdrillStateon every render- Cards render in either
GraphView(React Flow + dagre layout) or grid (LevelCard)
resolveUsesRef / resolveUsesId match a job's uses: string to a loaded WorkflowData by:
- Exact
id/filenamematch - Filename suffix match (handles
./.github/workflows/foo.yml→foo.yml)
This is what makes drill-down from a uses:-job navigate into the called workflow instead of into steps.
App.tsx— all navigation logic (drillInto,navigateTo), state, URL syncparser.ts— pure YAML parsing;resolveUsesReffor cross-file linkingGraphView.tsx— React Flow canvas;buildGraphconstructs nodes/edges; dagre layout for graphs, grid layout for step/edge-free levelsLevelCard.tsx— card rendering for grid mode; delegates pill rendering toCardPills.tsxCardPills.tsx— also exportslevelConfig(colors/icons per level) used by both grid and graph nodesCardPopup.tsx— floating detail panel on card clickHudPanel.tsx— left/right ambient info panelsYamlLoader.tsx— file loading UI; also contains GitHub API fetch logic
- Unit tests (Vitest + Testing Library):
src/test/— covers parser, navigation, accessibility, CardPills, CardPopup, GraphView - E2E tests (Playwright):
e2e/— runs againstnpm run previewon port 4173 - Navigation tests stub out React Flow and Framer Motion to avoid canvas rendering issues; they switch to grid view before asserting on cards