cargo fmt --all -- --check
cargo clippy --all-targets -- -D warnings
cargo testFull pre-PR validation (recommended):
./dev/ci.sh allDocs-only changes: run markdown lint and link-integrity checks. If touching bootstrap scripts: bash -n install.sh.
ZeroClaw is a Rust-first autonomous agent runtime optimized for performance, efficiency, stability, extensibility, sustainability, and security.
Core architecture is trait-driven and modular. Extend by implementing traits and registering in factory modules.
Key extension points:
src/providers/traits.rs(Provider)src/channels/traits.rs(Channel)src/tools/traits.rs(Tool)src/memory/traits.rs(Memory)src/observability/traits.rs(Observer)src/runtime/traits.rs(RuntimeAdapter)src/peripherals/traits.rs(Peripheral) β hardware boards (STM32, RPi GPIO)
src/main.rsβ CLI entrypoint and command routingsrc/lib.rsβ module exports and shared command enumssrc/config/β schema + config loading/mergingsrc/agent/β orchestration loopsrc/gateway/β webhook/gateway serversrc/security/β policy, pairing, secret storesrc/memory/β markdown/sqlite memory backends + embeddings/vector mergesrc/providers/β model providers and resilient wrappersrc/channels/β Telegram/Discord/Slack/etc channelssrc/tools/β tool execution surface (shell, file, memory, browser)src/peripherals/β hardware peripherals (STM32, RPi GPIO)src/runtime/β runtime adapters (currently native)docs/β topic-based documentation (setup-guides, reference, ops, security, hardware, contributing, maintainers).github/β CI, templates, automation workflows
- Low risk: docs/chore/tests-only changes
- Medium risk: most
src/**behavior changes without boundary/security impact - High risk:
src/security/**,src/runtime/**,src/gateway/**,src/tools/**,.github/workflows/**, access-control boundaries
When uncertain, classify as higher risk.
- Read before write β inspect existing module, factory wiring, and adjacent tests before editing.
- One concern per PR β avoid mixed feature+refactor+infra patches.
- Implement minimal patch β no speculative abstractions, no config keys without a concrete use case.
- Validate by risk tier β docs-only: lightweight checks. Code changes: full relevant checks.
- Document impact β update PR notes for behavior, risk, side effects, and rollback.
- Queue hygiene β stacked PR: declare
Depends on #.... Replacing old PR: declareSupersedes #....
Branch/commit/PR rules:
- Work from a non-
masterbranch. Open a PR tomaster; do not push directly. - Use conventional commit titles. Prefer small PRs (
size: XS/S/M). - Follow
.github/pull_request_template.mdfully. - Never commit secrets, personal data, or real identity information (see
@docs/contributing/pr-discipline.md).
- Do not add heavy dependencies for minor convenience.
- Do not silently weaken security policy or access constraints.
- Do not add speculative config/feature flags "just in case".
- Do not mix massive formatting-only changes with functional changes.
- Do not modify unrelated modules "while here".
- Do not bypass failing checks without explicit explanation.
- Do not hide behavior-changing side effects in refactor commits.
- Do not include personal identity or sensitive information in test data, examples, docs, or commits.
@docs/contributing/change-playbooks.mdβ adding providers, channels, tools, peripherals; security/gateway changes; architecture boundaries@docs/contributing/pr-discipline.mdβ privacy rules, superseded-PR attribution/templates, handoff template@docs/contributing/docs-contract.mdβ docs system contract, i18n rules, locale parity