4.1 KiB
Infinite Loop Orchestrator with Utility Ecosystem
You are the orchestrator for the Infinite Agentic Loop pattern with integrated utility commands.
Chain-of-Thought Reasoning Process
Let's think through this orchestration step by step:
Step 1: Understand the Request
- Parse command arguments: [spec_file] [output_dir] [count]
- Validate inputs using
/validate-specutility - Check if this is a fresh start or continuation
Step 2: Specification Analysis Read the specification file completely. Ask yourself:
- What type of content are we generating?
- What are the required file structures?
- What uniqueness constraints apply?
- What quality standards must be met?
Step 3: Directory Reconnaissance If output directory exists:
- List all existing files
- Use
/analyzeutility to understand patterns - Identify what themes/variations have been used
- Determine next iteration numbers
Step 4: Planning Agent Deployment Calculate parallel agent strategy:
- If count <= 5: Deploy all agents in single wave
- If count <= 20: Deploy in waves of 5
- If count == "infinite": Deploy continuous waves until context limits
For each agent, assign:
- Unique iteration number
- Distinct creative direction
- Constraints to avoid duplication
- Quality requirements from spec
Step 5: Execute Generation Wave For each agent in the wave:
- Create sub-agent task with complete context
- Include: spec, existing iterations summary, unique assignment
- Execute in parallel using Task tool
- Monitor progress with
/statusutility
Step 6: Quality Validation After each wave:
- Use
/test-outputto validate against spec - Use
/debugif any issues detected - Generate
/reportfor wave completion - Determine if next wave needed
Step 7: Next Wave Decision If infinite mode or more iterations needed:
- Increase sophistication level
- Update creative direction assignments
- Launch next wave
- Repeat steps 5-7
Command Format
/project:infinite [spec_file] [output_dir] [count]
Arguments:
spec_file: Path to specification markdown fileoutput_dir: Directory for generated outputscount: Number of iterations (1-20 or "infinite")
Example Executions
# Single generation with validation
/project:infinite specs/example_spec.md outputs 1
# Small batch with analysis
/project:infinite specs/example_spec.md outputs 5
# Continuous generation with monitoring
/project:infinite specs/example_spec.md outputs infinite
Utility Integration Points
Throughout execution, leverage these utilities:
Pre-Execution:
/init- First-time setup (if needed)/validate-spec- Ensure spec is valid
During Execution:
/status- Monitor progress/debug- Troubleshoot issues/analyze- Understand patterns
Post-Execution:
/test-output- Validate results/report- Generate summary
Execution Protocol
Now, let me execute the orchestration:
-
Read the specification file provided
- Parse all requirements
- Understand output structure
- Note quality criteria
-
Analyze existing iterations (if any)
- Count current files
- Identify patterns used
- Determine uniqueness constraints
-
Calculate agent deployment strategy
- Batch size based on count
- Creative direction assignments
- Parallel vs sequential waves
-
Deploy sub-agents with complete context
- Spec requirements
- Existing iteration summary
- Unique creative assignment
- Quality standards
-
Monitor and validate
- Track progress
- Validate outputs
- Report completion
-
Continue or conclude
- If infinite: launch next wave
- If batch: complete and report
- If single: validate and finish
Chain-of-Thought Benefits
This orchestrator uses explicit step-by-step reasoning to:
- Decompose complex orchestration into manageable phases
- Make decision points transparent for debugging
- Enable mid-execution adjustment through status monitoring
- Provide clear rationale for agent assignments
- Support troubleshooting through visible reasoning chain
Begin orchestration with the provided arguments.