Contributing
Chinese version: 简体中文
Thank you for contributing to py-xiaozhi. This guide explains how we expect issues, pull requests, review cycles, and maintainer handoff to work.
What We Welcome
We welcome:
- Bug reports with clear reproduction steps
- Documentation fixes and examples
- Tests and tooling improvements
- Focused features that fit the project roadmap
- Small refactors that reduce complexity without changing behavior
For large feature requests, architectural changes, or behavior changes, please open an issue first so the scope can be discussed before implementation.
Development Setup
Requirements
- Python
>=3.10 - Git
- A usable microphone and speaker when validating audio-related changes
Clone and Install
git clone https://github.com/huangjunsen0406/py-xiaozhi.git
cd py-xiaozhi
# Base install
uv sync
# GUI + development tools
uv sync --extra gui --group devIf you do not use uv, you can use the fallback path:
pip install -e .
pip install -e '.[gui]'
pip install pytest pytest-asyncio ruff pyinstallerWorking on a Change
Branching
Create a topic branch from main:
git checkout -b fix/your-change mainRecommended branch prefixes:
feature/xxxfix/xxxdocs/xxxrefactor/xxxtest/xxx
Commit Messages
We follow Conventional Commits:
<type>[optional scope]: <description>Examples:
fix(audio): avoid empty opus framedocs(readme): clarify gui installrefactor(protocol): simplify reconnect flow
Quality Checks
Run the checks that apply to your change before opening a pull request:
ruff check .
ruff format .
pytestValidate the runtime path that matches your change:
- GUI changes:
python main.py - CLI changes:
python main.py --mode cli - MQTT changes:
python main.py --protocol mqtt - Docs changes:
cd documents
pnpm install
pnpm docs:devPull Request Expectations
A good pull request is usually:
- Focused on one topic
- Easy to review commit by commit
- Clear about the problem being solved
- Explicit about validation steps
- Updated with docs when behavior or configuration changes
Please include the following in the PR description when relevant:
- Why the change is needed
- What changed
- How you verified it
- Screenshots, logs, or recordings for UI and behavior changes
- Related issue links
Review Policy
Maintainers generally review pull requests using these criteria:
- Scope is clear and aligned with project goals.
- The change is reproducible, testable, and technically sound.
- The implementation fits existing architecture and coding style.
- Docs and validation evidence are present when needed.
- Review feedback has been addressed without introducing unrelated churn.
Maintainer Workflow
The typical maintainer workflow is:
- Triage the incoming change as
bug,feature,docs,refactor, ormaintenance. - Confirm that the problem statement and scope are complete enough to review.
- Request changes when tests, docs, or validation evidence are missing.
- Merge after CI passes and review feedback is resolved.
- Ship through the normal release flow; merge does not guarantee an immediate release.
Issue Reporting
Please use the existing GitHub issue templates whenever possible:
- Bug report
- Feature request
- Documentation improvement
- Code improvement
When opening an issue, include:
- Expected behavior
- Actual behavior
- Reproduction steps
- OS and Python version
- Logs, stack traces, or screenshots when useful
Documentation Contributions
Documentation lives under documents/docs.
For docs-only contributions:
- Keep wording direct and task-oriented.
- Prefer runnable commands and concrete examples.
- Update both English and Chinese pages when content is intended to stay in sync.
- Preview the VitePress site locally before opening the PR.
Related Entry Points
- Repository workflow: CONTRIBUTING.md
- Chinese repository workflow: CONTRIBUTING_ZH.md
- Project documentation: https://huangjunsen0406.github.io/py-xiaozhi/