Developing amplihack¶
Type: How-To (Task-Oriented)
How to set up a local development environment for contributing to amplihack-rs.
Prerequisites¶
- Rust toolchain (1.70+) via rustup.rs
- Node.js 18+ and npm (for Claude Code CLI)
- git 2.0+
Clone and Build¶
Run Tests¶
Project Structure¶
| Directory | Purpose |
|---|---|
crates/ |
Rust crate workspace |
crates/amplihack-cli/ |
Main CLI binary |
amplifier-bundle/ |
Framework assets (agents, recipes, commands) |
docs/ |
Documentation (mkdocs site) |
tests/ |
Integration and end-to-end tests |
Key Crates¶
| Crate | Purpose |
|---|---|
amplihack-cli |
CLI argument parsing and routing |
amplihack-core |
Core types and utilities |
amplihack-agent-core |
Agent runtime and lifecycle |
amplihack-agent-eval |
Evaluation harness |
amplihack-memory |
Memory backend |
amplihack-recipes |
Recipe runner |
Development Workflow¶
1. Create a Feature Branch¶
2. Make Changes¶
Edit Rust code in crates/, framework assets in amplifier-bundle/,
or documentation in docs/.
3. Format and Lint¶
4. Test¶
5. Build Documentation (Optional)¶
6. Commit and Push¶
7. Create Pull Request¶
PRs require:
- All CI checks passing (lint, test, build across 4 targets)
- Documentation updates for user-facing changes
- No regressions in existing tests
Common Tasks¶
Adding a CLI Subcommand¶
- Create a new module in
crates/amplihack-cli/src/commands/ - Register it in
crates/amplihack-cli/src/commands/mod.rs - Add tests in the module's
tests/subdirectory
Adding a Recipe¶
- Create a YAML file in
amplifier-bundle/recipes/ - Define steps with
type: agent,type: shell, ortype: sub_recipe - Test with
amplihack recipe run your-recipe.yaml
Adding an Agent¶
- Create a markdown file in
amplifier-bundle/agents/ - Define the agent's role, tools, and instructions
- Register in the appropriate directory (core, specialized, or workflows)
Troubleshooting¶
Build Failures¶
Test Failures¶
Pre-commit Hook Issues¶
The project uses pre-commit hooks. If they fail:
Related¶
- Prerequisites — detailed tool installation
- Create Your Own Tools — building custom tools
- Code Review — code review practices