Contributing to Tempest
This guide covers the Tempest project structure, development workflow, and how to extend the application with new features like agents, themes, and Tauri commands.Project Structure
Tempest is organized into frontend (React/TypeScript) and backend (Rust/Tauri) components:Running the Dev Build
Prerequisites: Node.js 18+, Rust 1.77+, WebView2 Runtime (Windows only)- Runs
npm run build:atlasto build the Token Intelligence server - Launches Tauri in dev mode, which starts:
- Vite dev server on http://localhost:5173
- Tauri webview pointing to the dev server
- File watcher that hot-reloads on changes
Production Build
dist-installers/ with platform-specific installers (Windows .msi, macOS .app.tar.gz, Linux .AppImage).
Adding a New Agent to NewSessionMenu
Agents are defined insrc/components/NewSessionMenu.tsx in the AGENT_CONFIGS array.
Step 1: Prepare the agent icon
Add a new SVG icon tosrc/assets/agent-icons/:
Step 2: Add the agent config
InNewSessionMenu.tsx, add a new entry to AGENT_CONFIGS:
Step 3: Import the icon
At the top ofNewSessionMenu.tsx, add an import:
Step 4: Test
Restart the dev server. The new agent should appear in the “Agent Session” submenu.Adding a New Theme
Themes are JSON files stored insrc/themes/{theme-name}/theme.json.
Step 1: Create the theme file
Insrc/themes/my-theme/theme.json:
src/themes/origin-dark/theme.json for the complete reference.
Step 2: Register the theme
Insrc/themes/ThemeContext.tsx, import and add the new theme:
Step 3: Test
Restart the dev server and open Settings > Appearance. Your theme should appear in the theme grid.Adding a New Tauri Command
Tauri commands bridge the React frontend and Rust backend. They are called from TypeScript viainvoke() and handled by #[tauri::command] functions in Rust.
Example: Read a File
Step 1: Add the Rust function insrc-tauri/src/lib.rs:
lib.rs:
src/components/MyComponent.tsx:
Tauri Command Patterns
Returning data:serde::Serialize on structs.
Taking parameters:
Code Patterns and Style
React Components
Components use functional components with hooks:CSS Variables for Theming
Always use CSS variables for colors and UI tokens. Never hardcode color values.--tempest-{token.with.dots} becomes --tempest-{token-with-dashes}.
Error Handling
Use Result types and bubble errors:State Management
Use Zustand stores for global state. Example fromsrc/store/appSettings.ts:
TypeScript Types
Always define prop types and return types explicitly:Testing
Currently, the codebase does not have automated tests. Manual testing via the dev build is the standard approach. To test a feature:- Run
npm run dev - Interact with the feature in the app
- Check the browser console (F12) for errors
- Verify the expected behavior
- Use React DevTools browser extension to inspect component state
- Use the Tauri DevTools (right-click > Inspect) to see window/console output
- Add
console.log()statements liberally
Building for Release
dist-installers/:
- Windows:
.msifile - macOS:
.app.tar.gz(requires signing, see Tauri docs) - Linux:
.AppImage
Performance Considerations
Large File Trees
The file tree in the right sidebar is lazy-loaded. Nested folders do not fetch contents until expanded. This keeps the sidebar responsive even in large monorepos.Git Status
Git status operations are debounced and only refresh the Changes tab, not the file tree. This prevents layout shifts while browsing.Terminal Rendering
The embedded xterm.js terminal uses WebGL acceleration when available (via@xterm/addon-webgl). The WebGL context is pooled to avoid creating too many contexts simultaneously.
Code Editor
Syntax highlighting uses CodeMirror with language-specific tokenizers. Avoid rendering very large files (10k+ lines) in the editor at once.Debugging Tips
- Frontend logs - Open DevTools (F12) and check the Console tab
- Tauri logs - Right-click the Tempest window and select “Inspect” to see the native console
- React state - Install React DevTools browser extension and inspect component props/state
- Network requests - Check the Network tab for API calls (e.g., GitHub PR creation)
- Git operations - Git commands are invoked via Tauri; check stderr for git error messages
Next Steps
- Explore
src/components/to understand UI patterns - Read through
src-tauri/src/lib.rsto see available Tauri commands - Check
ROADMAP.mdfor upcoming features and architecture decisions - Join the community on X/Twitter (@usetempest) for questions and discussions