Agent Reference - micgo/maf-standalone GitHub Wiki

Agent Reference

This page provides detailed documentation for each specialized agent in the Multi-Agent Framework.

Table of Contents

Agent Overview

Each agent in MAF is designed with specific expertise and responsibilities:

Agent Primary Role Key Capabilities
Orchestrator Task coordination Planning, assignment, monitoring
Frontend UI development Components, styling, interactions
Backend API development Business logic, endpoints, auth
Database Data management Schema design, queries, migrations
QA Quality assurance Testing, code review, standards
Security Security audit Vulnerability scanning, best practices
DevOps Infrastructure CI/CD, deployment, monitoring
Documentation Technical writing API docs, guides, comments
UX/UI Design Mockups, user flows, accessibility

Orchestrator Agent

Purpose

The Orchestrator is the central coordinator that breaks down high-level requests into specific tasks and manages the overall workflow.

Capabilities

  • Task Decomposition: Breaks features into manageable subtasks
  • Dependency Management: Ensures tasks are completed in order
  • Agent Assignment: Routes tasks to appropriate specialists
  • Progress Monitoring: Tracks task status and completion
  • Failure Recovery: Handles retries and fallback strategies

Example Task Flow

User Request: "Add user authentication"
Orchestrator Actions:
  1. Create database schema task → Database Agent
  2. Create API endpoints task → Backend Agent  
  3. Create login UI task → Frontend Agent
  4. Create auth tests task → QA Agent
  5. Security review task → Security Agent

Configuration

{
  "orchestrator": {
    "model_provider": "anthropic",
    "model_name": "claude-3-sonnet-20240229",
    "max_retries": 3,
    "task_timeout": 300
  }
}

Frontend Agent

Purpose

Specializes in building user interfaces, handling user interactions, and implementing responsive designs.

Capabilities

  • Component Development: Creates reusable UI components
  • State Management: Implements client-side state logic
  • Styling: Applies CSS/styling frameworks
  • Responsive Design: Ensures mobile compatibility
  • Framework Expertise: React, Vue, Angular, Svelte

Supported Technologies

  • React/Next.js: Hooks, SSR/SSG, App Router
  • Vue/Nuxt: Composition API, Vuex, layouts
  • Angular: Services, directives, RxJS
  • CSS: Tailwind, Styled Components, SASS

Example Output

// User Profile Component
export default function UserProfile({ user }) {
  const [isEditing, setIsEditing] = useState(false);
  
  return (
    <div className="user-profile">
      <Avatar src={user.avatar} />
      <h2>{user.name}</h2>
      {isEditing ? (
        <ProfileEditor user={user} onSave={handleSave} />
      ) : (
        <ProfileDisplay user={user} onEdit={() => setIsEditing(true)} />
      )}
    </div>
  );
}

Backend Agent

Purpose

Develops server-side logic, APIs, and handles data processing and business rules.

Capabilities

  • API Development: RESTful and GraphQL endpoints
  • Authentication: JWT, OAuth, session management
  • Data Validation: Input sanitization and validation
  • Business Logic: Complex calculations and workflows
  • Integration: Third-party APIs and services

Supported Technologies

  • Python: Django, FastAPI, Flask
  • JavaScript: Express, NestJS, Hono
  • Java: Spring Boot
  • Ruby: Rails

Example Output

# FastAPI endpoint
@router.post("/users/", response_model=UserResponse)
async def create_user(
    user: UserCreate,
    db: AsyncSession = Depends(get_db),
    current_user: User = Depends(get_current_user)
):
    """Create a new user with proper validation and permissions."""
    if not current_user.is_admin:
        raise HTTPException(status_code=403, detail="Admin access required")
    
    db_user = await crud.create_user(db, user)
    await send_welcome_email(db_user.email)
    return db_user

Database Agent

Purpose

Manages data persistence, schema design, and query optimization.

Capabilities

  • Schema Design: Creates efficient database structures
  • Migrations: Handles schema versioning and updates
  • Query Optimization: Writes performant queries
  • Indexing: Implements appropriate indexes
  • Data Modeling: Designs relationships and constraints

Supported Databases

  • Relational: PostgreSQL, MySQL, SQLite
  • NoSQL: MongoDB, Redis, DynamoDB
  • ORMs: SQLAlchemy, Prisma, TypeORM

Example Output

