# opahopa/crewai-factory-crew architecture

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

- Interactive diagram: https://gitdiagram.com/opahopa/crewai-factory-crew
- Repository: https://github.com/opahopa/crewai-factory-crew

## Overview

##### Main Components

a) Input Layer:
- YAML Configuration Input (crew_input.yaml)
- Environment Configuration (.env)

b) Core Processing Components:
- Design Crew System
- Coding Crew System
- Model Selection & Management

c) Tool Management Layer:
- Custom Tools Repository
- External Tools Integration

d) Output Generation Layer:
- Generated Crew Implementation
- Configuration Files
- Support Files

**[Input YAML] → [Factory Core] → [Generated Crew]**

**[Input Layer]**
- ↓
**[Configuration Parser]**
- ↓
**[Design Crew] → [Design Artifacts] → [Coding Crew] → [Final Implementation]**
- ↑               ↑                    ↑                ↓
**[Tools Layer] ←→ [Model Layer] ←→ [Helper Functions] → [Output]**

##### Key Relationships to Highlight

a) Two-Stage Processing Pipeline:
- Sequential flow from Design Crew to Coding Crew
- Feedback loops between stages

b) Tool Integration:
- How custom tools (from /tools directory) connect to both crews
- External tool integration points

c) Model Selection Flow:
- How different models (gpt1o_mini, gemini2, claude3.5-sonnet) are used at different stages

##### Important Details

a) Configuration Management:
- How /config directory structures influence both crews
- Relationship between agents.yaml and tasks.yaml

b) Helper Integration:
- How helpers/ directory components support the main process
- Utility function integration points

##### Technical Stack Indicators

- Python (core implementation)
- YAML (configuration)
- LLM APIs (OpenAI, Gemini, Anthropic)
- External APIs (Serper)

## Diagram (Mermaid)

```mermaid
graph TB
    subgraph Input
        YC["YAML Configuration"]:::input
        EC["Environment Config"]:::input
    end

    subgraph Core
        CI["Core Implementation"]:::core
        MS["Model Selection"]:::core
    end

    subgraph "Design Crew"
        DA["Design Agents"]:::crew
        DT["Design Tasks"]:::crew
        DArt["Design Artifacts"]:::output
    end

    subgraph "Coding Crew"
        CA["Coding Agents"]:::crew
        CT["Coding Tasks"]:::crew
    end

    subgraph "Tools Layer"
        FT["File Operations"]:::tool
        BT["Browser Automation"]:::tool
        ST["Shell Commands"]:::tool
    end

    subgraph "Helper System"
        MH["Main Helper"]:::helper
        DH["Documentation Helper"]:::helper
    end

    subgraph "Documentation"
        CC["Core Concepts"]:::docs
        HG["How-to Guides"]:::docs
        TD["Tools Documentation"]:::docs
    end

    subgraph Output
        GC["Generated Crew"]:::output
        CF["Configuration Files"]:::output
        SF["Support Files"]:::output
    end

    YC --> CI
    EC --> CI
    CI --> DA
    CI --> CA
    MS --> DA
    MS --> CA

    DA --> DT
    DT --> DArt
    DArt --> CA
    CA --> CT
    CT --> GC

    FT --> DA
    FT --> CA
    BT --> DA
    BT --> CA
    ST --> DA
    ST --> CA

    MH --> DA
    MH --> CA
    DH --> DA
    DH --> CA

    CC -.-> DH
    HG -.-> DH
    TD -.-> DH

    click YC "https://github.com/opahopa/crewai-factory-crew/blob/main/crew_input.yaml"
    click EC "https://github.com/opahopa/crewai-factory-crew/blob/main/.env.sample"
    click DA "https://github.com/opahopa/crewai-factory-crew/blob/main/config/design_crew/agents.yaml"
    click DT "https://github.com/opahopa/crewai-factory-crew/blob/main/config/design_crew/tasks.yaml"
    click CA "https://github.com/opahopa/crewai-factory-crew/blob/main/config/coding_crew/agents.yaml"
    click CT "https://github.com/opahopa/crewai-factory-crew/blob/main/config/coding_crew/tasks.yaml"
    click MS "https://github.com/opahopa/crewai-factory-crew/blob/main/models.py"
    click CI "https://github.com/opahopa/crewai-factory-crew/blob/main/crew.py"
    click FT "https://github.com/opahopa/crewai-factory-crew/blob/main/tools/files_langchain.py"
    click BT "https://github.com/opahopa/crewai-factory-crew/blob/main/tools/playwright_tool.py"
    click ST "https://github.com/opahopa/crewai-factory-crew/blob/main/tools/shell_tool.py"
    click MH "https://github.com/opahopa/crewai-factory-crew/blob/main/helpers/helper.py"
    click DH "https://github.com/opahopa/crewai-factory-crew/blob/main/helpers/get_docs_string.py"
    click CC "https://github.com/opahopa/crewai-factory-crew/tree/main/docs_crewai/concepts/"
    click HG "https://github.com/opahopa/crewai-factory-crew/tree/main/docs_crewai/how-to/"
    click TD "https://github.com/opahopa/crewai-factory-crew/tree/main/docs_crewai/tools/"

    classDef input fill:#2374AB
    classDef core fill:#048A81
    classDef crew fill:#06D6A0
    classDef tool fill:#FFD166
    classDef helper fill:#EF476F
    classDef docs fill:#9381FF
    classDef output fill:#B8B8D1

    %% Legend
    subgraph Legend
        L1["Input Components"]:::input
        L2["Core Components"]:::core
        L3["Crew Components"]:::crew
        L4["Tool Components"]:::tool
        L5["Helper Components"]:::helper
        L6["Documentation"]:::docs
        L7["Output Components"]:::output
    end
```
