mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-09-30 12:39:42 +02:00
3.1 KiB
3.1 KiB
Contributing to Codeman
Prerequisites
- Node.js 22 (use
nvm use—.nvmrcis included) - tmux — required for session management
- Claude CLI — installed and accessible in
$PATH
First-Time Setup
# 1. Clone and enter the repo
git clone https://github.com/Ark0N/Codeman.git
cd Codeman
# 2. Pin Node version
nvm use
# 3. Install dependencies (also links packages/xterm-zerolag-input workspace)
npm install
# 4. Start the dev server
npm run dev
# Open http://localhost:3000
Development Commands
| Command | Purpose |
|---|---|
npm run dev |
Dev server at localhost:3000 |
npm run typecheck |
TypeScript type check |
npm run lint |
ESLint |
npm run lint:fix |
Auto-fix lint issues |
npm run format |
Prettier format |
npm run format:check |
Check formatting (used in CI) |
npm run build |
Production build |
npm run clean |
Remove dist/ |
Running Tests Safely
CRITICAL: If you are running inside a Codeman-managed tmux session, never run the full test suite — it spawns and kills tmux sessions and will crash your own session.
# Safe: run a single test file
npx vitest run test/<file>.test.ts
# Safe: run tests matching a name pattern
npx vitest run -t "pattern"
# DANGEROUS — only run outside of Codeman:
# npx vitest run
Test files use unique ports starting at 3150. Search const PORT = before adding a new test file.
Code Style
- TypeScript strict mode — all strict flags are enabled in
tsconfig.json. Code must passnpm run typecheckwith zero errors. - ESLint — run
npm run lintbefore submitting a PR. Usenpm run lint:fixfor auto-fixable issues. - Prettier — run
npm run formatto format source files. CI enforcesformat:check. - Import conventions:
- Utilities:
import { LRUMap, stripAnsi } from './utils' - Types:
import type { SessionState } from './types' - Config:
import { MAX_TERMINAL_BUFFER_SIZE } from './config/buffer-limits'
- Utilities:
Architecture Quick Reference
| Concern | File |
|---|---|
| Session/PTY | src/session.ts |
| Web server (~105 routes) | src/web/server.ts |
| All TypeScript types | src/types.ts |
| Frontend (vanilla JS) | src/web/public/app.js |
| Respawn state machine | src/respawn-controller.ts |
| Task/Ralph loop | src/ralph-loop.ts, src/ralph-tracker.ts |
See CLAUDE.md for the full architecture reference.
PR Checklist
npm run typecheckpassesnpm run lintpasses (or issues are documented)npm run format:checkpasses- Relevant test file updated or added
- No full test suite run inside a Codeman session
- tmux safety respected (no blind
tmux kill-session)
Repository Layout
src/ TypeScript source
test/ Vitest tests (run individually)
scripts/ Build and utility scripts
packages/ Local npm workspaces (xterm-zerolag-input)
tools/ Dev utilities (Remotion video generation)
docs/ Architecture docs and planning documents
mobile-test/ Playwright mobile test suite
agent-teams/ Agent Teams feature docs