-- User authentication schema
CREATE TABLE users (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    email VARCHAR(255) UNIQUE NOT NULL,
    password_hash VARCHAR(255) NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
    updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE TABLE sessions (
    id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
    user_id UUID REFERENCES users(id) ON DELETE CASCADE,
    token VARCHAR(255) UNIQUE NOT NULL,
    expires_at TIMESTAMP NOT NULL,
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

CREATE INDEX idx_sessions_token ON sessions(token);
CREATE INDEX idx_sessions_user_id ON sessions(user_id);

QA Agent

Purpose

Ensures code quality through testing, reviews, and adherence to standards.

Capabilities

  • Test Creation: Unit, integration, and e2e tests
  • Code Review: Identifies issues and improvements
  • Coverage Analysis: Ensures adequate test coverage
  • Performance Testing: Load and stress testing
  • Standards Enforcement: Linting and formatting

Testing Frameworks

  • JavaScript: Jest, Vitest, Cypress, Playwright
  • Python: pytest, unittest, Selenium
  • Java: JUnit, TestNG, Mockito

Example Output

# Test for user creation endpoint
@pytest.mark.asyncio
async def test_create_user_success(client, admin_token):
    """Test successful user creation by admin."""
    response = await client.post(
        "/api/users/",
        json={
            "email": "[email protected]",
            "password": "SecurePass123!",
            "name": "Test User"
        },
        headers={"Authorization": f"Bearer {admin_token}"}
    )
    
    assert response.status_code == 201
    data = response.json()
    assert data["email"] == "[email protected]"
    assert "id" in data
    assert "password" not in data  # Ensure password not exposed

Security Agent

Purpose

Audits code for vulnerabilities and implements security best practices.

Capabilities

  • Vulnerability Scanning: Identifies security issues
  • Authentication Review: Ensures proper auth implementation
  • Data Protection: Encryption and secure storage
  • Input Validation: Prevents injection attacks
  • Dependency Audit: Checks for vulnerable packages
  • OWASP Best Practices: Implements security standards
  • Security Report Generation: Creates detailed audit reports

Security Checks

  • SQL injection prevention
  • XSS protection
  • CSRF tokens
  • Rate limiting
  • Secure headers
  • Password policies
  • Command injection prevention
  • Path traversal protection

File Types

  • .md for security audit reports
  • .ts/.js for security implementations
  • Middleware and authentication files

Example Tasks

  • "Review authentication implementation for security vulnerabilities"
  • "Implement secure session management with JWT"
  • "Audit API endpoints for injection vulnerabilities"
  • "Add rate limiting to prevent brute force attacks"
  • "Create security audit report for the application"

Example Recommendations

# Security improvements for user authentication
def secure_login(email: str, password: str) -> Optional[User]:
    """Secure login with rate limiting and audit logging."""
    # Rate limiting
    if not rate_limiter.check_rate(email):
        audit_log.warning(f"Rate limit exceeded for {email}")
        raise HTTPException(status_code=429, detail="Too many attempts")
    
    # Timing-safe password comparison
    user = get_user_by_email(email)
    if not user or not verify_password_safe(password, user.password_hash):
        audit_log.info(f"Failed login attempt for {email}")
        # Generic error to prevent user enumeration
        raise HTTPException(status_code=401, detail="Invalid credentials")
    
    audit_log.info(f"Successful login for {user.id}")
    return user

DevOps Agent

Purpose

Handles deployment configurations, CI/CD pipelines, containerization, and infrastructure.

Capabilities

  • Docker/Dockerfile Generation: Multi-stage builds with security scanning
  • CI/CD Pipelines: GitHub Actions, GitLab CI, CircleCI workflows
  • Kubernetes Manifests: Deployment, service, and scaling configs
  • Cloud Deployment: Vercel, Netlify, AWS configurations
  • Infrastructure as Code: Terraform scripts
  • Monitoring Setup: Prometheus, logging configurations

Supported Technologies

  • Containerization: Docker, Docker Compose
  • Orchestration: Kubernetes, Helm
  • CI/CD: GitHub Actions, GitLab CI, CircleCI
  • Cloud Platforms: AWS, GCP, Azure, Vercel, Netlify
  • IaC: Terraform, CloudFormation

File Types

  • Dockerfile, docker-compose.yml
  • .github/workflows/*.yml
  • k8s/*.yaml
  • vercel.json, netlify.toml
  • *.tf for Terraform

Example Tasks

  • "Create a Dockerfile for a Python Flask application"
  • "Set up GitHub Actions workflow for CI/CD"
  • "Create Kubernetes deployment configuration"
  • "Configure Vercel deployment for Next.js app"
  • "Set up Docker compose for local development"

Example Output

# GitHub Actions workflow
name: Deploy to Production

on:
  push:
    branches: [main]

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - name: Run tests
        run: |
          npm install
          npm test
          
  deploy:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - name: Deploy to AWS
        env:
          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
        run: |
          aws s3 sync ./build s3://${{ secrets.S3_BUCKET }}
          aws cloudfront create-invalidation --distribution-id ${{ secrets.CF_DIST_ID }} --paths "/*"

Documentation Agent

Purpose

Generates and maintains project documentation.

Capabilities

  • API Documentation: OpenAPI/Swagger specs, endpoint descriptions
  • README Generation: Comprehensive project documentation
  • Component Documentation: Props, methods, usage examples
  • Architecture Diagrams: System design with mermaid syntax
  • User Guides: Tutorials and how-to guides
  • Code Documentation: JSDoc, docstrings, inline comments

Documentation Types

  • API: REST/GraphQL endpoint documentation
  • Component: UI component usage and props
  • Architecture: System design and data flow
  • Guides: User and developer tutorials
  • README: Project overview and setup

File Types

  • .md for markdown documentation
  • .yaml for OpenAPI specifications
  • README.md for project docs
  • Component-specific docs in docs/ folders

Example Tasks

  • "Create API documentation for user authentication endpoints"
  • "Generate README for the project with setup instructions"
  • "Document the UserProfile component with props and examples"
  • "Create architecture documentation with system diagrams"
  • "Write a user guide for the admin dashboard"

Example Output

## User Authentication API

### POST /api/auth/login

Authenticates a user and returns a JWT token.

#### Request Body
```json
{
  "email": "[email protected]",
  "password": "securepassword"
}

Response

{
  "token": "eyJhbGciOiJIUzI1NiIs...",
  "user": {
    "id": "123",
    "email": "[email protected]",
    "name": "John Doe"
  }
}

Error Responses

  • 401: Invalid credentials
  • 429: Too many login attempts

## UX/UI Agent

### Purpose
Handles design systems, UI components, and user experience.

### Capabilities
- **Design System Creation**: Comprehensive color, typography, spacing systems
- **Color Palette Generation**: Semantic colors with light/dark themes
- **Typography Systems**: Font scales, line heights, responsive sizing
- **Component Styling**: Reusable UI component styles
- **Responsive Layouts**: Grid systems, breakpoints, mobile-first
- **Animations**: Transitions, micro-interactions, hover effects
- **Accessibility**: WCAG AA compliance, ARIA labels

### Supported Frameworks
- **CSS**: Vanilla CSS with custom properties
- **SCSS/Sass**: Advanced styling with mixins
- **Tailwind CSS**: Utility-first configurations
- **CSS-in-JS**: Styled-components, Emotion
- **Design Tokens**: JSON format for design systems

### Design Areas
- **Color Systems**: Primary, secondary, semantic colors
- **Typography**: Font families, sizes, weights
- **Spacing**: Consistent padding/margin systems
- **Components**: Buttons, cards, forms, modals
- **Layout**: Grid, flexbox, containers
- **Animations**: Smooth transitions, loading states

### File Types
- `.css`, `.scss` for stylesheets
- `.js` for CSS-in-JS
- `.json` for design tokens
- Style files in `styles/` directory

### Example Tasks
- "Create a design system color palette for a professional web app"
- "Build a responsive navigation component with mobile menu"
- "Implement dark mode theme with CSS variables"
- "Create a consistent spacing system using rem units"
- "Design an accessible form component with proper labels"

### Example Recommendations
```css
/* Design tokens for consistent styling */
:root {
  /* Colors */
  --primary-color: #3B82F6;
  --primary-hover: #2563EB;
  --text-primary: #1F2937;
  --text-secondary: #6B7280;
  --background: #FFFFFF;
  --surface: #F9FAFB;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 1.5rem;
  --spacing-lg: 2rem;
  
  /* Typography */
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: var(--font-body);
}

/* Accessible button component */
.btn {
  padding: var(--spacing-xs) var(--spacing-md);
  font-family: var(--font-body);
  font-size: 1rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
  cursor: pointer;
  
  /* Accessibility */
  min-height: 44px; /* Touch target size */
  position: relative;
  overflow: hidden;
}

.btn:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

Agent Configuration

Global Configuration

{
  "agent_config": {
    "default_model_provider": "gemini",
    "default_model_name": "gemini-2.0-flash-exp",
    "enabled_agents": [
      "orchestrator",
      "frontend_agent",
      "backend_agent",
      "db_agent",
      "qa_agent"
    ]
  }
}

Per-Agent Configuration

{
  "agent_models": {
    "orchestrator": {
      "provider": "anthropic",
      "name": "claude-3-sonnet-20240229",
      "temperature": 0.3
    },
    "frontend_agent": {
      "provider": "openai",
      "name": "gpt-4-turbo-preview",
      "temperature": 0.7
    },
    "qa_agent": {
      "provider": "gemini",
      "name": "gemini-2.0-flash-exp",
      "temperature": 0.1
    }
  }
}

Agent Selection Strategy

  • Orchestrator: High reasoning capability for planning
  • Frontend/Backend: Balanced creativity and accuracy
  • QA/Security: Low temperature for precise analysis
  • Documentation: Clear, structured output
  • UX/UI: Creative suggestions with constraints

Next Steps

⚠️ **GitHub.com Fallback** ⚠️