Thank you for your interest in contributing to the Huawei Cloud AgentArts SDK!
- Code of Conduct
- Development Setup
- Code Style
- Testing
- Git Commit Guidelines
- Pull Request Process
- Branch Naming Convention
Please be respectful and constructive in all interactions. We are committed to providing a welcoming and inspiring community for all.
- Fork and clone the repository
- Create a virtual environment:
python -m venv venv - Activate the environment:
- Windows:
venv\Scripts\activate - Linux/Mac:
source venv/bin/activate
- Windows:
- Install development dependencies:
pip install -e ".[dev]"
We follow strict code quality standards to maintain consistency across the codebase.
| Tool | Purpose |
|---|---|
| Black | Code formatting |
| isort | Import sorting |
| mypy | Static type checking |
| Ruff | Fast Python linter |
# Format code
black .
isort .
# Type checking
mypy agentarts
# Linting
ruff check .
# Or run all at once
black . && isort . && mypy agentarts && ruff check .We recommend setting up pre-commit hooks to automatically run checks before each commit:
pip install pre-commit
pre-commit install- Write tests for all new functionality
- Maintain or improve code coverage
- Follow the existing test structure
# Run all tests
pytest
# Run with coverage
pytest --cov=agentarts --cov-report=html
# Run specific test file
pytest tests/unit/test_core.py
# Run specific test
pytest tests/unit/test_core.py::test_import| Directory | Purpose |
|---|---|
tests/unit/ |
Unit tests for individual components |
tests/integration/ |
Integration tests between components |
tests/e2e/ |
End-to-end tests for complete workflows |
We follow the Conventional Commits specification for commit messages.
<type>(<scope>): <subject>
[optional body]
[optional footer(s)]
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Documentation only changes |
style |
Changes that do not affect the meaning of the code (white-space, formatting, etc.) |
refactor |
A code change that neither fixes a bug nor adds a feature |
perf |
A code change that improves performance |
test |
Adding missing tests or correcting existing tests |
build |
Changes that affect the build system or external dependencies |
ci |
Changes to CI configuration files and scripts |
chore |
Other changes that don't modify src or test files |
revert |
Reverts a previous commit |
| Scope | Description |
|---|---|
runtime |
Agent runtime module |
memory |
Memory module |
identity |
Identity management |
mcp |
MCP gateway |
tools |
Built-in tools |
service |
Service wrapper |
integration |
Framework adapters |
cli |
CLI toolkit |
docs |
Documentation |
test |
Testing infrastructure |
# Feature
feat(runtime): add async context support
# Bug fix
fix(memory): resolve vector store connection timeout
# Documentation
docs(readme): update installation instructions
# Refactoring
refactor(tools): simplify code interpreter sandbox
# Performance
perf(memory): optimize vector search algorithm
# Breaking change
feat(runtime)!: change AgentRuntime API signature
BREAKING CHANGE: The `execute` method now requires an explicit `context` parameter.- Subject line must be lowercase and not end with a period
- Subject line should be 50 characters or less
- Body should be wrapped at 72 characters
- Use imperative mood in the subject line (e.g., "add" not "added")
- Reference issues and pull requests liberally in the footer
- Create a feature branch from
main - Make your changes following code style guidelines
- Add tests for new functionality
- Update documentation if needed
- Run all checks locally:
black . && isort . && mypy agentarts && ruff check . && pytest
PR titles should follow the same format as commit messages:
<type>(<scope>): <description>
Examples:
feat(runtime): add async context supportfix(memory): resolve vector store connection timeoutdocs: update API reference
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Documentation update
## How Has This Been Tested?
Describe the tests you ran
## Checklist:
- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my own code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes- At least one approval from a maintainer is required
- All CI checks must pass
- No merge conflicts
- Squash and merge will be used to merge PRs
Use descriptive branch names following these patterns:
| Pattern | Example | Description |
|---|---|---|
feature/<description> |
feature/async-runtime |
New features |
fix/<description> |
fix/memory-leak |
Bug fixes |
refactor/<description> |
refactor/tools-sandbox |
Code refactoring |
docs/<description> |
docs/api-reference |
Documentation |
test/<description> |
test/runtime-coverage |
Adding tests |
chore/<description> |
chore/update-dependencies |
Maintenance tasks |
- Use lowercase letters
- Use hyphens to separate words
- Keep names short and descriptive
- Include issue number if applicable:
feature/async-runtime-#123
If you have questions, feel free to:
- Open a Discussion
- Ask in your pull request
- Email: agentarts@huawei.com
Thank you for contributing! 🎉