Thank you for your interest in contributing to ChittyCan! 🎉
Be respectful, constructive, and professional. We're all here to build great software.
Use the Bug Report issue template. Please include:
- ChittyCan version (
can --version) - Node.js version (
node --version) - Operating system
- Steps to reproduce
- Expected vs actual behavior
- Error logs
Use the Feature Request issue template. Explain:
- The problem you're solving
- Your proposed solution
- Why this is valuable
- Your use case
OpenAI API compatibility is critical. Use the Parity Failure template with:
- Affected endpoint
- Request/response from ChittyCan vs OpenAI
- Reproduction script
- Fork the repository
- Create a branch (
git checkout -b feature/amazing-feature) - Make your changes
- Test thoroughly
- Commit (
git commit -m 'Add amazing feature') - Push (
git push origin feature/amazing-feature) - Open a Pull Request
# Clone your fork
git clone https://github.com/YOUR_USERNAME/chittycan.git
cd chittycan
# Install dependencies
npm install
# Build
npm run build
# Run tests
npm test
# Run parity tests
npm run test:parity # (requires CHITTYCAN_TOKEN)
# Watch mode
npm run devchittycan/
├── src/
│ ├── commands/ # CLI commands
│ ├── lib/ # Core libraries
│ ├── plugins/ # AI platform connectors
│ └── index.ts # Entry point
├── tests/
│ ├── parity_*.js # OpenAI compatibility tests
│ └── *.test.ts # Unit/integration tests
├── benchmarks/ # Performance benchmarks
└── docs/ # Documentation
- Use strict TypeScript
- Prefer interfaces over types
- Document public APIs
- Async/await over Promises
// Good
export async function fetchData(url: string): Promise<Data> {
const response = await fetch(url);
return response.json();
}
// Bad
export function fetchData(url: string) {
return fetch(url).then(r => r.json());
}- Write tests for new features
- Maintain >80% coverage
- Test edge cases
- Use descriptive test names
// Good
test("should retry failed requests with exponential backoff", async () => {
// ...
});
// Bad
test("retry test", () => {
// ...
});Follow Conventional Commits:
feat: add smart routing for embeddings
fix: correct token counting for streaming responses
docs: update migration playbook
test: add parity tests for streaming
refactor: extract cache logic to separate moduleCritical: ChittyCan must be a drop-in replacement.
# Run parity tests
export CHITTYCAN_TOKEN=your_token
export OPENAI_API_BASE=https://connect.chitty.cc/v1
npm run test:parity- Implement the endpoint
- Add parity tests (Python + Node)
- Update compatibility docs
- Test against OpenAI directly
- Request format matches OpenAI
- Response format matches OpenAI
- Status codes match
- Error messages match
- Streaming works identically
- Token counting is accurate
- Headers are compatible
To add a new AI platform:
- Create plugin:
src/plugins/ai/newplatform.ts - Implement interface:
export const newPlatformPlugin: AIPlugin = {
name: "New Platform",
type: "ai-platform" as const,
platformId: "newplatform",
commands: [
{
name: "ai newplatform test",
description: "Test connection",
handler: async () => {
// Test logic
}
}
],
async initialize() {
// Setup
}
};- Add to index:
src/plugins/ai/index.ts - Add tests
- Update docs
For ChittyOS services:
- Create plugin in
src/plugins/chittyos/ - Follow ChittyOS API patterns
- Add service discovery
- Update config types
Add benchmarks for performance-critical changes:
# Run benchmark
python3 benchmarks/cache-benchmark.py
# Add to CI
# Update benchmarks/README.mdUpdate docs for user-facing changes:
- README.md - Overview and quick start
- MIGRATION_PLAYBOOK.md - Migration guides
- docs/ - Detailed documentation
- Inline code comments - API documentation
First-time contributors must sign the CLA:
- Submit your PR
- CLA bot will comment
- Sign via GitHub
- Bot will confirm
Why? Allows dual-licensing (AGPL + Commercial)
Your rights: You retain copyright and can use your code however you want
- Automated checks must pass (tests, lint, build)
- Maintainer review (usually within 48 hours)
- Changes requested (address feedback)
- Approval ✅
- Merge to main
Maintainers handle releases:
- Version bump in
package.json - Update
CHANGELOG.md - Tag release
- Publish to npm
- Create GitHub release
- Discord: https://discord.gg/chittyos
- GitHub Discussions: Ask questions
- Email: dev@chitty.cc
Contributors are listed in:
- README.md
- Release notes
- https://chitty.cc/contributors
By contributing, you agree that your contributions will be licensed under:
- v0.4.0: MIT
- v0.5.0+: AGPL v3 (with commercial licensing option)
Thank you for contributing! 🚀