sf-agent-framework
Version:
AI Agent Orchestration Framework for Salesforce Development - Two-phase architecture with 70% context reduction
100 lines (73 loc) • 2.61 kB
Markdown
# Create Document Task
This task helps you create documents from templates with advanced elicitation
and LLM instruction support.
## Purpose
Enable agents to create structured documents from templates with:
- Variable replacement
- Conditional content
- LLM instruction embedding
- Progressive disclosure
- User feedback loops
## Usage
When an agent needs to create a document:
1. **Load Template**: Agent loads the appropriate template file
2. **Gather Information**: Use elicitation to fill template variables
3. **Process Conditionals**: Evaluate conditional sections based on context
4. **Generate Content**: Create the document following LLM instructions
5. **Review & Refine**: Allow user to review and request changes
## Template Processing
### Variables
- Replace `{{variable_name}}` with gathered values
- Support nested variables like `{{project.name}}`
- Handle arrays with `{{items[0].name}}`
### Conditionals
```
^^CONDITION: condition_name^^
Content shown when condition is true
^^/CONDITION: condition_name^^
```
### LLM Instructions
```
[[LLM: Present this section first, gather feedback, then continue]]
```
### Repeatable Sections
```
<<REPEAT section="item" count="{{item_count}}">>
Repeated content for each item
<</REPEAT>>
```
## Process Steps
1. **Template Selection**
- Identify appropriate template based on document type
- Load template from templates/ directory
- Parse structure and identify variables
2. **Information Gathering**
- Use advanced elicitation for complex sections
- Collect all required variables
- Validate data formats and completeness
3. **Content Generation**
- Process template section by section
- Follow LLM instructions for presentation order
- Apply conditionals based on context
- Expand repeatable sections as needed
4. **Quality Assurance**
- Review generated content for completeness
- Check against relevant checklists
- Ensure all variables replaced
- Validate formatting and structure
5. **User Review**
- Present completed document
- Offer elicitation options for refinement
- Apply requested changes
- Finalize when approved
## Integration Points
- **Templates**: All document templates in templates/ directory
- **Checklists**: Quality validation for document types
- **Elicitation**: Advanced techniques for content gathering
- **Agents**: Available to all agents for document creation
## Success Criteria
- All variables properly replaced
- Conditional logic correctly applied
- LLM instructions followed
- Document passes quality checks
- User approves final output