Thank you for your interest in contributing to Karna! This guide will help you get started.
# Clone the repo
git clone https://github.com/MukundaKatta/karna.git
cd karna
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Start development
pnpm gateway:dev # Terminal 1: Gateway
pnpm --filter @karna/web dev # Terminal 2: Web dashboard
pnpm cli chat # Terminal 3: CLI chatkarna/
├── agent/ # Core AI agent runtime (models, tools, memory, RAG)
├── gateway/ # WebSocket gateway server (Fastify)
├── apps/
│ ├── web/ # Next.js dashboard
│ ├── cli/ # Commander.js CLI
│ ├── cloud/ # Cloud API service
│ └── mobile/ # React Native (Expo) app
├── channels/ # 13 messaging channel adapters
├── skills/ # Built-in and community skills
├── packages/
│ ├── shared/ # Shared types and utilities
│ ├── plugin-sdk/ # Plugin development SDK
│ └── supabase/ # Database migrations
├── tests/ # Vitest test suites
└── docker/ # Docker deployment configs
| Command | Description |
|---|---|
pnpm build |
Build all packages |
pnpm test |
Run all tests |
pnpm gateway:dev |
Start gateway in dev mode |
pnpm --filter @karna/web dev |
Start web dashboard |
pnpm cli chat |
Start CLI chat |
- Create
agent/src/tools/builtin/your-tool.ts - Export a tool object with:
name,description,parameters(Zod),inputSchema,riskLevel,requiresApproval,execute - Register in
agent/src/tools/builtin/index.ts - Add tests in
tests/agent/
- Create
channels/your-channel/src/adapter.ts - Follow the Discord adapter pattern (connect to gateway WS, forward messages)
- Add
channels/your-channel/package.json
- Create
skills/builtin/your-skill/SKILL.md(YAML frontmatter + instructions) - Create
skills/builtin/your-skill/handler.ts(implementsSkillHandler) - Skills are auto-discovered by the skill loader
- TypeScript strict mode
- pino for logging
- Zod for validation
- No
anytypes (useunknowninstead) - Functional over OOP where possible
- Keep files under 500 lines
- Fork the repo and create a feature branch
- Write tests for new features
- Ensure
pnpm buildandpnpm testpass - Submit a PR with a clear description
MIT — see LICENSE