Contribution Guide
PilotDeck Agent Series
Welcome to participate in the development of PilotDeck! This article introduces how to set up a development environment, submit code and follow project specifications.
Development Environment Setup
System Requirements
| Depend on | Version |
|---|---|
| macOS | Sonoma (14) or higher |
| Node.js | v18+ (v22 recommended) |
| npm | v9+ |
| Git | Latest version |
| TypeScript | v5.9+ (installed within the project) |
Cloning and Initialization
Bash
# Clone repository
git clone https://github.com/OpenBMB/PilotDeck.git
cd PilotDeck
# Install dependencies (root directory + ui workspace)
npm install
# Compile Gateway
npm run build
# Install and compile Web UI
cdui
npm install
npm run build
cd..
Start Development Mode
PilotDeck provides one-click development startup script:
Bash
# One-click startup (recommended)
npm rundev
npm run dev Will execute scripts/dev-launcher.mjs, automatically completed:
- run
predevHook - initialization configuration file - Start Gateway Server (hot reload)
- Start the Web UI development server (Vite HMR)
You can also start each component separately:
Bash
#Start separately (in different terminal windows)
# Terminal 1: Gateway Server (using tsx hot reload)
npm run server
# Terminal 2: UI Bridge Server
npm --prefix ui run server
# Terminal 3: Web UI development server
npm --prefix ui run client
# Or use concurrently to start at the same time
npm --prefix ui run dev:concurrent
Coding Standards
TypeScript
- Use strict mode TypeScript(
strict: true) - priority use
typerather thaninterface(The project has established practices) - Used when exporting
export type {}Export to pure types - Use
.jsImport path for extensions (ESM specification)
Typescript
// ✅ Recommended
import { createGateway, type Gateway } from "../gateway/index.js";
// ❌ avoid
import { createGateway, Gateway } from "../gateway/index";
Module Boundaries
each src/<module>/ Directory passed index.ts Define the public API.
Note · Warning
- Don't Directly import internal files of other modules, only through
index.tsExported interface - Don't Create circular dependencies between modules
- The dependence direction is from the upper layer to the lower layer, and the lower layer modules do not depend on the upper layer.
Naming Convention
| Category | Agreement | Example |
|---|---|---|
| file name | PascalCase (class/component) or camelCase (utility function) | RouterRuntime.ts, decideScenario.ts |
| class/type | PascalCase | SessionRouter, RouterDecision |
| function | camelCase | createGateway, loadPilotConfig |
| constant | UPPER_SNAKE_CASE | DEFAULT_PILOT_HOME |
| Directory | kebab-case | always-on, pilot-config |
Git Workflow
Branching Strategy
| branch | Purpose |
|---|---|
main | Stable main line |
feature/<name> | New feature development |
fix/<name> | Bug fix |
refactor/<name> | Refactor |
Commit Information
Follow the semantic format:
Plain Text
<type>(<scope>): <description>
feat(router): add custom router plugin support
fix(gateway): handle WebSocket reconnection timeout
refactor(context): extract CompactionEngine from ContextRuntime
docs(config): update YAML schema documentation
test(router): add TokenSaver decision unit tests
Compile and Build
Bash
# Compile the Gateway backend
npm run build
# Output to dist/
# Compile Web UI
npm --prefix ui run build
#Output to ui/dist/
#Type checking (not compiled)
npm --prefix ui run typecheck
Checklist for Submitting a PR
-
Local compilation passed
Bashnpm run build -
Test passed
Bashnpm test -
UI type checking passes (if involved)
Bashnpm --prefix ui run typecheck -
Update related documentation
If the configuration schema, CLI command or public API is modified, update it synchronously
docs/documents in .
Developer Showcase
View all →PilotDeck Art Director: Supervising AI Image GenerationAn Agent that watches the image model work, re-rating and retrying until it passesLater: a Long-term Life Memory AgentA PilotDeck App butler that remembers your life across sessionsBuilding an Online Smart Data System with PilotDeckLessons from building a smart data management system on PilotDeckPilotDeck Data Analysis: Attendance, Expenses, AssetsThree office scenarios: from raw records to reports and audit findings in one shotPilotDeck Word: Generating and Editing DOCXBatch-generate documents and apply review comments one by one, with tracked editsMaking Slides with PilotDeckFrom a one-line brief to outline, template and slide-by-slide copy