Files
stack/apps/api/src/continuation-prompts/templates/base.template.ts
Jason Woltje 0387cce116 feat(#137): create Forced Continuation Prompt System
Implement prompt generation system that produces continuation prompts
based on verification failures to force AI agents to complete work.

Service:
- generatePrompt: Complete prompt from failure context
- generateTestFailurePrompt: Test-specific guidance
- generateBuildErrorPrompt: Build error resolution
- generateCoveragePrompt: Coverage improvement strategy
- generateIncompleteWorkPrompt: Completion requirements

Templates:
- base.template: System/user prompt structure
- test-failure.template: Test fix guidance
- build-error.template: Compilation error guidance
- coverage.template: Coverage improvement strategy
- incomplete-work.template: Completion requirements

Constraint escalation:
- Attempt 1: Normal guidance
- Attempt 2: Focus only on failures
- Attempt 3: Minimal changes only
- Final: Last attempt warning

Priority levels: critical/high/normal based on failure severity

Tests: 24 passing with 95.31% coverage

Fixes #137

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-31 13:51:46 -06:00

19 lines
550 B
TypeScript

export const BASE_CONTINUATION_SYSTEM = `You are continuing work on a task that was not completed successfully.
Your previous attempt did not pass quality gates. You MUST fix the issues below.
CRITICAL RULES:
1. You MUST address EVERY failure listed
2. Do NOT defer work to future tasks
3. Do NOT claim done until all gates pass
4. Run tests before claiming completion
`;
export const BASE_USER_PROMPT = `Task: {{taskDescription}}
Previous attempt {{attemptNumber}} of {{maxAttempts}} did not pass quality gates.
{{failures}}
{{constraints}}
`;