build-project¶
Build a project: install dependencies and run tests.
Description¶
The build-project prompt provides instructions for a standard build workflow: sync files, install dependencies, and run tests.
Parameters¶
Parameter |
Type |
Required |
Default |
Description |
|---|---|---|---|---|
|
string |
Yes |
- |
Local directory path to sync |
|
string |
No |
|
Dependency installation command |
|
string |
No |
|
Test execution command |
Generated Instructions¶
When invoked with:
{
"source": "/home/user/myproject",
"install_cmd": "pip install -e '.[dev]'",
"test_cmd": "pytest -v tests/"
}
Returns:
Build and test the project:
1. Sync `/home/user/myproject` to `/app` using `rsync`
2. Import `python:3.11-slim` if needed
3. Install dependencies with `pip install -e '.[dev]'` (use `disposable=false`)
4. Run tests with `pytest -v tests/` on the result image
5. Report test results
Example Usage¶
Standard Python Project¶
{
"prompt": "build-project",
"args": {
"source": "/path/to/project"
}
}
With Custom Commands¶
{
"prompt": "build-project",
"args": {
"source": "/path/to/project",
"install_cmd": "pip install -r requirements.txt",
"test_cmd": "python -m pytest --cov=src tests/"
}
}
Poetry Project¶
{
"prompt": "build-project",
"args": {
"source": "/path/to/project",
"install_cmd": "pip install poetry && poetry install",
"test_cmd": "poetry run pytest"
}
}
Implementation Notes¶
The agent should:
Sync files with
rsync:{ "source": "<source_path>", "destination": "/app", "exclude": ["__pycache__", ".git", ".venv", "node_modules"] }
Check for Python image, import if needed
Install dependencies with
run:{ "command": "<install_cmd>", "image": "tag:python:3.11-slim", "directory_state_id": "<from_rsync>", "cwd": "/app", "disposable": false }
Run tests with
run:{ "command": "<test_cmd>", "image": "<result_image_from_install>", "directory_state_id": "<from_rsync>", "cwd": "/app" }
Report test results (exit code, stdout, stderr)
See Also¶
multi-stage-build - Complex builds with checkpoints
sync-and-run - Simple file sync and execution
install-packages - Just install packages