Prerequisites
- Bun — worker runtime and build tool
- Node.js 18+ — for npm tooling
- Git
Build from Source
build-and-sync runs scripts/build-hooks.js (via Bun) which:
- Compiles TypeScript hooks → ESM scripts → bundles with esbuild
- Bundles
worker-service.cjs(~1.7MB) - Bundles
vl-cli.cjs(~10KB) - Syncs built artifacts to
~/.claude/plugins/marketplaces/vibelearn/ - Restarts the worker
Build Artifacts
| Output | Source | Purpose |
|---|---|---|
plugin/scripts/*-hook.js | src/hooks/*.ts | Hook scripts |
plugin/scripts/worker-service.cjs | src/services/worker-service.ts | Worker bundle |
plugin/scripts/vl-cli.cjs | src/cli/vl/index.ts | vl CLI bundle |
plugin/scripts/worker-wrapper.cjs | pre-built | Bun process manager |
Development Workflow
Adding a New Analysis Step
- Create
src/services/analysis/MyAnalyzer.ts - Add a new route in
src/services/worker/http/routes/VibeLearnRoutes.ts - Call it from
src/hooks/summarize.ts(the Stop hook dispatcher) - Add any new columns to
src/services/sqlite/migrations.ts(increment migration ID)
Adding a New vl CLI Command
Editsrc/cli/vl/index.ts. The CLI uses bun:sqlite directly — no HTTP to worker.
Database Migrations
Add migrations to the array insrc/services/sqlite/migrations.ts:
Code Style
- TypeScript strict mode
- ESM modules throughout (
import/export, norequire) - Hooks: always exit 0 (never block the IDE)
- Worker errors: log at ERROR level, continue execution
- Analysis steps: independent — step failure must not block subsequent steps
Testing
VibeLearn uses real-world testing: install the plugin, run coding sessions, checkvl quiz. The analysis pipeline is LLM-dependent and not meaningfully unit-testable.
For worker endpoint testing:
Publishing
vibelearn@anergcorp
