Thank you for your interest in contributing to Codomyrmex! This document provides a short entry point.
For the full maintainer guide (environment setup, RASP documentation, AI agent workflows, and detailed testing policy), see .github/CONTRIBUTING.md.
- Python 3.11+
- UV package manager
- Git
# Clone the repository
git clone https://github.com/docxology/codomyrmex.git
cd codomyrmex
# Install dependencies with UV
uv sync --all-extras --dev
# Run tests to verify setup
uv run pytestNever commit local secrets or generated artifacts, even if they appear in your working tree: .env, .encryption_key, memory.db, *.log, coverage.json, cov_config.json, codomyrmex_inventory.json, and similar outputs. They are listed in .gitignore. If something sensitive was ever pushed, rotate credentials and remove it from history per SECURITY.md.
main: Stable production codedevelop: Integration branch for featuresfeature/*: New featuresfix/*: Bug fixesdocs/*: Documentation updates
-
Create a branch from
main:git checkout -b feature/your-feature-name
-
Make your changes following the code style guidelines
-
Run pre-commit checks:
uv run pre-commit run --all-files
-
Run tests:
uv run pytest src/codomyrmex/tests/unit/ -v
-
Commit your changes with clear, descriptive messages:
git commit -m "feat: add new feature description"
- Python: We follow PEP 8 with Ruff formatting
- Linting: Ruff for linting and formatting (replaces Black + flake8)
- Type hints: Required for all public functions
- Docstrings: Google-style docstrings for all modules, classes, and functions
We use pre-commit hooks to ensure code quality. Install them with:
uv run pre-commit install- Write tests for all new features
- Maintain test coverage above the project gate (β₯40%, ratcheting upward)
- Place unit tests in
src/codomyrmex/tests/unit/ - Place integration tests in
src/codomyrmex/tests/integration/
- Update relevant documentation when making changes
- Every module follows the RASP pattern β four standard docs that must stay in sync with code:
README.mdβ Module overview, key exports, quick startAGENTS.mdβ AI agent coordination and operating contractsSPEC.mdβ Functional specification and design rationalePAI.mdβ PAI system integration and algorithm phase mapping
- Additionally, modules with programmatic APIs maintain
API_SPECIFICATION.mdand AI-callable tools maintainMCP_TOOL_SPECIFICATION.md - See Documentation Guide for detailed writing guidance
We follow Conventional Commits:
feat: add new feature description
fix: resolve specific bug
docs: update module documentation
refactor: restructure without behavior change
test: add or update tests
chore: maintenance tasks
- Ensure all tests pass
- Update documentation as needed (RASP files for affected modules)
- Add a clear PR description
- Request review from maintainers
Codomyrmex has two distinct error handling patterns depending on the module type:
Functions that wrap shell commands or subprocesses always return a dict and
never raise on process failure (unless an explicit check=True flag is provided).
This allows orchestration pipelines to aggregate outcomes without try/except at
every call site.
# Shell utility β returns dict
result = shell("my-command")
if not result["success"]:
logger.error(result["error"])Standard keys: success (bool), returncode (int|None), stdout, stderr,
execution_time (float), and optionally error (str) for timeout/OS errors.
Agent methods and Python-native APIs raise typed exceptions for caller ergonomics. The caller uses try/except and handles the specific error type.
# Agent method β raises on failure
try:
result = agent.execute(task)
except AgentTimeoutError as e:
logger.error(f"Agent timed out: {e}")The rule of thumb: if your function's primary use case is subprocess interop or orchestration pipelines, use the dict pattern. If it's a Python object method called from Python code, use exceptions.
| Document | Purpose |
|---|---|
| README.md | Project overview and quick start |
| SPEC.md | Functional specification and design principles |
| AGENTS.md | AI agent coordination and navigation |
| SECURITY.md | Security policies and vulnerability reporting |
| CODE_OF_CONDUCT.md | Community standards |
| CHANGELOG.md | Version history and release notes |
| Testing Strategy | Testing approach and best practices |
| Environment Setup | Development environment configuration |
Open an issue for questions or discussions about contributing.