JAEGIS Agent File Organization System

Automated File Placement and Directory Structure Management

System Overview

This system provides automated file organization and deployment functionality for the JAEGIS Agent Builder Enhancement Squad, ensuring all generated agent files are automatically placed in the correct directory structure without manual intervention.


๐Ÿ—‚๏ธ AUTOMATED FILE ORGANIZATION ARCHITECTURE

File Organization Manager

class JAEGISFileOrganizationManager:
    def __init__(self):
        """
        Automated file organization and deployment system for JAEGIS agents
        """
        print("๐Ÿ—‚๏ธ JAEGIS File Organization System: INITIALIZING")
        
        # Define JAEGIS directory structure
        self.jaegis_structure = {
            'base_path': 'JAEGIS-METHOD-v2.0/v2.1.0/JAEGIS/JAEGIS-METHOD/JAEGIS-agent',
            'directories': {
                'personas': {
                    'path': 'personas/',
                    'file_types': ['.md'],
                    'naming_convention': '{agent-name}.md',
                    'description': 'Agent personality and behavior definitions'
                },
                'tasks': {
                    'path': 'tasks/',
                    'file_types': ['.md'],
                    'naming_convention': '{task-name}.md',
                    'description': 'Task workflow and capability definitions'
                },
                'templates': {
                    'path': 'templates/',
                    'file_types': ['.md'],
                    'naming_convention': '{template-name}.md',
                    'description': 'Reusable template frameworks'
                },
                'checklists': {
                    'path': 'checklists/',
                    'file_types': ['.md'],
                    'naming_convention': '{checklist-name}.md',
                    'description': 'Quality assurance and validation checklists'
                },
                'data': {
                    'path': 'data/',
                    'file_types': ['.md', '.json', '.yaml'],
                    'naming_convention': '{data-name}.{extension}',
                    'description': 'Reference data and configuration files'
                }
            }
        }
        
        # Initialize file deployment system
        self.deployment_system = FileDeploymentSystem(self.jaegis_structure)
        
        print("   โœ… Directory structure mapping: LOADED")
        print("   โœ… File deployment system: READY")
        print("   โœ… Path resolution engine: ACTIVE")
    
    def organize_agent_files(self, agent_generation_result):
        """
        Organize and deploy all files for a generated agent
        """
        print(f"๐Ÿš€ Organizing files for agent: {agent_generation_result['agent_name']}")
        
        organization_plan = self.create_organization_plan(agent_generation_result)
        deployment_result = self.execute_file_deployment(organization_plan)
        validation_result = self.validate_file_placement(deployment_result)
        
        return {
            'organization_successful': validation_result['all_files_placed'],
            'files_deployed': deployment_result['deployed_files'],
            'deployment_summary': deployment_result['summary'],
            'validation_report': validation_result
        }
    
    def create_organization_plan(self, agent_generation_result):
        """
        Create comprehensive file organization plan
        """
        organization_plan = {
            'agent_name': agent_generation_result['agent_name'],
            'file_mappings': [],
            'directory_operations': [],
            'validation_requirements': []
        }
        
        # Map persona files
        if 'persona_files' in agent_generation_result:
            for persona_file in agent_generation_result['persona_files']:
                file_mapping = self.create_file_mapping(
                    persona_file, 'personas', agent_generation_result['agent_name']
                )
                organization_plan['file_mappings'].append(file_mapping)
        
        # Map task files
        if 'task_files' in agent_generation_result:
            for task_file in agent_generation_result['task_files']:
                file_mapping = self.create_file_mapping(
                    task_file, 'tasks', task_file['task_name']
                )
                organization_plan['file_mappings'].append(file_mapping)
        
        # Map template files
        if 'template_files' in agent_generation_result:
            for template_file in agent_generation_result['template_files']:
                file_mapping = self.create_file_mapping(
                    template_file, 'templates', template_file['template_name']
                )
                organization_plan['file_mappings'].append(file_mapping)
        
        # Map checklist files
        if 'checklist_files' in agent_generation_result:
            for checklist_file in agent_generation_result['checklist_files']:
                file_mapping = self.create_file_mapping(
                    checklist_file, 'checklists', checklist_file['checklist_name']
                )
                organization_plan['file_mappings'].append(file_mapping)
        
        # Map data files
        if 'data_files' in agent_generation_result:
            for data_file in agent_generation_result['data_files']:
                file_mapping = self.create_file_mapping(
                    data_file, 'data', data_file['data_name']
                )
                organization_plan['file_mappings'].append(file_mapping)
        
        return organization_plan
    
    def create_file_mapping(self, file_data, directory_type, file_identifier):
        """
        Create individual file mapping with path resolution
        """
        directory_config = self.jaegis_structure['directories'][directory_type]
        
        # Generate target filename
        if directory_type == 'personas':
            target_filename = f"{file_identifier.lower().replace(' ', '-')}.md"
        elif directory_type == 'tasks':
            target_filename = f"{file_identifier.lower().replace(' ', '-')}.md"
        elif directory_type == 'templates':
            target_filename = f"{file_identifier.lower().replace(' ', '-')}-template.md"
        elif directory_type == 'checklists':
            target_filename = f"{file_identifier.lower().replace(' ', '-')}-checklist.md"
        elif directory_type == 'data':
            extension = file_data.get('file_extension', 'md')
            target_filename = f"{file_identifier.lower().replace(' ', '-')}.{extension}"
        
        # Create full target path
        target_path = os.path.join(
            self.jaegis_structure['base_path'],
            directory_config['path'],
            target_filename
        )
        
        return {
            'source_content': file_data['content'],
            'target_path': target_path,
            'target_filename': target_filename,
            'directory_type': directory_type,
            'file_identifier': file_identifier,
            'content_length': len(file_data['content']),
            'deployment_priority': self.get_deployment_priority(directory_type)
        }
    
    def get_deployment_priority(self, directory_type):
        """
        Get deployment priority for different file types
        """
        priority_map = {
            'personas': 1,  # Deploy personas first
            'tasks': 2,     # Then tasks
            'templates': 3, # Then templates
            'checklists': 4, # Then checklists
            'data': 5       # Finally data files
        }
        return priority_map.get(directory_type, 10)

File Deployment System

Path Resolution Engine

This file organization system provides the missing automated file placement functionality that the Agent Builder Enhancement Squad needs to properly deploy generated agent files to the correct JAEGIS directory structure.


๐Ÿ”ง INTEGRATION WITH AGENT BUILDER ENHANCEMENT SQUAD

Enhanced Workflow Orchestrator Agent Integration

Automated Directory Structure Creation

File Validation and Quality Assurance

This enhanced integration system provides complete automated file organization, deployment, and validation functionality for the JAEGIS Agent Builder Enhancement Squad, ensuring all generated agent files are properly placed in the correct directory structure with comprehensive quality assurance.

Last updated