This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
This is a Kanban-style task management system that integrates with Claude Code to provide automated task execution. The system allows users to create tasks, queue them for execution, and have Claude Code automatically work on them in isolated workspaces.
npm run db:init- Initialize SQLite database with schema and default datanpm run db:migrate- Run database migrationsnode scripts/check-db.js- Check database connectivity and structure
npm run dev- Start both backend and frontend servers (may have issues)npm run dev:backend- Start backend server only (recommended for separate terminals)npm run dev:frontend- Start frontend server only (recommended for separate terminals)
npm run build- Build both backend and frontend for productionnpm run build:backend- Build backend TypeScript to JavaScriptnpm run build:frontend- Build frontend React/TypeScript for production
npm run test- Run all testsnpm run test:backend- Run backend testsnpm run test:frontend- Run frontend testsnpm run lint- Run linting on all codenpm run lint:backend- Run backend lintingnpm run lint:frontend- Run frontend linting
npm run clean- Kill all Node.js processesnpm run restart- Clean and restart development serversnode scripts/check-backend.js- Check backend healthnode scripts/check-output-files.js- Check output file system
- Backend: Node.js/Express with TypeScript, SQLite database
- Frontend: React/TypeScript with Vite, TailwindCSS
- Real-time: WebSocket for live updates
- File System: Isolated workspaces for Claude Code execution
- Entry Point:
index.ts- Server initialization and service orchestration - App Configuration:
app.ts- Express app setup, middleware, routing - Controllers: Handle HTTP requests and responses
- Services: Core business logic and external integrations
claude-code-executor.service.ts- Main Claude Code execution orchestrationtask-execution-monitor.service.ts- Monitors and manages task execution queuewebsocket.service.ts- WebSocket communication managementdatabase.service.ts- SQLite database operationsnotification.service.ts- Notification system
- Routes: RESTful API endpoints
- Types: TypeScript type definitions
- Entry Point:
main.tsx- React app initialization - App Component:
App.tsx- Root component with routing - Pages: Main application views (Dashboard, TaskDetail, Settings)
- Components: Reusable UI components including KanbanBoard, TaskCard
- Contexts: React context providers for state management
- Services: API communication layer
The SQLite database includes tables for:
tasks- Main task records with status workflowexecutions- Task execution attempts and resultsfeedback- User feedback on completed tasksnotifications- System notificationstask_attachments- File attachments for tasksoutput_files- Generated files from Claude Code execution
- Command: Set via
CLAUDE_CODE_COMMANDenvironment variable - Default:
claude-code(real Claude Code CLI) - Testing:
./scripts/mock-claude-code.sh(mock implementation) - Workspace:
./claude-code-workspace/- Isolated execution directories
- Task moved to "requested" status triggers execution
ClaudeCodeExecutorcreates isolated workspace directory- Prompt file generated with task details, feedback, and attachments
- Claude Code spawned with workspace as working directory
- Real-time progress streamed via WebSocket
- Output files catalogued and stored
- Task moved to "review" status for human approval
pending→requested→working→review→completed- Failed tasks can retry up to 3 times before returning to
pending
DATABASE_PATH=./database/tasks.db
OUTPUT_DIR=./outputs
CLAUDE_CODE_COMMAND=claude-code
CLAUDE_CODE_WORK_DIR=./claude-code-workspace
PORT=5000
MAX_CONCURRENT_TASKS=3
TASK_CHECK_INTERVAL=60000VITE_API_URL=http://localhost:5000/api
VITE_WS_URL=ws://localhost:5000- Create controller in
backend/src/controllers/ - Add route in
backend/src/routes/ - Update main routes in
backend/src/routes/index.ts - Add corresponding frontend API call in
frontend/src/services/api.ts
- Use
getDatabase()fromdatabase.service.ts - All database queries should use parameterized statements
- Update schema in
database/schema.sqland create migration scripts
- Backend: Use
wsService.broadcast*()methods - Frontend: Use
WebSocketContextto listen for real-time updates
- Uploads stored in
uploads/directory - Outputs stored in
outputs/andclaude-code-workspace/ - Use
attachment.service.tsfor file operations
- Root
tsconfig.jsonwith strict settings - Backend has relaxed settings in
backend/tsconfig.jsonfor development - Frontend uses Vite's TypeScript configuration
- Backend: Port 5000 (configurable via PORT env var)
- Frontend: Port 3000 (Vite default) or 5173
- WebSocket: Same port as backend
- Mock script (
scripts/mock-claude-code.sh) for testing without Claude Code - Real integration expects
claude-codecommand in PATH - Task execution adapts automatically based on
CLAUDE_CODE_COMMANDsetting
- Backend uses structured error handling via
error.middleware.ts - Frontend uses React Error Boundaries and toast notifications
- Failed task executions include retry logic with exponential backoff
- Unit tests for services and controllers
- Integration tests for database operations
- API endpoint testing with mock data
- Component unit tests
- Integration tests for user workflows
- End-to-end testing for critical paths
- Use mock Claude Code script for development
- Test with real Claude Code for production readiness
- Verify WebSocket connections and real-time updates