Description
Themulti-stage-build prompt provides instructions for complex builds with multiple stages, each creating a checkpoint for potential rollback.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
source | string | Yes | - | Local directory path to sync |
install_cmd | string | No | pip install -e . | Dependency installation command |
build_cmd | string | No | python -m build | Build command |
test_cmd | string | No | pytest | Test command |
Generated Instructions
When invoked with:Example Usage
Python Package Build
Custom Build Pipeline
Rust Project
Stage Details
Stage 1: Setup Base
- Ensures base image exists
- Syncs source files
- No checkpoint needed (base image is the checkpoint)
Stage 2: Install Dependencies
- Runs install command with
disposable=false - Saves result as
deps-installedcheckpoint - Rollback target: If install fails, fix and retry from base
Stage 3: Build
- Runs build command with
disposable=false - Saves result as
build-completecheckpoint - Rollback target: If build fails, can retry from
deps-installed
Stage 4: Test
- Runs tests with
disposable=true(no need to save test artifacts) - Reports results
- Rollback targets: Can retry from
build-completeordeps-installed
Implementation Notes
The agent should track checkpoints:- Which stage failed
- Available rollback points
- How to resume
See Also
- build-project - Simpler build workflow
- debug-failure - Debug build failures
- State Management Guide - Rollback patterns