### Example Agent Usage in ForgeCode.dev (YAML) Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/README.md Illustrates how an agent configuration file is referenced and utilized within the ForgeCode.dev platform. It shows the source of the configuration, the agent ID, the task to be performed, and any necessary parameters. ```yaml # Example usage in ForgeCode.dev agent_config: source: "agent-configs/agents/lovable/config.yaml" agent_id: "lovable" task: "create_react_component" parameters: component_name: "UserProfile" styling: "shadcn" typescript: true ``` -------------------------------- ### Agent Instantiation Example in ForgeCode.dev Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt This YAML snippet demonstrates how to instantiate the 'lovable' agent within the ForgeCode.dev platform. It specifies the agent's configuration source, ID, task, and relevant parameters for creating a React component, such as component name, styling, and state management preferences. ```yaml # Example: Load Lovable agent for React component development agent_config: source: "agent-configs/agents/lovable/config.yaml" agent_id: "lovable" task: "create_react_component" parameters: component_name: "UserProfile" styling: "shadcn" typescript: true responsive: true state_management: "react_query" ``` -------------------------------- ### Validate Agent Configuration Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Bash command to install and use the yaml-language-server for validating YAML syntax and schema compliance of agent configuration files. This is crucial for ensuring configurations are correctly formatted before committing. ```bash # Install YAML validator (if not already installed) npm install -g yaml-language-server ``` -------------------------------- ### Sage Agent Configuration for Codebase Analysis Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt This YAML configuration defines the 'sage' agent, designed for comprehensive code analysis and understanding of a codebase. It specifies system prompts that guide the agent through analysis steps, code breakdown, and answer formulation, emphasizing the use of provided tools and template outputs. ```yaml # agents/sage/config.yaml templates: - repomix-output.xml agents: - id: sage title: Answers questions about the codebase description: |- Provides detailed understanding of the codebase. Always use it to ask high-level questions about codebase when you don't know how to get started. system_prompt: |- You are Forge, an AI assistant specialized in code analysis. Analysis Steps: 1. Carefully analyze the code snippet: - Read through the entire code - Note function and variable names, definitions, usage - Observe file paths and import statements - Look for contextual comments 2. Break down analysis in tags: - List relevant functions, variables, classes with file paths - Quote relevant code snippets or comments - Identify key elements relevant to the question - Consider possible answers with pros and cons - State uncertainties or missing information 3. Formulate answer based on analysis: - Use only information explicitly present in code - Clearly state if answer cannot be determined - Provide exact Symbol names as they appear - Include file paths where Symbols are defined 4. Invoke forge_tool_attempt_completion to submit answer {{> repomix-output.xml}} {{> forge-partial-tool-information.hbs }} Example output: [Detailed breakdown listing relevant parts, quoting important sections, explaining thought process] [Submit answer using forge_tool_attempt_completion] user_prompt: {{event.value}} ``` -------------------------------- ### Platform Integration with Forge Agents (TypeScript) Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Demonstrates how to load agent configurations from YAML files, initialize Forge Agents, and route tasks to the appropriate agent based on task type. It highlights the process of executing tasks with context. ```typescript // Platform integration example (conceptual) import { ForgeAgent, AgentConfig } from '@forgecode/agent-sdk'; import * as yaml from 'yaml'; import * as fs from 'fs'; // Load agent configuration const loadAgentConfig = (agentPath: string): AgentConfig => { const configContent = fs.readFileSync(agentPath, 'utf8'); const config = yaml.parse(configContent); return config.agents[0]; }; // Initialize agents const lovableConfig = loadAgentConfig('agents/lovable/config.yaml'); const sageConfig = loadAgentConfig('agents/sage/config.yaml'); const lovableAgent = new ForgeAgent(lovableConfig); const sageAgent = new ForgeAgent(sageConfig); // Route tasks to appropriate agent const routeTask = (task: Task): ForgeAgent => { if (task.type === 'code_analysis' || task.type === 'codebase_question') { return sageAgent; } if (task.type === 'frontend_development' || task.type === 'react_component') { return lovableAgent; } throw new Error(`No agent available for task type: ${task.type}`); }; // Execute task with agent const executeTask = async (task: Task) => { const agent = routeTask(task); const context = { custom_rules: task.customRules, event: { value: task.description }, templates: await loadTemplates(task.requiredContext) }; const result = await agent.execute(context); return result; }; // Example task execution const frontendTask = { type: 'react_component', description: 'Create a user profile component with form validation', customRules: 'Use TypeScript and shadcn/ui components', requiredContext: ['repository_structure', 'existing_components'] }; const analysisTask = { type: 'codebase_question', description: 'How is authentication implemented in this project?', requiredContext: ['full_repository'] }; // Execute tasks const frontendResult = await executeTask(frontendTask); const analysisResult = await executeTask(analysisTask); ``` -------------------------------- ### Create Agent Directory Structure Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Bash script to set up a new agent directory with a configuration file (config.yaml) and a README.md documentation file. This script is useful for initializing new agent projects within the Forge ecosystem. ```bash # Create agent directory mkdir -p agents/backend-specialist cd agents/backend-specialist # Create configuration file cat > config.yaml << 'EOF' # yaml-language-server: $schema=https://raw.githubusercontent.com/antinomyhq/forge/refs/heads/main/forge.schema.json agents: - id: backend_specialist title: Backend Development Specialist description: |- Expert in backend development, API design, and database optimization. system_prompt: |- You are Forge, specialized in backend development. Core Capabilities: - RESTful and GraphQL API design - Database schema optimization - Authentication and authorization - Performance tuning and caching {{> forge-partial-system-info.hbs }} {{> forge-partial-tool-information.hbs }} user_prompt: {{event.value}} EOF # Create documentation cat > README.md << 'EOF' # Backend Specialist Agent ## Overview Expert AI agent for backend development tasks. ## Key Features - API Design and Implementation - Database Optimization - Security Best Practices - Performance Tuning ## Usage Examples ### API Implementation ```yaml task: "create_rest_api" endpoints: ["GET /users", "POST /users"] authentication: "jwt" database: "postgresql" ``` ## Configuration See `config.yaml` for detailed configuration. EOF # Verify structure ls -la ``` -------------------------------- ### Repository Management API - Agent Directory Structure Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Commands for creating a new agent directory structure with configuration and documentation files. ```APIDOC ## Repository Management API - Agent Directory Structure ### Description Set up a new agent with proper directory structure and configuration files. ### Method Bash Script ### Endpoint N/A (Local Commands) ### Parameters N/A ### Request Example ```bash # Create agent directory mkdir -p agents/backend-specialist cd agents/backend-specialist # Create configuration file cat > config.yaml << 'EOF' # yaml-language-server: $schema=https://raw.githubusercontent.com/antinomyhq/forge/refs/heads/main/forge.schema.json agents: - id: backend_specialist title: Backend Development Specialist description: |- Expert in backend development, API design, and database optimization. system_prompt: |- You are Forge, specialized in backend development. Core Capabilities: - RESTful and GraphQL API design - Database schema optimization - Authentication and authorization - Performance tuning and caching {{> forge-partial-system-info.hbs }} {{> forge-partial-tool-information.hbs }} user_prompt: {{event.value}} EOF # Create documentation cat > README.md << 'EOF' # Backend Specialist Agent ## Overview Expert AI agent for backend development tasks. ## Key Features - API Design and Implementation - Database Optimization - Security Best Practices - Performance Tuning ## Usage Examples ### API Implementation ```yaml task: "create_rest_api" endpoints: ["GET /users", "POST /users"] authentication: "jwt" database: "postgresql" ``` ## Configuration See `config.yaml` for detailed configuration. EOF # Verify structure ls -la ``` ### Response #### Success Response (200) - **Output** (string) - Output of the `ls -la` command showing the created files and directories. #### Response Example ``` // Example output after running the script total 8 drwxr-xr-x 3 user staff 96 Jul 26 10:00 . . .. -rw-r--r-- 1 user staff 546 Jul 26 09:59 config.yaml -rw-r--r-- 1 user staff 244 Jul 26 10:00 README.md ``` ``` -------------------------------- ### Configure External Templates for Agent Context (YAML) Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Illustrates how to configure an agent to reference external template files for richer context. This YAML snippet shows the 'templates' key, listing files like 'repomix-output.xml', 'custom-context.xml', and 'api-documentation.xml', which can then be referenced within the agent's system prompt using Handlebars partial syntax. ```yaml # Agent with external template references templates: - repomix-output.xml # Repository structure and code - custom-context.xml # Custom context data - api-documentation.xml # API reference docs agents: - id: template_aware_agent title: Template-Aware Development Agent system_prompt: |- You have access to comprehensive codebase information: ## Repository Structure {{> repomix-output.xml}} ## Custom Context {{> custom-context.xml}} ## API Documentation {{> api-documentation.xml}} Use this information to provide accurate, context-aware assistance. ``` -------------------------------- ### Creating Agent Configuration File (Bash) Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/README.md Command to create an empty YAML configuration file for a new agent. This file will later be populated with the agent's persona and capabilities. ```bash touch config.yaml ``` -------------------------------- ### Deploy Sage Agent for Codebase Analysis Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Configuration to deploy the Sage agent for analyzing codebase patterns, specifically focusing on database access. It outlines the question, scope of files to analyze, and specific areas of focus within database interactions. ```yaml # Task: Analyze database access patterns agent: sage task_type: "analyze_codebase" analysis_request: question: "What are the database access patterns used throughout the codebase?" scope: - "src/database/**/*.ts" - "src/repositories/**/*.ts" - "src/models/**/*.ts" focus_areas: - connection_pooling - query_optimization - transaction_handling - error_recovery output_format: "detailed_breakdown" expected_response: format: "code_breakdown" sections: - database_connections: files: ["src/database/connection.ts"] patterns: ["singleton", "connection_pooling"] evidence: ["code_snippets", "function_signatures"] - query_patterns: files: ["src/repositories/*.ts"] patterns: ["repository_pattern", "query_builder"] optimizations: ["indexed_queries", "batch_operations"] - transaction_management: files: ["src/database/transaction.ts"] patterns: ["unit_of_work", "rollback_handling"] - recommendations: improvements: ["connection_pooling_config", "query_caching"] security: ["sql_injection_prevention", "input_sanitization"] ``` -------------------------------- ### Handlebars Templating in Agent System Prompts (YAML) Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Demonstrates how to use Handlebars templating within agent system prompts defined in YAML. It showcases the injection of system information, tool details, conditional custom rules, codebase context via templates like 'repomix-output.xml', and user input processing using 'event.value'. ```yaml agents: - id: dynamic_agent title: Dynamic Agent with Templates description: Agent that uses template system for dynamic content system_prompt: |- You are Forge, an AI assistant with context-aware capabilities. # System Information The following system information is automatically injected: {{> forge-partial-system-info.hbs }} # Available Tools The following tools are available to you: {{> forge-partial-tool-information.hbs }} # Custom Rules (Conditional) {{#if custom_rules}} These rules must be followed under any circumstances: {{custom_rules}} {{/if}} # Context Data (When using repomix template) {{#if templates}} {{> repomix-output.xml}} {{/if}} # User Input Processing Process user input with structured tags: {{#if event.value}} {{event.value}} {{/if}} user_prompt: {{event.value}} ``` -------------------------------- ### Sage Agent - Codebase Analysis Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Configuration for deploying the Sage agent to analyze codebase patterns and answer high-level architectural questions. ```APIDOC ## Sage Agent - Codebase Analysis ### Description Deploy Sage agent to analyze complex codebases and answer high-level architectural questions. ### Method N/A (Configuration) ### Endpoint N/A (Configuration) ### Parameters #### Request Body - **agent** (string) - Required - Specifies the agent to use, e.g., "sage". - **task_type** (string) - Required - The type of task, e.g., "analyze_codebase". - **analysis_request** (object) - Required - Configuration for the analysis request. - **question** (string) - Required - The question to ask about the codebase. - **scope** (array of strings) - Required - File paths or glob patterns to include in the analysis. - **focus_areas** (array of strings) - Optional - Specific areas of the codebase to focus on. - **output_format** (string) - Optional - Desired format for the analysis output. ### Request Example ```json { "agent": "sage", "task_type": "analyze_codebase", "analysis_request": { "question": "What are the database access patterns used throughout the codebase?", "scope": [ "src/database/**/*.ts", "src/repositories/**/*.ts", "src/models/**/*.ts" ], "focus_areas": [ "connection_pooling", "query_optimization", "transaction_handling", "error_recovery" ], "output_format": "detailed_breakdown" } } ``` ### Response #### Success Response (200) - **expected_response** (object) - Details about the expected analysis output. - **format** (string) - The format of the response. - **sections** (object) - Breakdown of the analysis results. #### Response Example ```json { "expected_response": { "format": "code_breakdown", "sections": { "database_connections": { "files": ["src/database/connection.ts"], "patterns": ["singleton", "connection_pooling"], "evidence": ["code_snippets", "function_signatures"] }, "query_patterns": { "files": ["src/repositories/*.ts"], "patterns": ["repository_pattern", "query_builder"], "optimizations": ["indexed_queries", "batch_operations"] }, "transaction_management": { "files": ["src/database/transaction.ts"], "patterns": ["unit_of_work", "rollback_handling"] }, "recommendations": { "improvements": ["connection_pooling_config", "query_caching"], "security": ["sql_injection_prevention", "input_sanitization"] } } } } ``` ``` -------------------------------- ### Repository Management API - Validating Agent Configuration Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Instructions for validating agent configuration files using the `yaml-language-server`. ```APIDOC ## Repository Management API - Validating Agent Configuration ### Description Validate YAML syntax and schema compliance before committing agent configurations. ### Method Bash Command ### Endpoint N/A (Local Command) ### Parameters N/A ### Request Example ```bash # Install YAML validator (if not already installed) npm install -g yaml-language-server ``` ### Response #### Success Response (200) - **Output** (string) - Confirmation message indicating successful installation or execution of the validator. #### Response Example ``` // Example output after successful installation `yaml-language-server@x.y.z` ``` ``` -------------------------------- ### Sage Agent: Explain Code Snippet Task Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/agents/sage/README.md This YAML snippet configures the Sage agent to explain a specific code snippet. It includes the task type, the snippet to focus on, and the desired level of detail for the explanation. ```yaml task: "explain_code" snippet: "specific_function_or_class" focus: "functionality_and_usage" ``` -------------------------------- ### Load Sage Agent for Codebase Analysis Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Configuration to load the Sage agent for analyzing a codebase. It specifies the agent configuration source, agent ID, the task to perform (analyze authentication flow), and relevant parameters like the question, context, and focus area. ```yaml agent_config: source: "agent-configs/agents/sage/config.yaml" agent_id: "sage" task: "analyze_authentication_flow" parameters: question: "How does the authentication system handle JWT tokens?" context: "full_repository" focus: "security_patterns" ``` -------------------------------- ### Adding a New Agent Directory (Bash) Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/README.md Command-line instructions to create a new directory for an agent within the 'agents' folder and navigate into it. This is the first step in defining a new agent persona. ```bash mkdir agents/new-agent-name cd agents/new-agent-name ``` -------------------------------- ### Lovable Agent - Feature Implementation Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Configuration for deploying the Lovable agent to implement a complete feature, including UI components, state management, and testing. ```APIDOC ## Lovable Agent - Feature Implementation ### Description Deploy Lovable agent to implement a complete feature with UI components, state management, and testing. ### Method N/A (Configuration) ### Endpoint N/A (Configuration) ### Parameters #### Request Body - **agent** (string) - Required - Specifies the agent to use, e.g., "lovable". - **task_type** (string) - Required - The type of task, e.g., "implement_feature". - **feature_specification** (object) - Required - Detailed specification of the feature to implement. - **name** (string) - Required - The name of the feature. - **components** (array of objects) - Optional - UI and logic components for the feature. - **name** (string) - Required - Name of the component. - **type** (string) - Required - Type of the component (e.g., "form_component", "context_provider"). - **validation** (boolean) - Optional - Whether input validation is required. - **styling** (string) - Optional - Styling framework to use. - **state_management** (string) - Optional - State management approach. - **api_integration** (object) - Optional - Details for integrating with APIs. - **library** (string) - Optional - Library for API calls (e.g., "react_query"). - **endpoints** (array of objects) - Optional - List of API endpoints to integrate. - **method** (string) - Required - HTTP method (e.g., "POST"). - **path** (string) - Required - Endpoint path. - **error_handling** (string) - Optional - Strategy for handling errors. - **security** (array of strings) - Optional - Security measures to implement. - **testing** (array of strings) - Optional - Types of tests to include. ### Request Example ```json { "agent": "lovable", "task_type": "implement_feature", "feature_specification": { "name": "user_authentication", "components": [ { "name": "LoginForm", "type": "form_component", "validation": true, "styling": "shadcn" }, { "name": "SignupForm", "type": "form_component", "validation": true, "styling": "shadcn" }, { "name": "AuthProvider", "type": "context_provider", "state_management": "useContext" } ], "api_integration": { "library": "react_query", "endpoints": [ { "method": "POST", "path": "/api/auth/login", "error_handling": "toast" }, { "method": "POST", "path": "/api/auth/signup", "error_handling": "toast" } ] }, "security": [ "input_validation", "xss_protection", "csrf_tokens" ], "testing": [ "unit_tests", "integration_tests", "responsive_tests" ] } } ``` ### Response #### Success Response (200) - **expected_output** (object) - Details about the expected outcome of the feature implementation. - **files_created** (array of strings) - List of files expected to be created. - **compilation** (string) - Expected compilation status. - **tests** (string) - Expected test status. #### Response Example ```json { "expected_output": { "files_created": [ "src/components/auth/LoginForm.tsx", "src/components/auth/SignupForm.tsx", "src/contexts/AuthContext.tsx", "src/hooks/useAuth.ts", "src/tests/auth/LoginForm.test.tsx" ], "compilation": "success", "tests": "passing" } } ``` ``` -------------------------------- ### Create Custom Agent Configuration (YAML) Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Defines a custom AI agent using the Forge schema. It includes templates, agent ID, title, description, system prompt with expertise and technical stack, and user prompt. Supports Handlebars partials and custom rules for dynamic content. ```yaml # yaml-language-server: $schema=https://raw.githubusercontent.com/antinomyhq/forge/refs/heads/main/forge.schema.json templates: - repomix-output.xml agents: - id: "my_custom_agent" title: "Custom Development Agent" description: |- AI agent specialized in backend development with focus on API design, database optimization, and microservices architecture. system_prompt: |- You are Forge, an AI assistant specialized in backend development. Core Expertise: 1. RESTful API design and implementation 2. Database schema design and optimization 3. Microservices architecture patterns 4. Authentication and authorization systems Technical Stack: - Node.js, Python, Go - PostgreSQL, MongoDB, Redis - Docker, Kubernetes - GraphQL, gRPC {{> forge-partial-system-info.hbs }} {{#if custom_rules}} {{custom_rules}} {{/if}} {{> forge-partial-tool-information.hbs }} When you receive a task, analyze the requirements, propose solutions, and implement changes following best practices for backend development. user_prompt: {{event.value}} ``` -------------------------------- ### Deploy Lovable Agent for Feature Implementation Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Configuration to deploy the Lovable agent for implementing a complete feature, including UI components, state management, and API integration. It details the feature name, components, API endpoints, security measures, and testing requirements. ```yaml # Task: Implement user authentication feature agent: lovable task_type: "implement_feature" feature_specification: name: "user_authentication" components: - name: "LoginForm" type: "form_component" validation: true styling: "shadcn" - name: "SignupForm" type: "form_component" validation: true styling: "shadcn" - name: "AuthProvider" type: "context_provider" state_management: "useContext" api_integration: library: "react_query" endpoints: - method: "POST" path: "/api/auth/login" error_handling: "toast" - method: "POST" path: "/api/auth/signup" error_handling: "toast" security: - input_validation: true - xss_protection: true - csrf_tokens: true testing: - unit_tests: true - integration_tests: true - responsive_tests: true expected_output: files_created: - "src/components/auth/LoginForm.tsx" - "src/components/auth/SignupForm.tsx" - "src/contexts/AuthContext.tsx" - "src/hooks/useAuth.ts" - "src/tests/auth/LoginForm.test.tsx" compilation: "success" tests: "passing" ``` -------------------------------- ### Lovable Agent Configuration for Frontend Development Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt This YAML configuration defines the 'lovable' agent, an AI editor specializing in frontend development using React, TypeScript, and modern UI/UX principles. It outlines system prompts with detailed guidelines on code quality, component creation, state management, and error handling, including placeholders for task analysis and implementation steps. ```yaml agents: - id: lovable title: Frontend Development Specialist description: |- AI editor that creates and modifies web applications with real-time preview capabilities. Specializes in React, TypeScript, and modern frontend technologies with focus on UI/UX excellence. system_prompt: |- You are Forge, an AI editor that creates and modifies web applications. Key Principles: 1. Code Quality and Organization: - Create small, focused components (< 50 lines) - Use TypeScript for type safety - Follow established project structure - Implement responsive designs by default 2. Component Creation: - Create new files for each component - Use shadcn/ui components when possible - Follow atomic design principles 3. State Management: - Use React Query for server state - Implement local state with useState/useContext - Avoid prop drilling 4. Error Handling: - Use toast notifications for user feedback - Implement proper error boundaries - Provide user-friendly error messages Task Approach: Task Understanding: [Analyze requirements] Project Structure: [Review codebase] Required Tools/Technologies: [Identify resources] Proposed Solutions: [Outline approaches] Step 1: [Initial action] Expected Outcome: [Result] Step 2: [Follow-up action] Expected Outcome: [Result] Success Criteria: [Define goals] Step 1: [Action taken] Reason: [Justification] Outcome: [Results] Task Completion Status: [COMPLETED/PARTIALLY COMPLETED/NOT COMPLETED] Task Requirements Verification: - [Requirement]: [Met/Not Met - evidence] Technical Verification: - Compilation Status: [Build outcome] - Test Results: [Test outcomes] {{> forge-partial-system-info.hbs }} {{> forge-partial-tool-information.hbs }} user_prompt: {{event.value}} ``` -------------------------------- ### Multi-Agent Collaboration Workflow (TypeScript) Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Illustrates a pattern for coordinating multiple agents to execute complex, multi-stage workflows. It defines a workflow structure with stages, specifies agent assignments, and demonstrates how to pass results from previous stages as context for subsequent ones. ```typescript // Multi-agent collaboration workflow interface CollaborationWorkflow { stages: WorkflowStage[]; agents: Map; } const createAuthenticationFeatureWorkflow = (): CollaborationWorkflow => { return { agents: new Map([ ['sage', sageAgent], ['lovable', lovableAgent] ]), stages: [ { name: 'Analysis', agent: 'sage', task: { type: 'codebase_question', description: 'Analyze existing authentication patterns and identify integration points', output: 'authentication_analysis' } }, { name: 'Implementation', agent: 'lovable', task: { type: 'frontend_development', description: 'Implement authentication UI components based on analysis', dependencies: ['authentication_analysis'], requirements: [ 'Create LoginForm component', 'Create SignupForm component', 'Implement AuthContext provider', 'Add error handling with toast notifications', 'Write integration tests' ] } }, { name: 'Verification', agent: 'sage', task: { type: 'code_analysis', description: 'Verify implementation follows security best practices and integrates correctly', dependencies: ['implementation_complete'] } } ] }; }; // Execute multi-stage workflow const executeWorkflow = async (workflow: CollaborationWorkflow) => { const results = new Map(); for (const stage of workflow.stages) { console.log(`Executing stage: ${stage.name}`); const agent = workflow.agents.get(stage.agent); if (!agent) throw new Error(`Agent not found: ${stage.agent}`); // Inject previous stage results as context const context = { event: { value: stage.task.description }, previousResults: stage.task.dependencies?.map(dep => results.get(dep)) }; const result = await agent.execute(context); results.set(stage.task.output || stage.name, result); } return results; }; // Execute authentication feature workflow const workflowResults = await executeWorkflow(createAuthenticationFeatureWorkflow()); ``` -------------------------------- ### Agent Configuration Schema (YAML) Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/README.md Defines the structure for agent configurations in YAML format, including system prompts, user prompts, and template usage. This schema is crucial for the Forge platform to instantiate and manage AI agents. ```yaml # yaml-language-server: $schema=https://raw.githubusercontent.com/antinomyhq/forge/refs/heads/main/forge.schema.json templates: - repomix-output.xml agents: - id: "agent_id" title: "Agent Title" description: |- Multi-line description of the agent's purpose and capabilities. system_prompt: |- Detailed system prompt that defines the agent's behavior, capabilities, and interaction patterns. This includes: - Core responsibilities and expertise areas - Technical capabilities and preferences - Communication style and personality - Task approach and methodology - Best practices and guidelines The system prompt uses Handlebars templates for dynamic content: {{> forge-partial-system-info.hbs }} {{> forge-partial-tool-information.hbs }} {{#if custom_rules}} {{custom_rules}} {{/if}} user_prompt: {{event.value}} ``` -------------------------------- ### Commit New Agent with Git and GitHub CLI Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Adds a new agent configuration to the repository using a standard Git workflow. This includes creating a feature branch, staging and committing the new agent files with a descriptive message, and pushing the branch to the remote repository. Finally, it uses the GitHub CLI to create a pull request. ```bash # Create feature branch git checkout -b add-backend-specialist-agent # Add new agent files git add agents/backend-specialist/config.yaml git add agents/backend-specialist/README.md # Commit with descriptive message git commit -m "Add Backend Specialist agent for API and database development - Specialized in RESTful and GraphQL API design - Database schema optimization and query tuning - Authentication and authorization patterns - Performance optimization and caching strategies - Comprehensive error handling and logging" # Push to remote git push origin add-backend-specialist-agent # Create pull request using GitHub CLI gh pr create \ --title "Add Backend Specialist Agent" \ --body "## Summary New agent specialized in backend development tasks: - API design and implementation (REST, GraphQL) - Database optimization (PostgreSQL, MongoDB, Redis) - Authentication and security best practices - Performance tuning and caching ## Configuration - Agent ID: backend_specialist - Templates: Standard Forge templates - System prompt: Comprehensive backend development guidelines ## Testing - [x] YAML validation passes - [x] Schema compliance verified - [x] Documentation complete - [x] Example usage documented" \ --base main \ --head add-backend-specialist-agent ``` -------------------------------- ### Sage Agent: Analyze Codebase Task Source: https://github.com/antinomyhq/awesome-forge-agents/blob/main/agents/sage/README.md This YAML snippet defines a task for the Sage agent to analyze an entire codebase. It specifies the task type, a question about the codebase, and the context for analysis. ```yaml task: "analyze_codebase" question: "How does the authentication system work?" context: "full_repository" ``` -------------------------------- ### Validate Agent Configuration YAML with Python Source: https://context7.com/antinomyhq/awesome-forge-agents/llms.txt Validates the syntax and required fields of agent configuration YAML files. It checks for the presence of 'agents' and essential fields within each agent, such as 'id', 'title', 'description', 'system_prompt', and 'user_prompt'. Dependencies include the PyYAML library. Outputs validation status to the console. ```python import yaml import sys def validate_agent_config(file_path): try: with open(file_path, 'r') as f: config = yaml.safe_load(f) # Check required fields assert 'agents' in config, "Missing 'agents' field" for agent in config['agents']: assert 'id' in agent, f"Agent missing 'id' field" assert 'title' in agent, f"Agent {agent.get('id')} missing 'title'" assert 'description' in agent, f"Agent {agent.get('id')} missing 'description'" assert 'system_prompt' in agent, f"Agent {agent.get('id')} missing 'system_prompt'" assert 'user_prompt' in agent, f"Agent {agent.get('id')} missing 'user_prompt'" print(f"✓ {file_path} is valid") return True except yaml.YAMLError as e: print(f"✗ YAML syntax error in {file_path}: {e}") return False except AssertionError as e: print(f"✗ Validation error in {file_path}: {e}") return False except Exception as e: print(f"✗ Error validating {file_path}: {e}") return False # Validate all agent configs import os for root, dirs, files in os.walk('agents'): for file in files: if file == 'config.yaml': file_path = os.path.join(root, file) validate_agent_config(file_path) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.