Welcome to the Claude MPM project! This guide will help you get started with contributing to our multi-agent project management framework.
Claude MPM uses a quality-first development approach with three essential commands that should be part of your daily workflow:
# 1. Auto-fix code issues during development
make lint-fix
# 2. Run all quality checks before commits
make quality
# 3. Build with complete quality validation for releases
make safe-release-build-
During Development: Use
make lint-fixfrequently to maintain code quality- Uses Ruff (10-200x faster than traditional tools)
- Auto-fixes formatting, import sorting, and simple linting issues
- Safe to run anytime - only fixes issues, never breaks code
- Keeps your code clean as you work
-
Before Commits: Always run
make qualitybefore committing- Runs comprehensive quality checks (ruff linting + formatting, mypy type checking, structure validation)
- Catches issues early in the development cycle
- Required step - don't skip this!
-
For Releases: Use
make safe-release-buildfor any release builds- Complete pre-publish quality gate plus build process
- Ensures all releases meet our quality standards
- Mandatory for all production releases
We use Ruff for unified linting and formatting, replacing multiple legacy tools:
- What Ruff replaces: black (formatting), isort (import sorting), flake8 (linting), pyupgrade (syntax modernization)
- Performance: 10-200x faster than traditional Python linting tools
- Still use mypy: Type checking remains with mypy (Ruff doesn't replace type checkers)
- Configuration: All settings in
pyproject.tomlunder[tool.ruff]
| Command | When to Use | What It Does | Time |
|---|---|---|---|
make lint-fix |
During development | Auto-fixes formatting, imports, simple issues | ~30s |
make quality |
Before every commit | Comprehensive quality checks and validation | ~2-3min |
make safe-release-build |
For releases | Complete quality gate + safe build | ~5-10min |
Always run the quality check:
# This should pass before you commit
make qualityIf make quality fails:
- First try
make lint-fixto auto-fix common issues - Address any remaining issues manually
- Run
make qualityagain to verify fixes
We use Conventional Commits for automatic versioning:
feat:- New features (minor version bump)fix:- Bug fixes (patch version bump)feat!:orBREAKING CHANGE:- Breaking changes (major version bump)perf:- Performance improvementsrefactor:- Code refactoringdocs:- Documentation updatestest:- Test additions/updates
Example:
git commit -m "feat: add new quality validation commands to development workflow"Claude MPM supports both Mamba (recommended) and traditional Python environments:
# Clone and setup
git clone https://github.com/your-repo/claude-mpm.git
cd claude-mpm
# Setup with automatic environment detection
make setup
# Or use specific environment
make setup --use-venv # Force traditional venv- Mamba (Recommended): 50-80% faster dependency resolution, optimized binaries
- Auto-detection:
./scripts/claude-mpmautomatically uses the best available environment - Project-specific: Environments are isolated per project
- Service-Oriented Architecture: Use our five specialized service domains
- Interface-Based Contracts: All services implement explicit interfaces
- Dependency Injection: Use service container for loose coupling
- Performance: Implement caching and lazy loading appropriately
- Security: Follow security guidelines in docs/reference/SECURITY.md
- Scripts: ALL scripts go in
/scripts/, NEVER in project root - Tests: ALL tests go in
/tests/, NEVER in project root - Python modules: Always under
/src/claude_mpm/ - Import conventions: Use full package names:
from claude_mpm.module import ...
We maintain 85%+ test coverage across:
- Unit Tests: Individual services and components
- Integration Tests: Service interactions and interfaces
- Performance Tests: Caching and optimization verification
- Security Tests: Input validation and security measures
- E2E Tests: Complete user workflows
Tests are configured to run in parallel by default using pytest-xdist, providing 3-4x speedup:
# Run all tests in parallel (default, fastest)
make test
# Run tests serially for debugging
make test-serial
# Run only unit tests (fast)
make test-fast
# Run with coverage report
make test-coverage
# Run specific test types
make test-unit # Unit tests only
make test-integration # Integration tests only
make test-e2e # End-to-end tests onlyParallelization Details:
- Tests use all available CPU cores by default (
-n auto) - Expected speedup: 3-4x faster than serial execution
- Typical execution time: ~30-45 seconds (down from 2-3 minutes)
- Use
make test-serialfor debugging race conditions or fixture issues
Writing Thread-Safe Tests:
- Ensure test fixtures are isolated (use
tmp_pathfor file operations) - Avoid shared state between tests
- Use
@pytest.mark.serialfor tests that must run sequentially - Mock external services to prevent port conflicts
- Start Here: docs/README.md - Complete navigation guide
- Architecture: docs/developer/ARCHITECTURE.md - Service architecture
- Structure: docs/developer/STRUCTURE.md - File organization
- Services: docs/developer/SERVICES.md - Service development
- Quality: docs/developer/QA.md - Testing procedures
- Deployment: docs/reference/DEPLOY.md - Release process
- Service Documentation: Document all interfaces and implementations
- Architecture Updates: Keep architecture docs current with changes
- Migration Guides: Document breaking changes and upgrade paths
- Performance Metrics: Document performance expectations and benchmarks
- Create Interface: Define service contract in
src/claude_mpm/services/core/interfaces.py - Implement Service: Create implementation in appropriate service domain
- Register Service: Add to service container for dependency injection
- Add Tests: Unit, integration, and interface compliance tests
- Update Documentation: Document in docs/developer/SERVICES.md
- Create command module in
src/claude_mpm/cli/commands/ - Register in
src/claude_mpm/cli/parser.py - Follow existing command patterns
- Use dependency injection for service access
- Add comprehensive tests and documentation
- Edit
src/claude_mpm/agents/INSTRUCTIONS.mdfor PM behavior - Edit
src/claude_mpm/agents/BASE_PM.mdfor framework requirements - Test with
./claude-mpm runin interactive mode - Update tests for PM behavior changes
- Quality Check Failures: Run
make lint-fixfirst, then address remaining issues - Import Errors: Ensure virtual environment is activated and PYTHONPATH includes
src/ - Service Resolution Errors: Check service container registration
- Version Errors: Run
pip install -e .for proper installation
- Development Guidelines: Read CLAUDE.md first - Critical guide to the three environments and deployment architecture
- Documentation: Comprehensive guides in docs/
- Architecture: docs/developer/ARCHITECTURE.md for service architecture
- Quality Issues: See docs/reference/DEPLOY.md#quality-gates
Claude MPM is a framework that extends Claude Code with multi-agent orchestration capabilities, featuring:
- Service-Oriented Architecture: Five specialized service domains
- Interface-Based Contracts: All services implement explicit interfaces
- Dependency Injection: Service container with automatic resolution
- Performance Optimizations: Lazy loading, multi-level caching, connection pooling
- Security Framework: Input validation, path traversal prevention
- Backward Compatibility: Lazy imports maintain existing import paths
For maintainers handling releases:
# Patch release (bug fixes)
make release-patch
# Minor release (new features)
make release-minor
# Major release (breaking changes)
make release-major
# Publish to all channels
make release-publishAll releases require passing the complete quality gate (make pre-publish).
- 📚 Start with: docs/README.md for complete documentation navigation
- 🏗️ Architecture: docs/developer/ARCHITECTURE.md for system design
- 🔧 Development: CLAUDE.md for detailed development guidelines
- 🚀 Deployment: docs/reference/DEPLOY.md for release process
By contributing to Claude MPM, you agree that your contributions will be licensed under the Elastic License 2.0, the same license that covers the project.
- Your contributions become part of Claude MPM under Elastic License 2.0
- You retain copyright to your contributions
- You grant Bob Matsuoka and the project the right to use your contributions
- You confirm you have the right to submit the contribution
For significant contributions, we may ask you to sign a Contributor License Agreement (CLA). This protects both you and the project.
If you have questions about licensing your contribution, contact bob@matsuoka.com
Thank you for contributing to Claude MPM! 🚀