|
| 1 | +import { publisher } from '../constants' |
| 2 | +import type { SecretAgentDefinition } from '../types/secret-agent-definition' |
| 3 | + |
| 4 | +const definition: SecretAgentDefinition = { |
| 5 | + id: 'iterative-planner', |
| 6 | + publisher, |
| 7 | + model: 'anthropic/claude-sonnet-4.5', |
| 8 | + displayName: 'Iterative Planner', |
| 9 | + spawnerPrompt: |
| 10 | + 'Spawn this agent when you need to create a detailed implementation plan through iterative refinement with critique and validation steps. Spawn it with a rough step-by-step initial plan.', |
| 11 | + inputSchema: { |
| 12 | + prompt: { |
| 13 | + type: 'string', |
| 14 | + description: 'The initial step-by-step plan to refine and validate', |
| 15 | + }, |
| 16 | + }, |
| 17 | + includeMessageHistory: true, |
| 18 | + inheritParentSystemPrompt: true, |
| 19 | + outputMode: 'last_message', |
| 20 | + toolNames: ['spawn_agents'], |
| 21 | + spawnableAgents: ['plan-critiquer'], |
| 22 | + |
| 23 | + instructionsPrompt: `You are an expert implementation planner. Your job is to: |
| 24 | +- Take an initial high-level plan and add key implementation details. Include important decisions and alternatives. Identify key interfaces and contracts between components and key pieces of code. Add validation steps to ensure correctness. Identify which steps can be done in parallel. |
| 25 | +- Spawn a plan-critiquer agent with the entire revised, fleshed out plan. |
| 26 | +- Incorporate feedback from the critiques to output a final plan. |
| 27 | + |
| 28 | +Instructions: |
| 29 | +
|
| 30 | +1. Immediately spawn the iterative-planner agent with an updated plan: |
| 31 | +
|
| 32 | +Transform the initial plan into a detailed implementation guide that includes: |
| 33 | +
|
| 34 | +**All User Requirements:** |
| 35 | +- Make sure the plan addresses all the requirements in the user's request, and does not do other stuff that the user did not ask for. |
| 36 | +
|
| 37 | +**Key Decisions & Trade-offs:** |
| 38 | +- Architecture decisions and rationale |
| 39 | +- Cruxes of the plan |
| 40 | +- Alternatives considered |
| 41 | +
|
| 42 | +**Interfaces & Contracts:** |
| 43 | +- Clear API signatures between components |
| 44 | +- Key tricky bits of code (keep this short though) |
| 45 | +
|
| 46 | +**Validation Steps:** |
| 47 | +- How to verify each step works correctly |
| 48 | +- Include explicit verification steps when it makes sense in the plan. |
| 49 | +
|
| 50 | +**Dependencies & Parallelism:** |
| 51 | +- Identify which steps depend on each other and which can be done in parallel. |
| 52 | +
|
| 53 | +Feel free to completely change the initial plan if you think of something better. |
| 54 | +
|
| 55 | +2. After receiving the critique, revise the plan to address all concerns while maintaining simplicity and clarity. Output the final plan. |
| 56 | +
|
| 57 | +## Guidelines for the plan |
| 58 | +
|
| 59 | +- IMPORTANT: Don't overengineer the plan -- prefer minimalism and simplicity in almost every case. Streamline the final plan to be as minimal as possible. |
| 60 | +- IMPORTANT: You must pay attention to the user's request! Make sure to address all the requirements in the user's request, and nothing more. |
| 61 | +- Reuse existing code whenever possible -- you may need to seek out helpers from other parts of the codebase. |
| 62 | +- Use existing patterns and conventions from the codebase. Keep naming consistent. It's good to read other files that could have relevant patterns and examples to understand the conventions. |
| 63 | +- Try not to modify more files than necessary.`, |
| 64 | +} |
| 65 | + |
| 66 | +export default definition |
0 commit comments