# Implementation Plan: Gemini CLI Parity

## Phase 1: Infrastructure & Common Logic
- [ ] Task: Initialize MMA Environment `activate_skill mma-orchestrator`
- [ ] Task: Audit `gemini_cli_adapter.py` and `ai_client.py` for parity gaps
- [ ] Task: Implement common logging utilities for CLI bridge observability
- [ ] Task: Conductor - User Manual Verification 'Infrastructure & Common Logic' (Protocol in workflow.md)

## Phase 2: Token Counting & Safety Settings
- [ ] Task: Write failing tests for token estimation in `GeminiCLIAdapter`
- [ ] Task: Implement token counting parity in `GeminiCLIAdapter`
- [ ] Task: Write failing tests for safety setting application in `GeminiCLIAdapter`
- [ ] Task: Implement safety filter application in `GeminiCLIAdapter`
- [ ] Task: Conductor - User Manual Verification 'Token Counting & Safety Settings' (Protocol in workflow.md)

## Phase 3: Tool Calling Parity & System Instructions
- [ ] Task: Write failing tests for system instruction usage in `GeminiCLIAdapter`
- [ ] Task: Implement system instruction propagation in `GeminiCLIAdapter`
- [ ] Task: Write failing tests for tool call/response mapping in `cli_tool_bridge.py`
- [ ] Task: Synchronize tool call handling between bridge and `ai_client.py`
- [ ] Task: Conductor - User Manual Verification 'Tool Calling Parity & System Instructions' (Protocol in workflow.md)

## Phase 4: Final Verification & Performance Diagnostics
- [ ] Task: Implement automated parity regression tests comparing CLI vs Direct API outputs
- [ ] Task: Verify bridge latency and error handling robustness
- [ ] Task: Conductor - User Manual Verification 'Final Verification & Performance Diagnostics' (Protocol in workflow.md)
