# ennucore/clippinator architecture

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

- Interactive diagram: https://gitdiagram.com/ennucore/clippinator
- Repository: https://github.com/ennucore/clippinator

## Overview

##### Main Components
- Taskmaster Agent: This is the main control agent that coordinates the entire workflow. It interacts directly with the user and delegates parts of the work to the specialized subagents.
- Minions (Subagents): These are the specialized agents (found under clippinator/minions) which include roles such as Architect (for planning the project structure), Writer, and others. Each has its own responsibilities and may use specific tools.
- Project Module: Under clippinator/project, this component deals with processing and summarizing the current project’s state, architecture, and structure.
- Tools Module: Located under clippinator/tools, this contains various utility functions – for file operations, terminal interaction, using the browser (via Selenium), interacting with ctags for getting file structure information, and so on.
- External Dependencies & Infrastructure: Note the dependencies on external systems such as OpenAI API (for GPT-4 interactions), ctags (for analyzing code), Poetry (for dependency management), and additional services like SerpAPI for search. Also include the CI/linting/memory functionalities.

##### Relationships and Interactions
- The Taskmaster is the central hub that starts by asking the user some questions. It then communicates with the Architect minion to plan the project’s architecture.
- Once the architecture is set (a structured text summary of files and key lines), it is shared with all subagents. Data flows between the Taskmaster, minions, and the Project module.
- The Tools module is a shared service used by all agents for performing tasks such as reading/writing files, executing terminal commands, testing via Selenium, and so on.
- There is a clear feedback loop: the system accepts ^C interrupts from the user to provide feedback, with a mechanism to modify the architecture dynamically.

##### Architectural Patterns and Design Principles
- Modular and Agent-Based Architecture: The design explicitly separates the high-level decision-making (Taskmaster) from its specialized actions (minions).
- Layered Tools and Service Approach: The Tools submodule acts as a façade layer to abstract complex operations like file I/O and terminal commands.
- Continuous Feedback and Adaptive Design: Feedback tools (like the interruption mechanism) enable the system to react and adjust mid-execution.
- Loose Coupling: The agents are decoupled by using common interfaces and utility tools, which supports scalability and maintainability.

##### Relevant Technologies, Frameworks, or Libraries
- Python as the main language (observed from __init__.py files and standard Python project layout).
- Poetry for dependency management.
- ctags for code structure analysis.
- Selenium for browser automation.
- OpenAI API (GPT-4) for generating and driving agent decisions.
- Pylint and associated tools for linting and CI.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External User
    U["User"]:::external

    %% Core Agents Subgraph
    subgraph "Core Agents"
        TM["Taskmaster Agent"]:::agent
        MIN["Minions (Subagents)"]:::subagent
        PM["Project Module"]:::module
    end

    %% Shared Tools Subgraph
    subgraph "Shared Tools"
        T["Tools Module"]:::tool
    end

    %% External Systems Subgraph
    subgraph "External Systems"
        OA["OpenAI API"]:::external
        CT["ctags"]:::external
        PT["Poetry"]:::external
        SE["Selenium"]:::external
        SP["SerpAPI"]:::external
        CI["CI/Pylint"]:::external
    end

    %% Connections between layers
    U -->|"initiates"| TM
    TM -->|"delegates"| MIN
    TM -->|"sharesState"| PM
    MIN -->|"feedback"| TM

    TM -->|"uses"| T
    MIN -->|"uses"| T
    PM -->|"uses"| T

    T -->|"executes"| SE
    T -->|"analyzes"| CT
    T -->|"managesDeps"| PT
    T -->|"guidesCI"| CI
    T -->|"search"| SP

    TM -->|"calls"| OA

    %% Click Events
    click TM "https://github.com/ennucore/clippinator/blob/master/clippinator/minions/taskmaster.py"
    click MIN "https://github.com/ennucore/clippinator/tree/master/clippinator/minions/"
    click PM "https://github.com/ennucore/clippinator/tree/master/clippinator/project/"
    click T "https://github.com/ennucore/clippinator/tree/master/clippinator/tools/"

    %% Styles
    classDef agent fill:#ffcccc,stroke:#990000,stroke-width:2px;
    classDef subagent fill:#ffe6cc,stroke:#995c00,stroke-width:2px;
    classDef module fill:#ccffcc,stroke:#006600,stroke-width:2px;
    classDef tool fill:#ffffcc,stroke:#999900,stroke-width:2px;
    classDef external fill:#e6ccff,stroke:#660099,stroke-width:2px;
```
