AI-Powered Human-in-the-Loop Development Framework
简体中文 | English
Features • Installation • Architecture • Commands • Contributing
With complete PRD and comprehensive tech specs, the entire development process runs autonomously - no human attendance required. Just set it up and let it run.
Human-in-the-loop design philosophy - AI executes, humans decide. Every critical node can pause for human intervention, ensuring controllable and predictable development.
Extensible Agent framework - Orchestrator, Coder, Tester, Fixer, Reviewer - five specialized agents collaborate through state files to drive the development loop.
Supports both OpenCode and Claude Code, switch AI engine with one command.
Java/Spring Boot, Python, Node.js, React, Vue... Any tech stack, just define tech-stack.md to start.
- Python 3.8+
- OpenCode or Claude Code installed
Windows:
scoop install opencode
# or
npm install -g opencode-aimacOS:
brew install anomalyco/tap/opencode
# or
npm install -g opencode-aiLinux:
curl -fsSL https://opencode.ai/install | bash
# or
npm install -g opencode-ainpm install -g @anthropic-ai/claude-code
claude auth loginWindows:
python -m pip install --upgrade pip
python -m pip install -e .
hc --versionmacOS / Linux:
python3 -m pip install --upgrade pip
python3 -m pip install -e .
hc --version🔧 Common Issues
Q: hc command not found
Windows: Add Python Scripts directory to PATH
python -c "import sysconfig; print(sysconfig.get_path('scripts'))"
# Add the output path to system PATHmacOS/Linux:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.zshrc
source ~/.zshrcQ: externally-managed-environment error
Use venv:
python3 -m venv ~/.hc-venv
source ~/.hc-venv/bin/activate
pip install harnesscode┌─────────────────────────────────────────────────────────┐
│ Orchestrator │
│ Read State → Decide Next → Dispatch Agent │
└─────────────────────┬───────────────────────────────────┘
│
┌─────────────┼─────────────┐
│ │ │
▼ ▼ ▼
┌───────────┐ ┌───────────┐ ┌───────────┐
│ Coder │ │ Tester │ │ Fixer │
│ Implement│ │ Test │ │ Fix │
└───────────┘ └───────────┘ └───────────┘
│ │ │
└─────────────┼─────────────┘
│
▼
┌───────────┐
│ Reviewer │
│ Review │
└───────────┘
| Agent | Responsibility |
|---|---|
| Orchestrator | Read project state, decide which agent to run next |
| Initializer | Project setup, check tech stack, generate feature_list |
| Coder | Implement feature code |
| Tester | Multi-layer testing: static analysis → unit test → compilation |
| Fixer | Fix issues based on test/review reports |
| Reviewer | Code compliance review |
.your-project/
├── .harnesscode/ # Runtime data (auto-generated)
│ ├── feature_list.json # Feature list
│ ├── test_report.json # Test report
│ ├── review_report.json # Review report
│ ├── missing_info.json # Blockers (need human action)
│ └── config.yaml # Project config
├── input/ # Input files
│ ├── prd/ # PRD documents
│ │ └── tech-stack.md # Tech stack definition (required)
│ └── techspec/ # Tech spec files
└── dev-log.txt # Runtime log
Contains product requirements and tech stack definition.
| File | Required | Description |
|---|---|---|
tech-stack.md |
✅ Yes | Tech stack definition. Filename must be exact, format is flexible |
The included tech-stack.md is an example (Java + React). Customize it for your project.
Code conventions and standards. Each file defines rules for a specific category.
Java Specs (use as reference or modify directly):
tech-spec-checkstyle.md- Code style (Checkstyle)tech-spec-entity.md- Entity class conventionstech-spec-dto.md- DTO conventionstech-spec-service.md- Service layer conventionstech-spec-controller.md- Controller conventionstech-spec-mapper.md- MyBatis Mapper conventionstech-spec-enum.md- Enum conventionstech-spec-exception.md- Exception handlingtech-spec-response.md- API response formattech-spec-database.md- Database conventions
React/TypeScript Specs:
tech-spec-react-component.md- React component conventionstech-spec-typescript.md- TypeScript conventionstech-spec-antd-usage.md- Ant Design usagetech-spec-api-request.md- API request conventionstech-spec-frontend-*.md- Frontend routing, style, form, performance, securitytech-spec-redux.md- State managementtech-spec-i18n.md- Internationalization
| Command | Description |
|---|---|
hc init |
Initialize project config (interactive) |
hc start |
Start development loop |
hc status |
Show project status and metrics |
hc restore |
Restore config files from backup |
hc uninstall |
Uninstall HarnessCode |
hc --version |
Show version info |
hc init --backend claude # Use Claude Code engine
hc start --backend opencode # Use OpenCode engine| Variable | Description |
|---|---|
HARNESSCODE_BACKEND |
Default AI engine (opencode/claude) |
OPENCODE_PATH |
Custom opencode command path |
CLAUDE_PATH |
Custom claude command path |
harnesscode/
├── pyproject.toml # Package config
├── src/harnesscode/
│ ├── cli.py # CLI entry
│ ├── infinite_dev.py # Main loop script
│ ├── installer.py # Init/uninstall module
│ ├── backend.py # AI engine abstraction
│ ├── agents/ # Agent definitions
│ │ ├── orchestrator.md
│ │ ├── initializer.md
│ │ ├── coder.md
│ │ ├── tester.md
│ │ ├── fixer.md
│ │ └── reviewer.md
│ └── utils/ # Utility modules
└── input/ # Input file examples
# Clean agent files and config
hc uninstall
# Uninstall Python package
pip uninstall harnesscodeContributions welcome! See Contributing Guide.
git clone https://github.com/yzddp/harnesscode.git
cd harnesscode
python -m pip install -e .Made with ❤️ by 油炸电灯泡 (yzddp)