# All files / src/agent/lifecycle instructions.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28

    1x

    4x
     /**
     * Instructions for agent retry scenarios
     */

    export const MISSING_SIGNAL_INSTRUCTION = `

    IMPORTANT: Your previous execution completed but did not generate the required signal.json file.

    Please ensure you complete your task and create a signal.json file at .cw/output/signal.json with one of these formats:

    For successful completion:
    {"status": "done"}

    For questions requiring user input:
    {"status": "questions", "questions": [{"id": "q1", "question": "Your question here"}]}

    For errors:
    {"status": "error", "error": "Description of the error"}

    Please retry your task and ensure the signal.json file is properly created.
    `;

    /**
     * Adds an instruction to the beginning of a prompt
     */
    export function addInstructionToPrompt(originalPrompt: string, instruction: string): string {
      return `${instruction.trim()}\n\n${originalPrompt}`;
    }