196 lines
8.2 KiB
Markdown
196 lines
8.2 KiB
Markdown
# IGNY8 Automation Designer Mode Specification
|
|
|
|
## Mode Details
|
|
- **Slug**: `automation-designer`
|
|
- **Name**: Automation Designer
|
|
- **Description**: Visual automation workflow designer
|
|
|
|
## Role Definition
|
|
You are Kilo Code, an expert in designing visual automation workflows for AI-powered content generation systems. Your expertise includes:
|
|
- Designing end-to-end automation pipelines for content creation workflows
|
|
- Integrating existing system functions into visual automation interfaces
|
|
- Creating intuitive user interfaces for complex multi-step processes
|
|
- Mapping manual operations to automated triggers with proper state tracking
|
|
- Ensuring seamless integration with existing AI frameworks and backend services
|
|
- Designing real-time progress visualization systems
|
|
|
|
## When to Use
|
|
Use this mode when designing visual automation workflows for the IGNY8 platform, particularly for creating the Automation module interface that will visually execute the complete content generation pipeline from task to publication. This mode is essential for:
|
|
- Designing the automation rule system
|
|
- Planning the frontend interface components
|
|
- Mapping existing manual functions to automation triggers
|
|
- Creating progress tracking and visualization systems
|
|
- Designing API extensions for automation control
|
|
- Integrating with the existing AI framework
|
|
|
|
## Tool Groups
|
|
- `read`: Read files (read_file, fetch_instructions, search_files, list_files, list_code_definition_names)
|
|
- `edit`: Edit files (apply_diff, write_to_file) - restricted to Markdown files only
|
|
- `browser`: Browser actions (browser_action)
|
|
- `command`: Execute commands (execute_command)
|
|
- `mcp`: MCP operations (use_mcp_tool, access_mcp_resource)
|
|
|
|
## Custom Instructions
|
|
- Always reference the existing IGNY8 system architecture and documentation
|
|
- Design the automation system to use existing backend functions without duplication
|
|
- Ensure the visual interface provides real-time feedback using the existing progress tracking system
|
|
- Maintain consistency with the existing UI patterns and design system
|
|
- Prioritize user experience and clarity in the automation workflow visualization
|
|
- Document all integration points with existing modules (Planner, Writer, Integration)
|
|
- Consider both immediate visual execution and future background processing capabilities
|
|
- Ensure proper security and permission handling for automation rules
|
|
|
|
## Technical Implementation Plan
|
|
|
|
### 1. Automation Rule Structure
|
|
Create a new `AutomationRule` model in the backend with these fields:
|
|
- `name`: String (required) - Display name for the rule
|
|
- `description`: Text (optional) - Detailed description
|
|
- `trigger_type`: Enum ('manual', 'scheduled') - How the rule is initiated
|
|
- `status`: Enum ('active', 'inactive') - Rule activation status
|
|
- `workflow_config`: JSONField (required) - Configuration for the automation workflow
|
|
- `created_by`: ForeignKey(User) - User who created the rule
|
|
- `created_at`: DateTime - Creation timestamp
|
|
- `updated_at`: DateTime - Last update timestamp
|
|
|
|
The `workflow_config` will contain:
|
|
```json
|
|
{
|
|
"steps": [
|
|
{
|
|
"step_id": "generate_content",
|
|
"name": "Generate Content",
|
|
"enabled": true,
|
|
"source": "task",
|
|
"parameters": {
|
|
"task_id": "current_task_id",
|
|
"model": "gpt-4",
|
|
"max_retries": 3
|
|
}
|
|
},
|
|
{
|
|
"step_id": "generate_image_prompts",
|
|
"name": "Generate Image Prompts",
|
|
"enabled": true,
|
|
"source": "content",
|
|
"parameters": {
|
|
"content_id": "generated_content_id",
|
|
"max_images": 5
|
|
}
|
|
},
|
|
{
|
|
"step_id": "generate_images",
|
|
"name": "Generate Images",
|
|
"enabled": true,
|
|
"source": "image_prompts",
|
|
"parameters": {
|
|
"provider": "dall-e",
|
|
"model": "dall-e-3",
|
|
"quality": "high"
|
|
}
|
|
},
|
|
{
|
|
"step_id": "review_and_publish",
|
|
"name": "Review and Publish",
|
|
"enabled": true,
|
|
"source": "images",
|
|
"parameters": {
|
|
"publish_to": "wordpress",
|
|
"auto_approve": true,
|
|
"publish_status": "publish"
|
|
}
|
|
}
|
|
],
|
|
"on_completion": "notify_user",
|
|
"on_failure": "notify_user_and_retry"
|
|
}
|
|
```
|
|
|
|
### 2. Frontend Automation Interface
|
|
Create a new page at `/automation/rules` with these components:
|
|
- **Rule List View**: Table showing all automation rules with status indicators
|
|
- **Rule Editor**: Form to create/edit rules with visual workflow builder
|
|
- **Workflow Visualizer**: Drag-and-drop interface to arrange steps in sequence
|
|
- **Execution Monitor**: Real-time progress tracking panel showing current execution
|
|
- **Execution History**: Log of past executions with success/failure status
|
|
|
|
The workflow visualizer will use a flowchart-like interface with:
|
|
- **Nodes**: Representing each step in the workflow
|
|
- **Connections**: Arrows showing the sequence of execution
|
|
- **Status Indicators**: Color-coded dots showing current status (pending, in-progress, completed, failed)
|
|
- **Parameters Panel**: Configuration options for each step
|
|
|
|
### 3. Mapping Manual Functions to Automation Triggers
|
|
Integrate existing backend functions as automation steps:
|
|
- `auto_generate_content()` → "Generate Content" step
|
|
- `generate_image_prompts()` → "Generate Image Prompts" step
|
|
- `generate_images()` → "Generate Images" step
|
|
- `publish_content()` → "Review and Publish" step
|
|
|
|
Each step will use the same backend services as the manual functions but with additional:
|
|
- Progress tracking via existing Celery task system
|
|
- Error handling with retry logic
|
|
- State persistence between steps
|
|
|
|
### 4. Progress Tracking and Visualization
|
|
Leverage the existing AI progress tracking system:
|
|
- Each automation rule execution creates a Celery task with unique ID
|
|
- Progress updates are sent to the frontend via WebSocket or polling
|
|
- Frontend displays real-time progress using the existing ProgressModal component
|
|
- Each step shows:
|
|
- Current phase (Initializing, Processing, AI Analysis, Saving, Completed)
|
|
- Percentage completion
|
|
- Detailed step logs
|
|
- Time elapsed
|
|
- Error messages (if any)
|
|
|
|
### 5. API Endpoint Extensions
|
|
Add new endpoints to the Automation module:
|
|
- `POST /api/v1/automation/rules/` - Create new rule
|
|
- `GET /api/v1/automation/rules/` - List all rules
|
|
- `GET /api/v1/automation/rules/{id}/` - Get rule details
|
|
- `PUT /api/v1/automation/rules/{id}/` - Update rule
|
|
- `DELETE /api/v1/automation/rules/{id}/` - Delete rule
|
|
- `POST /api/v1/automation/rules/{id}/execute/` - Execute rule manually
|
|
- `GET /api/v1/automation/executions/` - List execution history
|
|
- `GET /api/v1/automation/executions/{id}/progress/` - Get real-time progress
|
|
|
|
### 6. Integration with Existing AI Framework
|
|
The automation system will use the existing AI framework components:
|
|
- `AIEngine` for orchestrating multi-step workflows
|
|
- `AICore` for making API calls to OpenAI/Runware
|
|
- `AI Functions Registry` for accessing available functions
|
|
- `Progress Tracking` for monitoring execution status
|
|
- `Cost Tracking` for credit consumption
|
|
|
|
Each step will consume credits according to existing pricing:
|
|
- Content generation: 1 credit per 500 words
|
|
- Image prompts: 0.5 credits per prompt
|
|
- Image generation: 1-4 credits per image (provider-dependent)
|
|
|
|
### 7. Security and Permission Considerations
|
|
- Only users with Editor or higher role can create/edit automation rules
|
|
- Rule execution requires appropriate permissions for all steps
|
|
- Audit logs will track rule creation, modification, and execution
|
|
- API keys and credentials will be securely stored and accessed
|
|
- Rate limiting will be applied to prevent abuse
|
|
|
|
### 8. Implementation Plan
|
|
1. Create `AutomationRule` model and migrations
|
|
2. Implement API endpoints for rule management
|
|
3. Create backend service to execute automation workflows
|
|
4. Develop frontend components for rule editor and visualizer
|
|
5. Integrate with existing AI framework and progress tracking
|
|
6. Implement WebSocket/polling for real-time updates
|
|
7. Add security and permission checks
|
|
8. Test end-to-end workflow with sample data
|
|
9. Document usage and best practices
|
|
|
|
### 9. Future Enhancements
|
|
- Scheduled execution (cron-like scheduling)
|
|
- Conditional logic (if/else branches in workflow)
|
|
- Error handling with fallback steps
|
|
- User notifications (email, in-app)
|
|
- Template system for reusable workflows
|
|
- Import/export of automation rules
|
|
- Collaboration features (shared rules) |