This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
npm test # Run all Jest unit tests (jsdom environment)
npm run test:watch # Run tests in watch mode
npm run test:e2e # Run Playwright E2E tests (requires port 9173 free)
npm run bundle # Bundle src/ into dist/index.js via Browserify
npm run bundle:watch # Watch src/ and auto-rebundle on changes
npm run refactor # Run tests → bundle → git commit (resets on failure)To run a single test file: npx jest spec/board.spec.js
The app is a static site — open index.html directly in a browser, or use npx serve . during E2E testing.
This is a kanban flow simulator that lets users configure team structures and WIP limits, then animates cards moving through columns while computing throughput, cycle time, and WIP metrics.
All source files are CommonJS modules in src/, bundled by Browserify into dist/index.js. No TypeScript, no transpilation — plain ES5-compatible JS.
Modules communicate almost entirely through PubSub events (via pubsub-js) rather than direct calls. Key events:
board.ready,board.done— simulation lifecycleworkitem.added/started/finished/removed— card lifecycleworker.working/idle/created— worker statestats.calculated— triggers chart updates
index.html form → parsing.js → scenario.js → board.js → worker.js
↓ (PubSub events)
animation.js (DOM cards) ← stats.js → charts
setup.js— wires up the form, creates scenarios, manages chart lifecycle; the main orchestratorboard.js— runs the simulation: assigns work items to workers each tick, manages columns, enforces WIP limitsworker.js— workers have a skill set; they pull work items matching their skillsscenario.js— thin wrapper that holds parsed config and creates the boardparsing.js— converts user-entered strings (e.g."dev:2, qa:1") into config objectsstrategies.js— pluggable WIP-limiting strategiesstats.js— computes throughput, cycle time, WIP per tick; publishesstats.calculatedanimation.js— subscribes to work item events and renders/moves DOM cardscharts.js,HistogramChart.js,CumulativeFlowDiagram.js— Chart.js v4 wrappers for line chart, histogram, and CFD
Unit tests live in spec/ (Jest + jsdom). E2E tests in e2e/ (Playwright, Chrome only, served at localhost:9173). The Playwright config is in playwright.config.js.