Welcome! This guide covers how to contribute to ToM Protocol, with special consideration for LLM-assisted development.
ToM Protocol is designed for micro-session contributions - small, focused changes that can be completed in a single session. This works well for:
- LLM coding assistants (Claude, etc.)
- Short coding sessions
- Learning the codebase
| Level | Time | Scope | Example |
|---|---|---|---|
| micro | < 30 min | Single file | Fix typo, add JSDoc |
| small | 30-60 min | 2-3 files | Add a test, fix a bug |
| medium | 1-2 hours | Multiple components | New feature, refactor |
| Category | Description |
|---|---|
| verification | Code review, testing existing features |
| building | New features, bug fixes |
| analysis | Investigation, documentation |
| testing | Add tests, improve coverage |
- Browse open issues
- Filter by
good first issueor complexity level (micro,small) - Check for
help wantedlabel - Claim an issue by commenting before starting
| Good ✅ | Avoid ❌ |
|---|---|
| Fix a single bug | Rewrite entire subsystem |
| Add one test | Add tests for everything |
| Implement one feature | Multi-epic feature work |
| Update documentation | Complete documentation overhaul |
| Refactor one module | Cross-cutting refactors |
- Claim - Comment on the issue to claim it
- Understand - Read relevant files (CLAUDE.md, llms.txt)
- Plan - Identify specific, scoped changes
- Implement - Make focused changes
- Test - Run
pnpm testto verify - Commit - One commit per logical change
- PR - Reference the issue in your PR
# Clone and setup
git clone https://github.com/malikkaraoui/ToM-protocol.git
cd tom-protocol
pnpm install
# Build and test
pnpm build
pnpm test
# Run demo
./scripts/start-demo.shtom-protocol/
├── packages/
│ ├── core/ # Core protocol implementation
│ └── sdk/ # High-level SDK (TomClient)
├── tools/
│ ├── signaling-server/ # Bootstrap server
│ ├── mcp-server/ # MCP server for LLMs
│ └── vscode-extension/ # VS Code extension
├── apps/
│ └── demo/ # Browser demo app
├── llms.txt # LLM quick reference
├── CLAUDE.md # Detailed LLM guide
└── _bmad-output/
└── planning-artifacts/
└── architecture.md # Architecture decisions (ADRs)
llms.txt- Quick protocol overviewCLAUDE.md- Detailed implementation guide_bmad-output/planning-artifacts/architecture.md- Design decisions (ADRs)- Relevant source files
// packages/core/src/feature/feature.test.ts
import { describe, it, expect } from 'vitest';
import { MyFeature } from './feature.js';
describe('MyFeature', () => {
it('should do something', () => {
const feature = new MyFeature();
expect(feature.method()).toBe(expected);
});
});- Read the relevant module
- Write a failing test
- Fix the bug
- Verify test passes
- Update
CLAUDE.mdfor API changes - Update
llms.txtfor protocol changes - Add JSDoc to new exports
- TypeScript with strict mode
- Biome for linting and formatting
- Run
pnpm lint:fixbefore committing - No
anytypes (useunknownor proper types) - Import with
.jsextension (ESM)
type(scope): description
- Bullet points for details
- Keep under 72 chars per line
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Types: feat, fix, docs, test, refactor, chore
# Run all tests
pnpm test
# Run specific package tests
pnpm --filter tom-protocol test
# Watch mode
pnpm --filter tom-protocol test:watch- Node: Any participant in the network
- Relay: Node that forwards messages for others
- Direct: P2P connection via WebRTC
- Bootstrap: Initial connection via signaling server
| File | Purpose |
|---|---|
router.ts |
Message routing logic |
relay-selector.ts |
Relay selection algorithm |
network-topology.ts |
Network state tracking |
peer-gossip.ts |
Distributed peer discovery |
ephemeral-subnet.ts |
Subnet formation |
tom-client.ts |
SDK entry point |
Send Message:
TomClient.sendMessage()
→ Router.route()
→ RelaySelector.selectRelay() (if needed)
→ TransportLayer.send()
→ WebRTC DataChannel
Receive Message:
WebRTC DataChannel
→ TransportLayer.onMessage()
→ Router.handleIncoming()
→ TomClient.onMessage() callback
- One logical change per PR
- Include tests for new code
- Update documentation if API changes
- Run full test suite before submitting
- Keep PRs small (< 200 lines preferred)
- Read
CLAUDE.mdfor implementation details - Check
_bmad-output/planning-artifacts/architecture.mdfor design rationale - Open an issue for questions
- Use the MCP server to explore programmatically
MIT License - See LICENSE file.