2026-03-15 02:30:09 +08:00
# Contributing to nanobot
2026-03-16 03:06:23 +00:00
Thank you for being here.
nanobot is built with a simple belief: good tools should feel calm, clear, and humane.
We care deeply about useful features, but we also believe in achieving more with less:
solutions should be powerful without becoming heavy, and ambitious without becoming
needlessly complicated.
This guide is not only about how to open a PR. It is also about how we hope to build
software together: with care, clarity, and respect for the next person reading the code.
2026-03-15 02:30:09 +08:00
## Maintainers
2026-05-27 18:16:52 +08:00
Maintainers are community stewards who help review, organize, and maintain the project. The list below describes each maintainer's current open-source project responsibilities.
2026-03-15 02:30:09 +08:00
| Maintainer | Focus |
|------------|-------|
| [@re-bin ](https://github.com/re-bin ) | Project lead, `main` branch |
| [@chengyongru ](https://github.com/chengyongru ) | `nightly` branch, experimental features |
## Branching Strategy
2026-03-16 03:06:23 +00:00
We use a two-branch model to balance stability and exploration:
2026-03-15 02:30:09 +08:00
| Branch | Purpose | Stability |
|--------|---------|-----------|
| `main` | Stable releases | Production-ready |
| `nightly` | Experimental features | May have bugs or breaking changes |
### Which Branch Should I Target?
**Target `nightly` if your PR includes:**
- New features or functionality
- Refactoring that may affect existing behavior
- Changes to APIs or configuration
**Target `main` if your PR includes:**
- Bug fixes with no behavior changes
- Documentation improvements
- Minor tweaks that don't affect functionality
2026-03-16 03:06:23 +00:00
**When in doubt, target `nightly`.** It is easier to move a stable idea from `nightly`
to `main` than to undo a risky change after it lands in the stable branch.
2026-03-15 02:30:09 +08:00
2026-04-30 17:53:18 +08:00
### Starting Work
Before making changes, sync the target branch and create a topic branch from it.
For stable bug fixes and documentation-only changes, start from the latest `main` .
For experimental work, start from the latest `nightly` .
```bash
git fetch upstream
git switch main
git pull --ff-only upstream main
git switch -c your-topic-branch
```
Use your primary HKUDS/nanobot remote in place of `upstream` if your checkout
uses a different remote name.
Keep unrelated local changes out of the topic branch. If your checkout already has
work in progress, use a separate worktree or finish that work before starting a
new branch.
2026-03-15 02:30:09 +08:00
### How Does Nightly Get Merged to Main?
We don't merge the entire `nightly` branch. Instead, stable features are **cherry-picked** from `nightly` into individual PRs targeting `main` :
```
nightly ──┬── feature A (stable) ──► PR ──► main
├── feature B (testing)
└── feature C (stable) ──► PR ──► main
```
This happens approximately **once a week** , but the timing depends on when features become stable enough.
### Quick Summary
| Your Change | Target Branch |
|-------------|---------------|
| New feature | `nightly` |
| Bug fix | `main` |
| Documentation | `main` |
| Refactoring | `nightly` |
| Unsure | `nightly` |
## Development Setup
2026-03-16 03:06:23 +00:00
Keep setup boring and reliable. The goal is to get you into the code quickly:
2026-03-15 02:30:09 +08:00
```bash
# Clone the repository
git clone https://github.com/HKUDS/nanobot.git
cd nanobot
# Install with dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Lint code
ruff check nanobot/
2026-05-15 17:20:15 -04:00
# Format code — optional. The existing tree predates `ruff format`,
# so running it across `nanobot/` produces a large unrelated diff
# (E501 is ignored, so many existing lines exceed the 100-char setting).
# Format only files you've actually touched, not the whole package.
ruff format <files-you-changed>
2026-03-15 02:30:09 +08:00
```
2026-04-26 18:01:55 +00:00
## Contribution License
By submitting a contribution, you confirm that you have the right to submit it
and agree that it will be licensed under the project's MIT License.
2026-03-15 02:30:09 +08:00
## Code Style
2026-03-16 03:06:23 +00:00
We care about more than passing lint. We want nanobot to stay small, calm, and readable.
When contributing, please aim for code that feels:
- Simple: prefer the smallest change that solves the real problem
- Clear: optimize for the next reader, not for cleverness
- Decoupled: keep boundaries clean and avoid unnecessary new abstractions
- Honest: do not hide complexity, but do not create extra complexity either
- Durable: choose solutions that are easy to maintain, test, and extend
In practice:
- Line length: 100 characters (`ruff` )
2026-03-15 02:30:09 +08:00
- Target: Python 3.11+
- Linting: `ruff` with rules E, F, I, N, W (E501 ignored)
2026-03-16 03:06:23 +00:00
- Async: uses `asyncio` throughout; pytest with `asyncio_mode = "auto"`
- Prefer readable code over magical code
- Prefer focused patches over broad rewrites
- If a new abstraction is introduced, it should clearly reduce complexity rather than move it around
2026-03-15 02:30:09 +08:00
2026-05-09 08:15:27 +00:00
## Modifying CI Workflows
If your PR touches `.github/workflows/` , please keep the CI within
GitHub Actions' free tier:
- Use only standard GitHub-hosted runners (`ubuntu-latest` , `windows-latest` )
- Avoid macOS runners, larger runners (`*-cores` , `*-xlarge` , `*-gpu` ),
and self-hosted runners
- Avoid uploading large artifacts or using long retention
- Avoid paid Marketplace actions
If your change genuinely needs to step outside this, please call it out
explicitly in the PR description so it can be discussed before merge.
2026-03-15 02:30:09 +08:00
## Questions?
2026-03-16 03:06:23 +00:00
If you have questions, ideas, or half-formed insights, you are warmly welcome here.
Please feel free to open an [issue ](https://github.com/HKUDS/nanobot/issues ), join the community, or simply reach out:
2026-03-15 02:30:09 +08:00
- [Discord ](https://discord.gg/MnCvHqpUGB )
- [Feishu/WeChat ](./COMMUNICATION.md )
2026-03-16 03:06:23 +00:00
- Email: Xubin Ren (@Re -bin) — <xubinrencs@gmail .com>
Thank you for spending your time and care on nanobot. We would love for more people to participate in this community, and we genuinely welcome contributions of all sizes.