# swethasrini15/refactoriq architecture

> Architecture diagram of the GitHub repository swethasrini15/refactoriq, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-01-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/swethasrini15/refactoriq
- Repository: https://github.com/swethasrini15/refactoriq

## Overview

##### Main Components Identification

a) Agent Layer
- Three distinct agent types in a hierarchy:
- Super Senior Agent (highest level)
- Senior Agent
- Junior Agent

b) Utility Layer
- Analysis Utils
- File Utils
- Language Processing

c) External Services
- OpenRouter API (for AI/LLM integration)
- File System Interface

##### Component Relationships

**[Input: Code ZIP File] → [File Utils]**
- ↓
**[OpenRouter API] ←→ [Agent Layer] ←→ [Analysis Utils]**
- ↓
- [Language Utils]
- ↓
**[Output: Word Document]**

##### Detailed Component Breakdown

For each major component, include:

Agent Layer:
- Hierarchy between agents
- Their responsibilities
- Interaction with OpenRouter API

Utilities:
- File handling capabilities
- Analysis functions
- Language processing features

##### Process Flow Indicators

Numbered steps showing the sequence:

##### Technical Details

Annotations for:
- Python 3.7+ requirement
- API dependencies
- File format transformations (MD → DOCX)
- Async operation indicators

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        CodeZip[("Code ZIP File")]:::input
    end

    subgraph "Agent Layer"
        SuperAgent["Super Senior Agent"]:::agent
        SeniorAgent["Senior Agent"]:::agent
        JuniorAgent["Junior Agent"]:::agent
        SuperAgent --> SeniorAgent
        SeniorAgent --> JuniorAgent
    end

    subgraph "Utility Layer"
        FileUtils["File Utils"]:::utility
        AnalysisUtils["Analysis Utils"]:::utility
        LangProc["Language Processing"]:::utility
    end

    subgraph "External Services"
        OpenRouter["OpenRouter API"]:::external
    end

    subgraph Output
        DocOutput[("Word Document")]:::output
    end

    CodeZip --> FileUtils
    FileUtils --> SuperAgent
    
    OpenRouter <--> SuperAgent
    OpenRouter <--> SeniorAgent
    OpenRouter <--> JuniorAgent
    
    SuperAgent <--> AnalysisUtils
    SeniorAgent <--> AnalysisUtils
    JuniorAgent <--> AnalysisUtils
    
    AnalysisUtils --> LangProc
    LangProc --> DocOutput

    %% Click Events
    click SuperAgent "https://github.com/SwethaSrini15/RefactorIQ/blob/main/agents/super_senior_agent.py"
    click SeniorAgent "https://github.com/SwethaSrini15/RefactorIQ/blob/main/agents/senior_agent.py"
    click JuniorAgent "https://github.com/SwethaSrini15/RefactorIQ/blob/main/agents/junior_agent.py"
    click FileUtils "https://github.com/SwethaSrini15/RefactorIQ/blob/main/utils/file_utils.py"
    click AnalysisUtils "https://github.com/SwethaSrini15/RefactorIQ/blob/main/utils/analysis_utils.py"
    click LangProc "https://github.com/SwethaSrini15/RefactorIQ/blob/main/utils/languages.py"

    %% Styles
    classDef agent fill:#3498db,stroke:#2980b9,color:white
    classDef utility fill:#2ecc71,stroke:#27ae60,color:white
    classDef external fill:#95a5a6,stroke:#7f8c8d,color:white
    classDef input fill:#f1c40f,stroke:#f39c12,color:black
    classDef output fill:#f1c40f,stroke:#f39c12,color:black

    %% Legend
    subgraph Legend
        L1["Agent Component"]:::agent
        L2["Utility Component"]:::utility
        L3["External Service"]:::external
        L4[("Input/Output")]:::input
    end
```
