# kyaukyuai/gpt-all-star architecture

> Architecture diagram of the GitHub repository kyaukyuai/gpt-all-star, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kyaukyuai/gpt-all-star
- Repository: https://github.com/kyaukyuai/gpt-all-star

## Overview

##### Main Components
- CLI/User Interface: The project includes a command-line interface (see the gpt_all_star/cli folder and main.py) that serves as the primary entrypoint. Additionally, there is a connection to an external UI project (gpt-all-star-ui) which acts as a front-facing web application.
- Core Engine: The “gpt_all_star/core” directory is the heart of the system. This module is further subdivided into several major subcomponents:
- Agents: Under gpt_all_star/core/agents, there are various agent modules (architect, engineer, product_owner, etc.) that represent different roles. They collaborate by receiving tasks and generating plans.
- Steps: The system is organized into “steps” (see the gpt_all_star/core/steps directory) covering different phases like development, system_design, ui_design, healing, specification, and quality assurance. Each step has its own set of prompts and tasks.
- Execution & Deployment: Modules in gpt_all_star/core/execution and gpt_all_star/core/deployment handle the orchestration of actions and deployment workflows.
- Tools & Helpers: The tools (gpt_all_star/core/tools) and helper modules (gpt_all_star/helper) provide supporting functionality such as file operations, configuration loading, Git operations, text parsing, and multi-agent collaboration mapping.
- Storage, Team, and Token: Other core modules manage storage (gpt_all_star/core/storage), team configuration (gpt_all_star/core/team), and token handling (gpt_all_star/core/token) which are essential for coordinating the collaborative agents.
- External Services & Dependencies:
- LLM Providers: Environment variables in the README show that the project integrates with external LLMs (like OpenAI, Azure’s OpenAI, or Anthropic) to handle the AI logic.
- Docker & Deployment Scripts: Dockerfile, docker-compose.yml, and various GitHub workflows represent the build, testing, and deployment environment.
- Package & Dependency Managers: Files like pyproject.toml, poetry-related files, Makefile, and configuration files such as .env and .pre-commit-config.yaml indicate the project’s deployment and CI/CD strategy.

##### Relationships and Interactions
- The CLI (or UI interface) passes user instructions and commands to the core engine.
- Within the core engine, the execution flow is typically:
- The CLI initiates a “step” (e.g., system design or development).
- Each step involves coordinating between relevant agents (each with a specific role) which collaborate to produce or refine outputs.
- The “agents” modules use prompts/templates specific to that step, as seen by the layered structure in steps (e.g., planning_prompt.py, improvement_prompt.py).
- Tools and helper functions are invoked as needed to perform file operations, config loading, Git interactions, or text processing.
- The system sends requests to external LLM services based on environment configuration and receives responses that guide subsequent steps.
- The deployment module may interact with external systems to trigger actual deployments of the generated code (or to integrate with the UI project).

##### Architectural Patterns and Design Choices
- Modular Design: The project is clearly organized into modular components by its a “step” based flow – each phase (specification, system design, development, etc.) is self-contained.
- Separation of Concerns: The various roles (agents), execution mechanisms, and helper tools are all separated into distinct modules, simplifying testing and expansion.
- Extensibility: Since the agents, steps, and configurations are externalized (for example, modifying team members via gpt_all_star/agents.yml), the system is designed to be easily extended or modified.
- Containerization: Use of Docker and docker-compose indicates an emphasis on reproducible builds and smooth deployment pipelines.
- External Integrations: Integration with LLM endpoints and a separate UI layer showcases an architecture that combines internal orchestration with external service calls.

##### Additional Notes
- Don’t over-simplify; separate out each “step” module (system_design, specification, development, etc.) as these represent important stages in the multi-agent workflow.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% User Interface Layer
    subgraph "User Interface"
        CLI["CLI Interface"]:::interface
        Main["Main Entrypoint"]:::interface
        UI["UI Project"]:::external
    end

    %% Core Engine Layer
    subgraph "Core Engine"
        AM["Agent Management"]:::core
        subgraph "Step Execution"
            SD["System Design"]:::step
            Dev["Development"]:::step
            UID["UI Design"]:::step
            Heal["Healing"]:::step
            Spec["Specification"]:::step
            QA["Quality Assurance"]:::step
        end
        Exec["Execution Module"]:::core
        Dep["Deployment Module"]:::core
        Store["Storage Management"]:::core
        Team["Team Configuration"]:::core
        Token["Token Handling"]:::core
        subgraph "Tools & Helpers"
            Tools["Tools"]:::tool
            Helpers["Helpers"]:::tool
        end
    end

    %% External Services & Deployment Layer
    subgraph "External & Deployment"
        LLM["LLM Providers"]:::external
        CI["Docker & CI/CD Configs"]:::external
    end

    %% Connections from User Interface to Core Engine
    CLI -->|"sends commands"| AM
    Main -->|"initiates process"| AM
    UI -->|"interfaces with"| AM

    %% Connections within Core Engine - Steps interact with Agent Management and Execution
    SD -->|"collaborates"| AM
    Dev -->|"collaborates"| AM
    UID -->|"collaborates"| AM
    Heal -->|"collaborates"| AM
    Spec -->|"collaborates"| AM
    QA -->|"collaborates"| AM

    SD -->|"triggers"| Exec
    Dev -->|"triggers"| Exec
    UID -->|"triggers"| Exec
    Heal -->|"triggers"| Exec
    Spec -->|"triggers"| Exec
    QA -->|"triggers"| Exec

    %% Execution to Deployment Flow
    Exec -->|"orchestrates"| Dep
    Dep -->|"deploys to"| CI

    %% Tools & Helpers support Agent Management
    Tools -->|"assists"| AM
    Helpers -->|"assists"| AM

    %% Core configuration support
    Store -->|"provides data to"| AM
    Team -->|"configures"| AM
    Token -->|"secures"| AM

    %% Integration with External Services
    AM -->|"calls"| LLM

    %% Styles
    classDef interface fill:#a2d9ce,stroke:#1e8449,stroke-width:2px;
    classDef core fill:#aed6f1,stroke:#2e86c1,stroke-width:2px;
    classDef step fill:#d6eaf8,stroke:#2874a6,stroke-width:2px;
    classDef tool fill:#fcf3cf,stroke:#f1c40f,stroke-width:2px;
    classDef external fill:#f9e79f,stroke:#d35400,stroke-width:2px;

    %% Click Events
    click CLI "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/cli"
    click Main "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/main.py"
    click AM "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/agents"
    click SD "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/system_design"
    click Dev "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/development"
    click UID "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/ui_design"
    click Heal "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/healing"
    click Spec "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/specification"
    click QA "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/steps/quality_assurance"
    click Exec "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/core/execution/execution.py"
    click Dep "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/core/deployment/deployment.py"
    click Store "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/core/storage.py"
    click Team "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/core/team.py"
    click Token "https://github.com/kyaukyuai/gpt-all-star/blob/main/gpt_all_star/core/token.py"
    click Tools "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/core/tools"
    click Helpers "https://github.com/kyaukyuai/gpt-all-star/tree/main/gpt_all_star/helper"
```
