This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Learn Harness Engineering is a project-based course on building reliable coding environments for AI agents. The repo contains a VitePress documentation site plus hands-on project code.
# Documentation site
npm install
npm run docs:dev # Dev server with hot reload (VitePress)
npm run docs:build # Production build
npm run docs:preview # Preview built site
# Run lecture code examples
npx tsx docs/lectures/<lecture-dir>/code/<file>.ts
# Project Electron apps (from each project directory)
cd projects/project-NN/starter # or solution/
npm install
npm run dev # Build + launch Electron (via scripts/dev.js)
npm run check # Type-check both tsconfig.json and tsconfig.node.json
npm run test # Vitest run (single run)
npm run test:watch # Vitest watch modedocs/— VitePress documentation site (lectures, projects, resources)docs/.vitepress/config.mts— Nav/sidebar config for both EN and ZH localesdocs/lectures/— 12 lectures, each withindex.md+code/examplesdocs/projects/— 6 project descriptionsdocs/resources/— Bilingual (en/zh) templates, references, OpenAI advanced packprojects/shared/— Shared Electron + TypeScript + React foundationprojects/project-NN/— Per-projectstarter/andsolution/directories
The course revolves around an Electron knowledge-base desktop app that evolves across 6 projects:
- Main process (
src/main/): Window management, IPC handlers, service initialization - Preload (
src/preload/): contextBridge exposing typed API to renderer - Renderer (
src/renderer/): React UI with document list, Q&A panel, status bar - Services (
src/services/): DocumentService, IndexingService, QaService, PersistenceService - Shared types (
src/shared/types.ts): Cross-boundary interfaces and IPC channel constants
Each project's starter/solution is a complete copy of the Electron app at that evolutionary stage. P(N+1) starter is derived from P(N) solution. The shared foundation is in projects/shared/.
- IPC channels defined as constants in
src/shared/types.ts(IPC_CHANNELS) — single source of truth - All data stored locally as JSON/text files (no database)
- Mock Q&A returns structured answers with citations (no real LLM API)
- Harness files in project roots: AGENTS.md, CLAUDE.md, feature_list.json, init.sh, claude-progress.md
- Progressive disclosure: short AGENTS.md entrypoint linking to focused docs
- Each project has two tsconfigs:
tsconfig.json(renderer) andtsconfig.node.json(main/preload)
All content exists in both English and Chinese. Documentation lives in shared docs/lectures/ and docs/projects/ dirs (content is bilingual within each file). Resources have separate docs/resources/en/ and docs/resources/zh/ directories. Keep both in sync.