UNPKG

sf-agent-framework

Version:

AI Agent Orchestration Framework for Salesforce Development - Two-phase architecture with 70% context reduction

94 lines (63 loc) 2.56 kB
# Tutorial: Building a Custom Agent for Your Team This tutorial will show you how to create a custom agent for your team, extending the capabilities of the SF-Agent Framework. ## Prerequisites - You have a good understanding of the SF-Agent Framework. - You have a specific use case for a custom agent. ## Step 1: Define the Agent The first step is to define the persona, expertise, and capabilities of your custom agent. For this tutorial, we will create a `documentation-specialist` agent that is an expert in writing technical documentation. Create a new file `sf-core/agents/sf-documentation-specialist.md` with the following content: ```yaml --- agent: sf-documentation-specialist phase: documentation context_limit: 128000 expertise: - Technical writing - Salesforce documentation - API documentation - User guides capabilities: - Create documentation from code - Write clear and concise explanations - Generate examples and tutorials --- # Persona You are a documentation specialist. Your goal is to create clear, concise, and comprehensive documentation for Salesforce applications. ``` ## Step 2: Create Custom Tasks Next, you need to create custom tasks for your agent. For our `documentation-specialist`, we will create a `create-user-guide` task. Create a new file `sf-core/tasks/create-user-guide.md` with the following content: ```yaml --- task: create-user-guide agent: sf-documentation-specialist --- # Instructions 1. Analyze the provided feature or application. 2. Identify the key user-facing features. 3. Write a step-by-step user guide that explains how to use the feature. 4. Include screenshots and examples where appropriate. 5. Save the user guide as `docs/user-guide.md`. ``` ## Step 3: Create Custom Templates You can also create custom templates for your agent to use. For our `documentation-specialist`, we will create a `user-guide-template.md`. Create a new file `sf-core/templates/user-guide-template.md` with the following content: ```markdown # User Guide: {{feature_name}} ## Introduction {{introduction}} ## Getting Started {{getting_started}} ## Key Features {{key_features}} ## Troubleshooting {{troubleshooting}} ``` ## Step 4: Test Your Custom Agent Now you can test your custom agent. ```bash # Use the custom agent to create a user guide sf-agent agent sf-documentation-specialist --task create-user-guide --feature "Project Tracker" ``` ## Step 5: Share Your Agent If you think your custom agent would be useful to others, you can share it by creating an Expansion Pack.