Contributing to AuditAI¶
Development setup, code style, testing, and PR workflow.
Development Environment¶
1. Clone and Install¶
git clone https://github.com/your-org/eth-beijing-2026.git
cd eth-beijing-2026
pip install -r requirements.txt
2. Install Dev Dependencies¶
3. Set Up Environment¶
4. Verify Setup¶
Code Style¶
Python¶
- Python 3.11+ — use modern syntax (
list[dict]notList[Dict]) - Formatter: Black (
black .) - Linter: Ruff (
ruff check .) - Type hints: Required for function signatures
Solidity¶
- Style: Solidity Style Guide
- Compiler: 0.8.x
- License: MIT
Naming Conventions¶
| Type | Convention | Example |
|---|---|---|
| Functions | snake_case |
detect_vulnerabilities |
| Classes | PascalCase |
AuditorAgent |
| Constants | UPPER_SNAKE |
MAX_CHUNK_CHARS |
| Private methods | _prefix |
_run_slither |
Project Structure¶
src/
├── agents/ # 5-agent pipeline
│ ├── auditor.py # Detection logic
│ ├── architect.py # Repair strategy
│ ├── code_generator.py
│ ├── refiner.py
│ ├── validator.py
│ └── orchestrator.py
├── tools/ # Domain tools
├── knowledge/ # RAG knowledge base
├── chain/ # EAS attestation
├── mcp/ # MCP server
├── evaluation/ # Evaluation framework
└── utils/ # Shared utilities
Running Tests¶
# All tests
pytest
# Specific test file
pytest tests/test_auditor.py
# With verbose output
pytest -v
# With coverage
pytest --cov=src
Linting and Formatting¶
# Format with Black
black src/ tests/
# Lint with Ruff
ruff check src/ tests/
# Type check with Mypy
mypy src/
PR Workflow¶
1. Create a Branch¶
2. Make Changes¶
- Write code following the style guide
- Add tests for new functionality
- Update documentation if needed
3. Run Checks¶
4. Commit¶
Commit message format:
- feat: — new feature
- fix: — bug fix
- docs: — documentation
- test: — tests
- refactor: — code refactoring
- chore: — maintenance
5. Push and Create PR¶
Create a PR on GitHub with: - Clear description of changes - Link to related issues - Screenshots if UI changes
Adding New Agents¶
See Extending Guide for how to add new detectors, tools, and MCP tools.
See Also¶
- Extending Guide — add new features
- Architecture Overview — system design
- Configuration Reference — all settings