Repoburg
Login

Orchestrations

Orchestrations are a powerful feature that allows you to automate complex, multi-step tasks by defining a sequence of prompts in a single script file. Instead of manually guiding the AI through each step, you can write a script, run it, and let Repoburg handle the sequential execution and file modifications.

How Orchestrations Work

When you start an orchestration, the system follows a simple but robust process:

  1. Clone Script: Repoburg creates a temporary copy of your orchestration script (e.g., my-feature.run.rc.md) to track the progress of the current run. This ensures your original script remains untouched.
  2. Process First Chunk: It reads the first "chunk" of text from the temporary script (up to the first $$$$ delimiter).
  3. Send & Apply: This chunk is sent to the LLM as a prompt. The LLM's response is parsed, and the resulting file modifications are automatically applied to your workspace.
  4. Consume Chunk: Once the step is successfully completed, that chunk is removed from the temporary run script.
  5. Repeat: The process repeats with the next chunk until no more chunks are left.
  6. Completion: The orchestration is complete when the temporary run script is empty.

This design makes orchestrations resumable. If a run is stopped or fails, you can simply restart it, and it will pick up from where it left off.

Creating an Orchestration Script

Creating an orchestration script is straightforward.

1. File Naming and Location

  • Orchestration scripts must be placed in the .repoburg/orchestrations/ directory within your project root.
  • The file must have a .rc.md extension (e.g., my-new-feature.rc.md).

2. Script Format

An orchestration script is a standard Markdown file containing one or more prompts (we call them "chunks"), separated by a special delimiter.

The $$$$ Delimiter

  • Use $$$$ on its own line to separate individual prompts.
  • Each chunk of text between the delimiters is treated as a single, sequential step in the orchestration.

Example Script: create-auth-component.rc.md

Here’s an example of a script that creates a new React component and then adds it to an existing page.

Create a new React component file named `AuthButton.tsx` in `src/components/auth`. It should be a simple functional component that renders a button with the text "Login". $$$$ Now, import and render the new `AuthButton` component in the main `HomePage` component located at `src/app/page.tsx`. Place it inside the main `div`.

Running an Orchestration

  1. Navigate to the Orchestrations page from the main dashboard.
  2. You will see a list of all available scripts from your .repoburg/orchestrations/ directory.
  3. Click the Run button next to the script you want to execute.
  4. An Orchestration Status Banner will appear at the top of the screen, showing you the real-time progress, including the current step and any logs.

Guidelines for Writing Effective Scripts

  • Be Specific and Atomic: Each chunk should describe a single, clear, and verifiable task. This makes debugging easier if a step fails.
  • Sequential Logic: Write chunks in the order they should be executed. The orchestration runs them sequentially and depends on the success of the previous step.
  • Assume auto_apply: All actions generated by the LLM for an orchestration step are applied automatically without a review step. Write your prompts with this in mind, making them safe for direct execution.