Contributing¶
Thank you for your interest in contributing to Clown! This guide will help you get started.
Ways to Contribute¶
Report Bugs¶
Before creating a bug report, check existing issues to avoid duplicates.
Include in your report:
- Clear, descriptive title
- Steps to reproduce
- Expected vs actual behavior
- Environment details (OS, Rust version, Clown version)
- Relevant logs or error messages
Suggest Features¶
Feature suggestions are welcome! Open an issue with:
- Clear description of the feature
- Problem it solves or use case
- Implementation ideas (optional)
Submit Pull Requests¶
- Fork and clone the repository
- Create a branch from
main - Make your changes
- Test thoroughly
- Submit a pull request
Development Setup¶
Prerequisites¶
- Rust 1.75 or later
- Cargo
- Git
Clone and Build¶
Run Tests¶
Check Code Quality¶
Project Structure¶
ringlet/
├── crates/
│ ├── ringlet/ # CLI binary
│ ├── ringletd/ # Background daemon
│ ├── ringlet-core/ # Core types and utilities
│ └── ringlet-scripting/ # Rhai scripting engine
├── docs/ # Developer documentation
├── documentation/ # User-facing MkDocs site
├── manifests/ # Built-in agent/provider manifests
└── scripts/ # Built-in Rhai scripts
Key Crates¶
| Crate | Description |
|---|---|
ringlet | CLI binary - thin client for daemon |
ringletd | Background daemon - core orchestration |
ringlet-core | Shared types, serialization, filesystem |
ringlet-scripting | Rhai script engine and built-ins |
Code Guidelines¶
Style¶
- Follow Rust conventions and idioms
- Run
cargo fmtbefore committing - Ensure
cargo clippypasses without warnings - Write documentation for public APIs
Commit Messages¶
Use clear, descriptive commit messages:
feat: add MiniMax provider support
- Add provider manifest for MiniMax
- Create Rhai script for configuration
- Update documentation
Closes #123
Documentation¶
- Update docs for user-facing changes
- Add doc comments to public APIs
- Keep README current
Adding Agents¶
To add support for a new AI coding agent:
1. Create Agent Manifest¶
Add to manifests/agents/<id>.toml:
id = "my-agent"
name = "My Agent"
binary = "my-agent"
version_flag = "--version"
[detect]
commands = ["my-agent --version"]
[profile]
strategy = "home-wrapper"
source_home = "~/.my-agent-profiles/{alias}"
script = "my-agent.rhai"
[models]
default = "default-model"
supported = ["default-model", "other-model"]
2. Create Rhai Script¶
Add to scripts/<id>.rhai:
// Configuration generation for my-agent
let config = #{
"api_key": provider.api_key,
"model": provider.model,
"base_url": provider.endpoint
};
#{
"files": #{
".my-agent/config.json": json::encode(config)
},
"env": #{
"MY_AGENT_API_KEY": provider.api_key
}
}
3. Test Detection¶
Adding Providers¶
To add a new API provider:
Create Provider Manifest¶
Add to manifests/providers/<id>.toml:
id = "my-provider"
name = "My Provider"
type = "anthropic-compatible" # or "openai-compatible"
[endpoints]
default = "https://api.example.com/v1"
[auth]
env_key = "MY_PROVIDER_API_KEY"
prompt = "Enter your API key"
[models]
available = ["model-a", "model-b"]
default = "model-a"
Testing¶
Unit Tests¶
Add tests in the same file:
Integration Tests¶
Add to tests/ directory:
Manual Testing¶
# Build and test
cargo build
./target/debug/ringlet agents list
./target/debug/ringlet providers list
Documentation¶
User Documentation¶
User-facing docs use MkDocs in documentation/:
Developer Documentation¶
Developer docs are in docs/ as Markdown.
API Documentation¶
Generate Rust docs:
Pull Request Process¶
Before Submitting¶
- [ ] Code compiles without errors
- [ ] All tests pass
- [ ]
cargo clippyhas no warnings - [ ]
cargo fmt --checkpasses - [ ] Documentation updated if needed
- [ ] Commit messages are clear
PR Description¶
Include:
- What the change does
- Why it's needed
- How to test it
- Related issues (e.g., "Closes #123")
Review Process¶
- Automated CI checks run
- Maintainer reviews code
- Address feedback if needed
- PR is merged when approved
Getting Help¶
- Documentation: Read the docs first
- Issues: Open a GitHub issue
- Discussions: Use GitHub Discussions for questions
License¶
By contributing, you agree that your contributions will be licensed under the MIT License.