# CLAUDE.md This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. ## Commands ```bash yarn test # run all tests (watch mode) yarn test:report # run tests with verbose output yarn coverage # run tests with coverage report yarn dev # start Vite dev server for the demo UI yarn build # compile TypeScript + build library to dist/ yarn add:module # scaffold a new algorithm module in lib// ``` To run a single test file: ```bash npx vitest run lib//.test.ts ``` ## Architecture The repo has two independent layers: - **`lib/`** — algorithm implementations, built as a publishable npm library. Each algorithm lives in its own subdirectory (`lib//`) with an implementation file, a test file, and an `index.ts` re-export. - **`src/`** — Vite demo app (development only, not shipped in the library). The library entry point is `lib/main.ts`. Build output goes to `dist/` (`counter.js` / `counter.umd.cjs`). ## Adding a New Algorithm ```bash yarn add:module ``` This creates `lib//` with: - `.ts` — implementation stub - `.test.ts` — Vitest test with default array `[-12, 1, 4, 6, 22]` - `index.ts` — re-export - `readme.md` — template with complexity table and time-tracking table (in Russian) For competitive-programming / stdin problems, use `lib/__templateForSolution.ts` as a base — it reads lines via `readline` and parses them as numbers. ## Testing Uses **Vitest** (not Jest). Test files live next to implementations in `lib/`. The `vitest.config.ts` enables `@vitest/coverage-v8` for HTML + JSON coverage reports (output in `coverage/`). ## Learning Structure Progress is tracked in `docs/`: - `docs/progress.md` — weekly skill ratings - `docs/daily-practice.md` — session log - `docs/learning-plan.md` / `docs/weekly-schedule.md` — roadmap - `docs/rules.md` — learning philosophy and algorithm phase breakdown (Phase 1–4 over 16 weeks)