# grigorij-dudnik/clean-coder-ai architecture

> Architecture diagram of the GitHub repository grigorij-dudnik/clean-coder-ai, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2024-12-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/grigorij-dudnik/clean-coder-ai
- Repository: https://github.com/grigorij-dudnik/clean-coder-ai

## Overview

##### Main System Components

a) Agent Layer:
- Manager Agent
- Planner Agent
- Executor Agent
- Debugger Agent
- Researcher Agent
- Frontend Feedback Agent

b) Tools & Utilities Layer:
- This as a supporting layer, including:
- RAG (Retrieval-Augmented Generation) system
- Project Management Tools
- LangGraph Functions
- Voice Utils
- Syntax Checker

c) External Integrations:
- As external connected services:
- Todoist Integration
- LLM Services
- Frontend Preview System

##### Interaction Flows

a) Primary Flow:
**User Input → Manager Agent → Planner Agent → Executor Agent → Code Output**

b) Support Flows:
- How the Debugger Agent interfaces with the main flow
- RAG system's connection to the Researcher Agent
- Demonstrate Frontend Feedback loop

##### Specific Implementation Details

Technical elements:

a) File Structure Organization:
- Src/ directory structure with:
- agents/
- prompts/
- tools/
- utilities/

b) Pipeline Components:
- Tools_coder_pipeline.py and tools_project_manager.py interaction

##### Key Features to Emphasize

Unique capabilities:
- Frontend feedback visualization system
- Voice interaction capability
- RAG-based file research system
- Sensitive file protection mechanism

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Agents
        MA["Manager Agent"]:::agent
        PA["Planner Agent"]:::agent
        EA["Executor Agent"]:::agent
        DA["Debugger Agent"]:::agent
        RA["Researcher Agent"]:::agent
        FA["Frontend Feedback Agent"]:::agent
    end

    subgraph Tools
        RAG["RAG System"]:::tool
        PMT["Project Management Tools"]:::tool
        LGF["LangGraph Functions"]:::tool
        VU["Voice Utils"]:::tool
        SC["Syntax Checker"]:::tool
    end

    subgraph External
        TD["Todoist Integration"]:::external
        LLM["LLM Services"]:::external
        FPS["Frontend Preview System"]:::external
    end

    subgraph Core_Utils
        GR["Graphics"]:::util
        LLMI["LLM Integration"]:::util
        IH["Input Handler"]:::util
        PS["Project Setup"]:::util
        WM["Work Management"]:::util
    end

    UI(("User Input")):::input --> MA
    MA --> PA
    PA --> EA
    EA --> CO(("Code Output")):::output
    
    MA -.-> DA
    DA -.-> EA
    
    RA --- RAG
    FA --- FPS
    
    MA --- PMT
    EA --- LGF
    MA --- VU
    EA --- SC
    
    LLM --- MA
    LLM --- PA
    LLM --- EA
    LLM --- RA
    
    TD --- MA
    
    %% Click events for component mapping
    click MA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/manager.py"
    click PA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/planner_agent.py"
    click EA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/executor_agent.py"
    click DA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/debugger_agent.py"
    click RA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/researcher_agent.py"
    click FA "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/frontend_feedback.py"
    
    click RAG "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/tree/master/src/tools/rag/"
    click PMT "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/tools/tools_project_manager.py"
    click LGF "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/langgraph_common_functions.py"
    click VU "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/voice_utils.py"
    click SC "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/syntax_checker_functions.py"
    click FPS "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/agents/frontend_feedback.py"
    
    click GR "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/graphics.py"
    click LLMI "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/llms.py"
    click IH "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/user_input.py"
    click PS "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/start_project_functions.py"
    click WM "https://github.com/Grigorij-Dudnik/Clean-Coder-AI/blob/master/src/utilities/start_work_functions.py"

    %% Styling
    classDef agent fill:#a4c2f4,stroke:#0b5394
    classDef tool fill:#b6d7a8,stroke:#274e13
    classDef external fill:#ffe599,stroke:#bf9000
    classDef util fill:#d5a6bd,stroke:#741b47
    classDef input fill:#9fc5e8,stroke:#0b5394
    classDef output fill:#9fc5e8,stroke:#0b5394

    %% Legend
    subgraph Legend
        L1["AI Agent"]:::agent
        L2["Tool/Utility"]:::tool
        L3["External Service"]:::external
        L4["Core Utility"]:::util
        L5(("Input/Output")):::input
    end
```
