Contributing to ZeroClaw
Thanks for your interest in contributing to ZeroClaw! This guide will help you get started, whether you’re fixing a typo or building a new provider.First-Time Contributors
Welcome — contributions of all sizes are valued. If this is your first contribution:Find an issue
Look for issues labeled
good first issue. These are scoped for newcomers and include context to get moving quickly.Pick a scope
Good first contributions include:
- Typo and documentation fixes
- Test additions or improvements
- Small bug fixes with clear reproduction steps
Development Setup
Quick Start
Pre-push Hook
The repo includes a pre-push hook in.githooks/ that enforces quality checks. Enable it with:
Collaboration Tracks (Risk-Based)
Every PR should map to one track to keep review throughput high:| Track | Scope | Review Depth |
|---|---|---|
| Track A (Low risk) | docs/tests/chore, isolated refactors | 1 maintainer review + green CI |
| Track B (Medium risk) | providers/channels/memory/tools behavior changes | 1 subsystem-aware review + validation evidence |
| Track C (High risk) | src/security/**, src/runtime/**, src/gateway/**, .github/workflows/** | 2-pass review, rollback plan required |
When in doubt, choose the higher track.
Architecture: Trait-Based Pluggability
ZeroClaw’s architecture is built on traits — every subsystem is swappable. Contributing a new integration is as simple as implementing a trait and registering it.How to Add Integrations
Adding a Provider
Createsrc/providers/your_provider.rs:
src/providers/mod.rs:
Adding a Channel
Createsrc/channels/your_channel.rs:
Adding a Tool
Createsrc/tools/your_tool.rs:
Code Naming Conventions
Use these defaults unless an existing subsystem pattern clearly overrides them:- Rust casing: modules/files
snake_case, types/traits/enumsPascalCase, functions/variablessnake_case, constantsSCREAMING_SNAKE_CASE - Domain-first naming: prefer
DiscordChannel,SecurityPolicy,SqliteMemoryoverManager,Util,Helper - Trait implementers: keep predictable suffixes (
*Provider,*Channel,*Tool,*Memory) - Factory keys: lowercase and stable (
openai,discord,shell) - Tests: behavior-oriented names (
subject_expected_behavior)
Pull Request Checklist
Before Opening PR
Before Opening PR
- PR template sections are completed (including security + rollback)
-
./scripts/ci/rust_quality_gate.shpasses -
cargo test --lockedpasses locally - New code has inline
#[cfg(test)]tests - No new dependencies unless absolutely necessary
- README updated if adding user-facing features
- Follows code naming conventions and architecture boundary rules
- No personal/sensitive data in code/docs/tests/fixtures
Commit Convention
Commit Convention
We use Conventional Commits:Recommended scope keys:
provider, channel, memory, security, runtime, ci, docs, testsCode Style
Code Style
- Minimal dependencies — every crate adds to binary size
- Inline tests —
#[cfg(test)] mod tests {}at the bottom of each file - Trait-first — define the trait, then implement
- Security by default — sandbox everything, allowlist, never blocklist
- No unwrap in production code — use
?,anyhow, orthiserror
Reporting Issues
- Bugs: Include OS, Rust version, steps to reproduce, expected vs actual
- Features: Describe the use case, propose which trait to extend
- Security: See SECURITY.md for responsible disclosure
- Privacy: Redact/anonymize all personal data before posting logs/payloads
Resources
CONTRIBUTING.md
Full contributor guide with detailed workflows
Examples
Working code examples for all extension points
Architecture Docs
Deep dives into system design and patterns
Discussions
Ask questions and share ideas