Skip to main content
Multi-stage build with rollback points.

Description

The multi-stage-build prompt provides instructions for complex builds with multiple stages, each creating a checkpoint for potential rollback.

Parameters

Generated Instructions

When invoked with:
Returns:

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-installed checkpoint
  • Rollback target: If install fails, fix and retry from base

Stage 3: Build

  • Runs build command with disposable=false
  • Saves result as build-complete checkpoint
  • 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-complete or deps-installed

Implementation Notes

The agent should track checkpoints:
On failure at any stage, report:
  • Which stage failed
  • Available rollback points
  • How to resume

See Also