Skip to main content

Getting Started

  1. Fork the repository on GitHub
  2. Clone your fork locally
  3. Follow the Developer Setup guide
  4. Create a feature branch

Development Workflow

1. Make Your Changes

  • Write your code following our code style
  • Add tests for new functionality
  • Update documentation if needed

2. Run Quality Checks

Before committing, ensure all checks pass:

3. Commit Your Changes

We follow Conventional Commits:

Commit Types

4. Push and Create PR

Then open a Pull Request on GitHub.

Code Style

TypeScript

  • Use TypeScript strict mode
  • Prefer interface over type for object shapes
  • Use const by default, let when reassignment is needed
  • No any types - use unknown and type guards

Naming Conventions

File Organization

Pull Request Guidelines

PR Title

Use the same format as commits:

PR Description

Use the PR template provided. Include:
  1. Summary - What does this PR do?
  2. Changes - Bullet points of specific changes
  3. Testing - How was this tested?
  4. Screenshots - If UI changes

Review Process

  1. At least one approval required
  2. All CI checks must pass
  3. No merge conflicts
  4. Squash merge to main

Architecture Guidelines

Non-Negotiable Rules

These rules are enforced in code review. PRs violating them will be rejected.
  1. Bot apps MUST use SDK - Never call raw REST from adapters
  2. LLM calls only in API - Platform adapters never call LLMs directly
  3. DB access only in API - No direct database access from bots or web
  4. No secrets in DB - Platform tokens in Cloudflare KV only
  5. Human confirmation required - LLM creates drafts, user confirms

Adding a New Feature

1

Design

Write a brief design doc if the feature affects multiple packages.
2

Schema Changes

If adding new data, update packages/db/src/schema/. Run pnpm db:generate to create migrations.
3

Shared Types

Add Zod schemas to packages/shared/src/schemas.ts. Export enums from packages/shared/src/enums.ts.
4

API Endpoints

Add controller and service in apps/api/src/modules/. Include Swagger documentation.
5

SDK Methods

Add typed methods to packages/sdk/src/client.ts.
6

Tests

Write unit tests for business logic. Write integration tests for API endpoints.

Adding a New Package

  1. Create the package directory in /packages
  2. Add package.json with proper naming (@hitler/package-name)
  3. Add to pnpm-workspace.yaml if not auto-detected
  4. Export from src/index.ts
  5. Add tsconfig.json extending ../../tsconfig.base.json

Testing Requirements

New Features

  • Unit tests for all business logic
  • Integration tests for API endpoints
  • Update existing tests if behavior changes

Bug Fixes

  • Add a test that reproduces the bug
  • The test should fail before the fix and pass after

Minimum Coverage

  • New code should have 80%+ coverage
  • Don’t decrease overall coverage

Documentation

Code Documentation

  • Add JSDoc comments to public functions
  • Include @param and @returns tags
  • Add @example for complex functions

API Documentation

  • Add Swagger decorators to all endpoints
  • Include request/response examples
  • Document error responses

User Documentation

  • Update /docs if the feature is user-facing
  • Add to guides if it changes workflow
  • Update API reference for new endpoints

Getting Help

GitHub Issues

Open an issue for bugs or feature requests

Discussions

Use GitHub Discussions for questions

Code of Conduct

  • Be respectful and inclusive
  • Focus on constructive feedback
  • Help others learn and grow
  • Assume good intentions