-
Notifications
You must be signed in to change notification settings - Fork 3
Agent Framework
The Agent Framework provides specialized AI agents that work together to handle complex development tasks through orchestration and delegation.
A system of specialized AI agents, each with specific expertise:
- Orchestrator - Coordinates complex tasks and delegates to specialists
- Coder - Implements code with test-first approach
- Reviewer - Reviews code for quality, security, and best practices
- Writer - Creates documentation and technical writing
- π― Specialization - Each agent is expert in their domain
- π Coordination - Orchestrator breaks down and delegates tasks
- β Quality Assurance - Built-in review and validation
- π Documentation - Automatic documentation generation
- π§ Context-Aware - Agents use knowledge base and codebase search
- β‘ Efficient - Right agent for the right task
# Use default agent (coder)
npx @sylphx/flow run "implement user authentication"
# Specify agent explicitly
npx @sylphx/flow run "review this code" --agent reviewer
npx @sylphx/flow run "write API documentation" --agent writer
npx @sylphx/flow run "implement OAuth with tests" --agent orchestrator# Orchestrator - Complex multi-step tasks
flow run "build complete authentication system" --agent orchestrator
# Coder - Implementation tasks
flow run "add password reset functionality" --agent coder
# Reviewer - Code review tasks
flow run "review for security vulnerabilities" --agent reviewer
# Writer - Documentation tasks
flow run "document the API endpoints" --agent writerRole: Task coordination and agent delegation
Specialization:
- Breaking down complex tasks into subtasks
- Identifying dependencies and sequencing
- Delegating to specialist agents
- Synthesizing results into coherent response
Core Rules:
- Never Do Work: Delegate all concrete work to specialists
- Decompose Complex Tasks: Break into clear subtasks
- Synthesize Results: Combine agent outputs coherently
When to Use:
- Complex features requiring multiple specialists
- Tasks involving code + tests + documentation
- Workflows with multiple steps and dependencies
- Coordinating between different concerns
Example Workflow:
User: "Implement OAuth authentication"
β
Orchestrator:
1. Delegate to Coder: "Implement OAuth flow"
2. Delegate to Reviewer: "Review security"
3. Delegate to Writer: "Document OAuth setup"
β
Orchestrator synthesizes all results
β
Complete OAuth implementation with tests and docs
Usage:
flow run "implement complete user management system" --agent orchestrator
flow run "refactor authentication with tests and docs" --agent orchestrator
flow run "build payment integration end-to-end" --agent orchestratorRole: Code implementation and execution
Specialization:
- Writing production-quality code
- Test-driven development
- Immediate refactoring
- Security-conscious implementation
Core Rules:
- Verify Always: Run tests after every change
- Search Before Build: Research before implementing
- Complete Now: No TODOs, finish fully
Execution Modes:
- Investigation: Understand problem and constraints
- Design: Plan architecture and integration
- Implementation: Write tests, implement, refactor
- Validation: Verify security and performance
When to Use:
- Implementing new features
- Writing or modifying code
- Bug fixes
- Refactoring
Usage:
flow run "add email verification to registration" --agent coder
flow run "implement caching for API responses" --agent coder
flow run "fix the authentication bug" --agent coderRole: Code review and quality assurance
Specialization:
- Security analysis
- Performance review
- Best practices validation
- Architecture assessment
Review Focus:
- Security: Vulnerabilities, input validation, auth issues
- Performance: Bottlenecks, optimization opportunities
- Quality: Code structure, maintainability, testing
- Standards: Following team conventions and best practices
When to Use:
- Reviewing pull requests
- Security audits
- Performance analysis
- Code quality checks
Usage:
flow run "review this PR for security issues" --agent reviewer
flow run "analyze performance bottlenecks" --agent reviewer
flow run "check code quality and best practices" --agent reviewerRole: Documentation and technical writing
Specialization:
- API documentation
- README files
- Technical guides
- Code comments
Writing Focus:
- Clarity: Easy to understand
- Completeness: All necessary information
- Examples: Practical code examples
- Structure: Well-organized content
When to Use:
- Creating documentation
- Writing guides
- Documenting APIs
- Updating README files
Usage:
flow run "document the REST API endpoints" --agent writer
flow run "write a guide for new contributors" --agent writer
flow run "create README for this package" --agent writerUser Request
β
Single Agent (e.g., Coder)
β
Result
Example:
flow run "add input validation" --agent coderUser Request
β
Orchestrator
β
βββ Coder: Implement
βββ Reviewer: Review
βββ Writer: Document
β
Orchestrator synthesizes
β
Complete Result
Example:
flow run "implement user authentication system" --agent orchestratorUser Request
β
Coder: Initial implementation
β
Reviewer: Finds issues
β
Coder: Fixes issues
β
Writer: Documents
β
Final Result
Example:
flow run "build payment gateway with security review" --agent orchestratorScenario: Implement complete user registration
flow run "implement user registration with validation" --agent orchestratorAgent Workflow:
- Orchestrator analyzes requirements
- Coder implements registration logic
- Reviewer checks security
- Coder fixes any issues
- Writer documents the API
- Orchestrator delivers complete feature
Scenario: Review pull request for security
flow run "review PR #123 for security vulnerabilities" --agent reviewerReviewer Actions:
- Analyzes code for common vulnerabilities
- Checks input validation
- Reviews authentication/authorization
- Examines error handling
- Provides detailed report
Scenario: Document API endpoints
flow run "document all user management endpoints" --agent writerWriter Actions:
- Analyzes API endpoints
- Generates OpenAPI/Swagger docs
- Creates usage examples
- Writes integration guide
Scenario: Refactor authentication system
flow run "refactor auth system for better security" --agent orchestratorAgent Workflow:
- Coder searches existing implementation
- Coder refactors with improvements
- Reviewer validates security
- Writer updates documentation
- Orchestrator ensures everything works
All agents automatically use knowledge base:
// Agent internally calls before implementation
knowledge_search("authentication best practices")
knowledge_get("/universal/security")Benefits:
- Follow established patterns
- Apply best practices
- Maintain consistency
- Learn from curated guidelines
Agents search existing code before implementing:
// Agent internally searches codebase
codebase_search("existing authentication implementation")
codebase_search("similar validation logic")Benefits:
- Follow existing patterns
- Maintain consistency
- Avoid duplicating code
- Learn from existing implementation
User Request
β
Agent searches:
1. knowledge_search("best practices")
2. codebase_search("existing patterns")
β
Agent implements with:
- Best practices from knowledge base
- Patterns from existing codebase
- Specialist expertise
β
High-quality result
assets/agents/
βββ orchestrator.md # Orchestrator rules
βββ coder.md # Coder rules
βββ reviewer.md # Reviewer rules
βββ writer.md # Writer rules
Each agent has:
- Name: Identifier for selection
- Description: What the agent does
- Mode: When agent can be used (primary/both)
- Temperature: Creativity level (0.3 for deterministic)
- Instructions: Detailed rules and guidelines
# Initialize project with agents
flow init
# Agents are copied to:
# - .claude/agents/ (for Claude Code)
# - .kilocode/agents/ (for Kilocode)- β Task requires multiple specialists
- β Complex workflow with dependencies
- β Need code + tests + documentation
- β Coordinating different concerns
- β Implementing features
- β Writing or modifying code
- β Bug fixes
- β Refactoring code
- β Reviewing pull requests
- β Security audits
- β Performance analysis
- β Quality checks
- β Creating documentation
- β Writing guides
- β API documentation
- β README files
# Step 1: Implement
flow run "implement authentication" --agent coder
# Step 2: Review
flow run "review authentication implementation" --agent reviewer
# Step 3: Document
flow run "document authentication API" --agent writerAgents automatically use MCP tools when available:
-
knowledge_search- Search guidelines -
knowledge_get- Get specific docs -
codebase_search- Search code -
time_*- Time utilities
# Detailed instructions
flow run "implement OAuth 2.0 with PKCE flow, include tests and error handling" --agent coder
# Context-specific
flow run "review for OWASP Top 10 vulnerabilities" --agent reviewer
# Format-specific
flow run "create OpenAPI 3.0 specification" --agent writer- Implementation Speed: Fast for simple tasks, methodical for complex
- Quality: High (test-first, immediate refactoring)
- Best For: Feature implementation, bug fixes
- Review Speed: Thorough and systematic
- Quality: Comprehensive analysis
- Best For: Security, performance, quality checks
- Writing Speed: Fast and clear
- Quality: Professional documentation
- Best For: Documentation, guides, API specs
- Coordination: Excellent task breakdown
- Quality: Synthesized from specialists
- Best For: Complex multi-agent tasks
# Check agents are installed
ls .claude/agents/
# Reinstall agents
flow init --skip-hooks --skip-mcp# Explicitly specify agent
flow run "your task" --agent orchestrator
# Check agent description
cat .claude/agents/orchestrator.md# Verify MCP server is running
flow mcp start
# Check tools are enabled
flow knowledge status
flow codebase status- Be specific in your requests
- Provide context and constraints
- Use orchestrator for complex tasks
- Let agents search before implementing
- Trust agent expertise
# β
Good: Specific and clear
flow run "add JWT authentication with refresh tokens" --agent coder
# β Poor: Too vague
flow run "fix auth" --agent coder
# β
Good: Clear requirements
flow run "review for SQL injection and XSS vulnerabilities" --agent reviewer
# β Poor: Unclear goal
flow run "check code" --agent reviewer- Use for features requiring multiple steps
- Let orchestrator decide which specialists to use
- Provide complete requirements upfront
- Review synthesized results
- Knowledge Base - Guidelines agents use
- Codebase Search - How agents search code
- CLI Commands - Complete command reference
- MCP Integration - Connect AI tools
Last Updated: 2025-10-30 | Edit this page | Report Issues