Development - twamp22/BumbaClaude GitHub Wiki
Development
Getting Started
Clone the repository and set up your development environment.
git clone https://github.com/twamp22/BumbaClaude.git
cd BumbaClaude
pnpm install
Prerequisites
- Node.js v24.0.0 or later
- pnpm v9.0.0 or later
- Git
- tmux (for testing agent spawning)
- Claude Code CLI installed and in PATH
Verify setup
node --version # Should be v24.0.0+
pnpm --version # Should be v9.0.0+
tmux -V # Should show tmux version
claude --version # Should show Claude Code version
Development Commands
Browser-only development
pnpm dev
Starts the Next.js dev server at http://localhost:3000. No Electron needed. Hot reload enabled.
Desktop app development
pnpm electron:dev
Runs the Next.js dev server with hot reload + Electron in development mode. Loads the browser into a native window with dev tools enabled.
Building for production
pnpm build
Builds the Next.js app. No Electron involved. Run this before pnpm electron:build.
Building the Electron installer
pnpm electron:build
- Builds Next.js with
pnpm build - Compiles Electron TypeScript files
- Packages with electron-builder
- Creates
BumbaClaude Setup 0.1.0.exeand portable.zip
Output goes to the dist/ folder.
Linting and type checking
pnpm lint
Runs ESLint to check for code style issues.
pnpm build
Also type-checks the entire codebase via TypeScript.
Code Conventions
All contributions must follow these conventions (enforced via linting):
TypeScript
- Strict mode enabled (
tsconfig.json) - No
anytypes (useunknownif needed, then narrow) - No unused variables
- Descriptive variable names (no single letters except loop counters
i,j)
React Components
- Server components by default (
/src/app/pages) - Client components only when interactivity requires it (
'use client'at top) - Use hooks for state management (
useEffect,useState, etc.) - Component names in PascalCase (
TeamCard.tsx, notteamCard.tsx)
API Routes
- All backend operations go in
/src/app/api/ - Use HTTP methods correctly (GET for reads, POST for creation, PATCH for updates, DELETE for removal)
- Return JSON with consistent error structure:
{ error: "message", code: "ERROR_CODE" } - Always set appropriate HTTP status codes (200, 201, 400, 404, 500, etc.)
Database
- All database queries go through
/src/lib/db.ts - Use parameterized queries to prevent SQL injection:
db.query("SELECT * FROM teams WHERE id = ?", [id]) - No ORM. Raw SQL only.
- Transactions for multi-step operations:
db.transaction(() => { ... })
tmux Operations
- All tmux commands go through
/src/lib/tmux.ts - Never shell out to tmux directly from component code
- Wrap in try/catch with meaningful error messages
File System Access
- All filesystem watching goes through
/src/lib/watcher.ts - Never write to ~/.claude/ (read-only access)
- Use absolute paths, not relative paths
Error Handling
- Always catch errors:
try { ... } catch (error) { console.error(...) } - Never swallow errors silently
- Log server-side errors to console:
console.error("Failed to spawn agent", error) - Return meaningful error messages to the frontend
- No stack traces in user-facing error messages
UI Text
- No em dashes (--) in any user-facing text. Use hyphens (-) or write it out.
- Clear, concise language
- Avoid jargon where possible
- Capitalize properly (Title Case for headings, sentence case for body text)
Project Architecture
See Architecture for a detailed overview.
Key principle: The Wrapper Boundary
BumbaClaude NEVER modifies Claude Code internals.
All interaction happens through:
- tmux commands -- Spawn and control agent sessions
- Filesystem reads -- Read state from ~/.claude/
- Agent SDK (v0.2+) -- Programmatic control via official API
This boundary is non-negotiable. If a feature requires modifying Claude Code:
- Propose the feature upstream to Anthropic
- Wait for them to implement it in Claude Code
- Then integrate it into BumbaClaude
File structure
/src/app/ -- Next.js pages and API routes
/src/components/ -- React components organized by feature
/src/lib/ -- Core library (db, tmux, watcher, websocket, types)
/src/hooks/ -- Custom React hooks
/db/ -- SQLite schema and migrations
/electron/ -- Electron main process code
/data/ -- SQLite database (gitignored)
Contributing Workflow
-
Fork the repo on GitHub
-
Create a feature branch
git checkout -b feature/your-feature-name # or git checkout -b fix/your-bug-fix-name -
Make your changes
- Follow code conventions above
- Keep commits focused (one feature per commit)
- Write clear commit messages
-
Test your changes
pnpm lint # Check linting pnpm build # Type-check and build pnpm electron:dev # Test in Electron -
Push to your fork
git push origin feature/your-feature-name -
Open a pull request against the main repo's
mainbranch- Link any related issues
- Describe what your PR does
- Mention if there are breaking changes
Testing
Manual testing
Since BumbaClaude controls tmux sessions, automated testing is limited. Most testing is manual:
- Team creation -- Create a team with different agent configurations
- Agent spawning -- Verify agents spawn and connect correctly
- Task management -- Create, assign, and complete tasks
- Audit log -- Check events are recorded with correct timestamps
- Governance -- Test that rules are enforced
Verifying tmux availability
Before running any tests:
tmux -V # Verify tmux installed
tmux new-session -d -s test-session # Create a test session
tmux kill-session -t test-session # Kill the test session
If these commands fail, you're missing tmux. Install it via WSL2, MSYS2, or your preferred package manager.
Building the Installer
The Electron installer is built using electron-builder with NSIS (Windows installer format).
pnpm electron:build
This:
- Builds Next.js with
pnpm build - Compiles Electron TypeScript
- Creates:
dist/BumbaClaude Setup 0.1.0.exe-- Windows installerdist/BumbaClaude-0.1.0-win.zip-- Portable zip
The installer uses NSIS to:
- Install to Program Files
- Create Start Menu shortcuts
- Add an uninstaller
- Support optional auto-start on Windows startup
Versioning Policy
BumbaClaude uses semantic versioning: MAJOR.MINOR.PATCH
- v0.x.x -- Pre-1.0 development phase (breaking changes OK)
- v1.0.0 -- Stable API and feature set
- v1.1.0 -- New features, backward compatible
- v1.1.1 -- Bug fixes only
Bump version in:
package.json(version field)- Create a git tag:
git tag v0.1.0 - Push the tag:
git push origin v0.1.0 - Create a GitHub Release from the tag
Debugging
Enable verbose logging
# Set Node.js debug env var
NODE_DEBUG=http,sqlite DEBUG=bumbaClaude:* pnpm dev
Inspect database
# Query the database directly
sqlite3 ./data/dashboard.db
sqlite> SELECT * FROM teams;
sqlite> .quit
View Electron dev tools
In pnpm electron:dev, press Ctrl+Shift+I to open dev tools (browser DevTools).
For the main process, use VS Code's remote debugging or inspect via DevTools.
Monitor file watcher
Add logging to /src/lib/watcher.ts:
watcher.on('change', (path) => {
console.error('[watcher] File changed:', path);
// ... rest of handler
});
Common Issues During Development
"Port 3000 already in use"
# Find and kill the process
netstat -ano | findstr :3000
taskkill /PID {PID} /F
# Or let Node pick a random port
PORT=3001 pnpm dev
"Database is locked"
- Another instance of the app is using it
- Quit all instances of BumbaClaude
- Delete
./data/dashboard.dbto reset - Restart the dev server
"tmux: command not found"
- tmux is not installed or not in PATH
- On Windows, install via WSL2 or MSYS2
- On WSL2:
apt install tmux - Add tmux to your PATH if installed elsewhere
"Electron won't start"
- Check Node version:
node --version(should be v24+) - Try
pnpm electron:devinstead of running the packaged app - Check AppData folder has write permissions
- Kill any running Electron processes:
taskkill /IM BumbaClaude.exe /F
Deployment
Release checklist
Before creating a release:
- All tests pass:
pnpm build - Linting passes:
pnpm lint - Version bumped in
package.json - Changelog updated in
/docs/changelog/ - PR merged to
main - Tag created:
git tag v0.1.0
Then:
git push origin main
git push origin v0.1.0
pnpm electron:build
Upload the .exe and .zip files to GitHub Releases.
Auto-update flow
Once uploaded to GitHub Releases, users with auto-update enabled will:
- Get notified of the new version
- See an "Install update" button in the app
- Click to download and install
- App restarts with the new version