Loading...
Loading...
Master the Infinite Agentic Loop pattern with Claude Code for parallel AI agent orchestration and iterative content generation
npx skill4agent add aradotso/ai-agent-skills infinite-agentic-loop-claudeSkill by ara.so — AI Agent Skills collection.
git clone https://github.com/disler/infinite-agentic-loop.git
cd infinite-agentic-loopclaude --version.claude/settings.json.claude/commands/infinite.mdclaude/project:infinite <spec_file> <output_dir> <count>spec_filespecs/invent_new_ui_v3.mdoutput_dircount/project:infinite specs/invent_new_ui_v3.md src 1/project:infinite specs/invent_new_ui_v3.md src_new 5/project:infinite specs/invent_new_ui_v3.md src_new 20/project:infinite specs/invent_new_ui_v3.md infinite_src_new/ infinitespecs/# UI Component Specification
## Objective
Generate unique, creative UI components that demonstrate modern design patterns.
## Requirements
- Must be self-contained HTML file
- Include inline CSS and JavaScript
- Responsive design
- Accessibility compliant (ARIA labels)
- No external dependencies
## Constraints
- Each iteration must be visually distinct
- Maximum file size: 50KB
- Must work in all modern browsers
## Creative Directions
- Explore different color palettes
- Experiment with layout patterns
- Try various interaction models
- Incorporate subtle animations{
"allow_file_operations": true,
"allow_shell_commands": true,
"max_tokens": 200000,
"commands_directory": ".claude/commands"
}# Infinite Agentic Loop Command
## Command: /project:infinite
### Implementation Steps:
1. Parse arguments (spec, output_dir, count)
2. Read and analyze specification file
3. Scan output directory for existing iterations
4. Determine next iteration number
5. Deploy sub-agents in parallel
6. Monitor and coordinate generation
7. Validate uniqueness and spec compliance<!-- Generated iteration: ui_component_001.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Interactive Card Component</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Segoe UI', sans-serif;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.card {
background: white;
border-radius: 20px;
padding: 40px;
box-shadow: 0 20px 60px rgba(0,0,0,0.3);
max-width: 400px;
transition: transform 0.3s ease;
}
.card:hover { transform: translateY(-10px); }
</style>
</head>
<body>
<div class="card" role="article" aria-label="Interactive component">
<h1>Iteration 001</h1>
<p>Unique gradient-based card design</p>
</div>
</body>
</html><!-- specs/api_docs_spec.md -->
# API Documentation Generator
## Objective
Generate comprehensive API documentation pages with interactive examples.
## Technical Requirements
- OpenAPI 3.0 schema parsing
- Syntax-highlighted code samples
- Interactive request builder
- Response visualization
## Output Format
Each iteration should produce:
- `api_docs_[number].html` - Main documentation
- Embedded JavaScript for interactivity
- No external API calls (use mock data)#!/bin/bash
# batch_generate.sh - Run multiple infinite loops in sequence
SPECS=(
"specs/ui_components.md"
"specs/data_visualizations.md"
"specs/form_patterns.md"
)
for spec in "${SPECS[@]}"; do
basename=$(basename "$spec" .md)
echo "Generating from $spec..."
claude << EOF
/project:infinite $spec output/${basename}/ 10
EOF
done# Wave 1: Basic components
/project:infinite specs/simple_ui.md wave1/ 5
# Wave 2: Add interactions (reference wave1 in spec)
/project:infinite specs/interactive_ui.md wave2/ 5
# Wave 3: Complex compositions
/project:infinite specs/complex_ui.md wave3/ 5<!-- specs/button_variations.md -->
## Creative Constraints
Each iteration must:
1. Use a different CSS animation
2. Implement unique hover states
3. Explore different shape paradigms (rounded, sharp, organic)
4. Vary color psychology (calm, energetic, professional)# Generate base components
/project:infinite specs/base_components.md components/ 10
# Generate pages using those components (spec references components/)
/project:infinite specs/full_pages.md pages/ 5cd infinite-agentic-loop
claude
# Wait for prompt, then try /project:infinite## Uniqueness Requirements
- Each iteration must use a different primary color family
- Layout grid must vary (2-col, 3-col, masonry, etc.)
- Typography scale must be distinct# Analyze what was generated
ls -lh infinite_src_new/
# Refine spec based on learnings
vim specs/invent_new_ui_v3.md
# Start fresh batch
/project:infinite specs/invent_new_ui_v3.md infinite_src_new_v2/ infinite.claude/settings.json# Validate JSON
cat .claude/settings.json | python -m json.tool
# Check spec file exists and is readable
cat specs/your_spec.mdmkdir -p ~/.claude/commands
cp .claude/commands/infinite.md ~/.claude/commands//infinite.claude/commands/infinite.md## Enhanced Output Structure
For each iteration N, generate:
- component_N.html (main file)
- component_N.test.html (test file)
- component_N.meta.json (metadata)// mcp-server.js
const { MCPServer } = require('@modelcontextprotocol/sdk');
const server = new MCPServer({
name: 'infinite-agentic-loop',
version: '1.0.0'
});
server.addTool({
name: 'infinite_generate',
description: 'Generate iterations using infinite agentic loop',
parameters: {
spec: { type: 'string', description: 'Specification file path' },
output_dir: { type: 'string', description: 'Output directory' },
count: { type: 'number', description: 'Number of iterations' }
},
execute: async ({ spec, output_dir, count }) => {
// Implementation here
}
});
server.start();