Thank you for your interest in contributing! This guide will help you get started.
- Fork the repository
- Create a branch for your feature or fix (
git checkout -b feature/my-change) - Make your changes and write tests if applicable
- Run type checks to ensure nothing is broken
- Commit with a clear message describing the change
- Open a Pull Request against
main
- Node.js 22+
- npm 10+
Each gateway is an independent Node.js project. To work on a specific gateway:
cd discord-gateway # or slack-gateway, email-gateway, whatsapp-gateway
cp .env.example .env # configure your local environment
npm install
npm run dev # start with file watchingcd <gateway-dir>
npm run typecheck # runs tsc --noEmitcd <gateway-dir>
npm test # if tests exist for that gateway- Language: TypeScript (strict mode)
- Module system: ESM (
"type": "module"in package.json) - Runtime: tsx (TypeScript execution without build step)
- Formatting: Use consistent indentation (2 spaces)
- Naming: camelCase for variables/functions, PascalCase for types/interfaces
- Imports: Use
.jsextensions in import paths (required for ESM) - Error handling: Always handle errors gracefully; log with
[CONTEXT]prefixes
- Keep PRs focused on a single change
- Include a clear description of what the PR does and why
- Reference any related issues
- Make sure type checks pass before requesting review
- Update
.env.exampleif you add new environment variables - Update the gateway's README if you change behavior
To add a new gateway to the monorepo:
- Create the directory at the repo root (e.g.,
telegram-gateway/) - Initialize the project:
mkdir telegram-gateway && cd telegram-gateway npm init -y
- Follow the existing structure:
telegram-gateway/ ├── .env.example # All env vars with placeholder values ├── .gitignore # node_modules, dist, .env ├── Dockerfile # Multi-stage build (see other gateways) ├── ecosystem.config.cjs # pm2 configuration ├── package.json # Scripts: start, dev, typecheck ├── tsconfig.json └── src/ ├── config.ts # Load env vars with dotenv ├── content-security.ts # Trust model + injection scanning ├── inbound.ts # Platform -> AI Maestro ├── outbound.ts # AI Maestro -> Platform ├── server.ts # Express health/management + main() └── types.ts # TypeScript interfaces - Implement the content security module with the standard trust model (operator/external) and injection pattern scanner
- Add a health endpoint at
GET /health - Add the gateway to the CI matrix in
.github/workflows/ci.yml - Add a service to
docker-compose.yml - Create a Dockerfile following the multi-stage pattern
- Update the root README with the new gateway info