# SAFLA-aiGI Integrated Mode System

This directory contains the complete SAFLA-integrated aiGI mode system with detailed rules and instructions for each mode. The system leverages SAFLA's comprehensive MCP server capabilities for orchestration, optimization, and meta-cognitive operations.

## Directory Structure

```
roo-safla/
├── README.md                           # This file
├── modes                              # Main modes configuration
├── rules-orchestrator/                # Primary workflow coordinator
├── rules-memory-manager/              # Vector memory operations
├── rules-code/                        # TDD-focused implementation
├── rules-tdd/                         # Test engine
├── rules-critic/                      # Code analysis
├── rules-scorer/                      # Performance scoring
├── rules-reflection/                  # Adaptive reflection
├── rules-prompt-generator/            # Prompt generation
├── rules-architect/                   # System architecture
├── rules-debug/                       # Debug engine
├── rules-mcp-integration/             # MCP integration
├── rules-deployment/                  # SAFLA deployment
├── rules-final-assembly/              # Final assembly
├── rules-agent-coordinator/           # Agent coordination
├── rules-meta-cognitive/              # Meta-cognitive engine
└── rules-research/                    # Deep research
```

## SAFLA Integration Overview

### Core Capabilities
- **40+ MCP Tools** across 8 categories
- **Meta-Cognitive Engine** for self-awareness and learning
- **Agent Coordination** for distributed processing
- **Performance Optimization** with real-time monitoring
- **Adaptive Learning** with continuous improvement

### Integration Points
- **CLI Commands** for direct SAFLA operations
- **MCP Tools** for comprehensive system management
- **Resource Access** for real-time data and metrics
- **Workflow Coordination** with spawn/completion patterns

## Usage

Each mode directory contains:
- `rules.md` - Core mode rules and instructions
- `mcp-tools.md` - SAFLA MCP tools usage
- `cli-commands.md` - CLI integration commands
- `resources.md` - SAFLA resource access patterns
- `workflow.md` - Mode workflow and coordination
- `examples.md` - Practical usage examples

## Quick Start

1. Review the main `modes` configuration
2. Select appropriate mode for your task
3. Follow the detailed rules in `rules-{mode}/`
4. Use SAFLA MCP tools and CLI commands as specified
5. Coordinate with other modes using spawn/completion patterns