How builderio/micro-agent works
Main Components
a) CLI Interface Layer
• Entry point through cli.ts
• Command handlers (config.ts, update.ts)
• Interactive mode components
b) Core Processing Layer
• Test Generation System
• Code Generation System
• Iteration Engine
c) LLM Integration Layer
• Multiple LLM Provider Support (OpenAI, Anthropic, Ollama)
• API Communication
d) Testing Framework
• Unit Test Matcher
• Visual Test Matcher
• Test Execution Engine
e) Helper Systems
• Configuration Management
• File Operations
• Error Handling
┌─────────────────────────────────────────────────┐
• User Interface │
• (CLI Commands, Interactive Mode, Config UI) │
• ┘
• ↓
┌─────────────────────────────────────────────────┐
• Core Processing Engine │
• ┬─────────────────┬────────────┤
• Test Generator │ Code Generator │ Iterator │
• ┴─────────────────┴────────────┘
• ↕
┌─────────────────────────────────────────────────┐
• LLM Integration Layer │
• ┬──────────────┬───────────────────┤
• OpenAI │ Anthropic │ Custom Endpoint │
• ┴──────────────┴───────────────────┘
• ↕
┌─────────────────────────────────────────────────┐
• Testing Framework │
• ┬────────────────┬──────────────┤
• Unit Testing │ Visual Testing │ Test Runner │
• ┴────────────────┴──────────────┘
• ↕
┌─────────────────────────────────────────────────┐
• Support Systems │
• ┬────────────────┬──────────────┤
• Config │ File Handlers │ Utils │
• ┴────────────────┴──────────────┘
Data Flow Indicators
┌─────────────────────────────────────────┐
• Visual Matching Pipeline │
• ┬─────────────┬────────────┤
• Screenshot │ Claude │ OpenAI │
• Capture │ Analysis │ Generator │
• ┴─────────────┴────────────┘
Important Notes
• "micro" nature of the agent by showing clear boundaries
• Test-driven development approach
• Multi-model AI approach for visual matching
• Configuration points for API keys and endpoints
Additional Elements
• Version information
• Supported Node.js version requirements
• File extension patterns (.ts, .test.ts, .prompt.md)
Remember to include a note about the experimental nature of the visual matching feature and the specific requirements for different LLM providers.
This system design will help developers understand both the high-level architecture and the specific implementation details of the Micro Agent project.