# uriafranko/taskforce architecture

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

- Interactive diagram: https://gitdiagram.com/uriafranko/taskforce
- Repository: https://github.com/uriafranko/taskforce

## Overview

##### Project type and purpose
- TaskForce is an open‑source, plugin‑based AI framework built around the CrewAi model.
- Its goal is to enable community‑driven “crews” (self‑contained task modules) that orchestrate agents, tasks and tools to solve specific workflows (e.g., social media posting, meeting prep, stock analysis).

##### File structure
- Top‑level:
- `.github`, `.devcontainer`, `Dockerfile.dev`, `README.md`, `assets` – CI, container, docs & media.
- `taskforce/` – the entire application code.
- Inside `taskforce/`:
- `lib/` – core framework interfaces, models, task utilities, and tool integrations.
- `crews/` – each crew is a plugin folder containing its own `agents.py`, `crew.py`, `tasks.py`, and tests.
- `main.py` – entrypoint that wires up the framework.
- Config: `pyproject.toml`, `.env.example`, Makefile for building and testing.

##### README for additional insights
- Emphasizes dev container, local install, tests, and community contributions by adding new crews, agents or tools.

##### Be comprehensive but not cluttered
- Plugin directories as a grouped “Crews” cluster.
- Dynamic discovery via interfaces.
- Environment/config loading and test pipelines.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Orchestration Layer
    subgraph "Orchestration" 
        main["main.py"]:::orchestrator
    end

    %% Core Framework
    subgraph "Core Framework"
        CM["CrewManager"]:::core
        TI["TestInterface"]:::core
        Models["models.py"]:::core
        TaskUtils["tasks_utils.py"]:::core
    end

    %% Tool Layer
    subgraph "Tool Layer"
        Browser["browser_tools.py"]:::tool
        Calculator["calculator_tools.py"]:::tool
        ExaSearch["exa_search_tools.py"]:::tool
        Search["search_tools.py"]:::tool
        Sec["sec_tools.py"]:::tool
        ToolUtils["utils.py"]:::tool
    end

    %% Plugin Layer - Crews
    subgraph "Plugin Layer - Crews"
        subgraph "instagram_post"
            IP_A["agents.py"]:::plugin
            IP_C["crew.py"]:::plugin
            IP_T["tasks.py"]:::plugin
        end
        subgraph "meeting_prep"
            MP_A["agents.py"]:::plugin
            MP_C["crew.py"]:::plugin
            MP_T["tasks.py"]:::plugin
        end
        subgraph "product_photographer"
            PP_A["agents.py"]:::plugin
            PP_C["crew.py"]:::plugin
            PP_T["tasks.py"]:::plugin
        end
        subgraph "stock_analysis"
            SA_A["agents.py"]:::plugin
            SA_C["crew.py"]:::plugin
            SA_T["tasks.py"]:::plugin
        end
        subgraph "template_crew"
            TC_A["agents.py"]:::plugin
            TC_C["crew.py"]:::plugin
            TC_T["tasks.py"]:::plugin
        end
        subgraph "trip_planner"
            TP_A["agents.py"]:::plugin
            TP_C["crew.py"]:::plugin
            TP_T["tasks.py"]:::plugin
        end
    end

    %% External Services & Infra
    subgraph "External & Infrastructure"
        Env[".env.example"]:::infra
        Config["pyproject.toml"]:::infra
        GH_Lint["lint_commit.yml"]:::infra
        GH_Tests["run_ruffus_tests.yml"]:::infra
        DevCont["devcontainer.json"]:::infra
        DockerDev["Dockerfile.dev"]:::infra
        API["CrewAi API"]:::infra
    end

    %% Relationships
    main -->|"load() / register()"| CM
    main --> Env
    main --> Config

    CM -->|"discover()"| IP_C
    CM -->|"discover()"| MP_C
    CM -->|"discover()"| PP_C
    CM -->|"discover()"| SA_C
    CM -->|"discover()"| TC_C
    CM -->|"discover()"| TP_C

    IP_A -->|"execute_task()"| IP_T
    MP_A -->|"execute_task()"| MP_T
    PP_A -->|"execute_task()"| PP_T
    SA_A -->|"execute_task()"| SA_T
    TC_A -->|"execute_task()"| TC_T
    TP_A -->|"execute_task()"| TP_T

    IP_A -->|"invoke_tool()"| Browser
    IP_A -->|"invoke_tool()"| Calculator
    IP_A -->|"invoke_tool()"| ExaSearch
    IP_A -->|"invoke_tool()"| Search
    IP_A -->|"invoke_tool()"| Sec
    IP_A -->|"invoke_tool()"| ToolUtils

    MP_A -->|"invoke_tool()"| Browser
    MP_A -->|"invoke_tool()"| Calculator
    MP_A -->|"invoke_tool()"| ExaSearch
    MP_A -->|"invoke_tool()"| Search
    MP_A -->|"invoke_tool()"| Sec
    MP_A -->|"invoke_tool()"| ToolUtils

    PP_A -->|"invoke_tool()"| Browser
    PP_A -->|"invoke_tool()"| Calculator
    PP_A -->|"invoke_tool()"| ExaSearch
    PP_A -->|"invoke_tool()"| Search
    PP_A -->|"invoke_tool()"| Sec
    PP_A -->|"invoke_tool()"| ToolUtils

    SA_A -->|"invoke_tool()"| Browser
    SA_A -->|"invoke_tool()"| Calculator
    SA_A -->|"invoke_tool()"| ExaSearch
    SA_A -->|"invoke_tool()"| Search
    SA_A -->|"invoke_tool()"| Sec
    SA_A -->|"invoke_tool()"| ToolUtils

    TC_A -->|"invoke_tool()"| Browser
    TC_A -->|"invoke_tool()"| Calculator
    TC_A -->|"invoke_tool()"| ExaSearch
    TC_A -->|"invoke_tool()"| Search
    TC_A -->|"invoke_tool()"| Sec
    TC_A -->|"invoke_tool()"| ToolUtils

    TP_A -->|"invoke_tool()"| Browser
    TP_A -->|"invoke_tool()"| Calculator
    TP_A -->|"invoke_tool()"| ExaSearch
    TP_A -->|"invoke_tool()"| Search
    TP_A -->|"invoke_tool()"| Sec
    TP_A -->|"invoke_tool()"| ToolUtils

    subgraph "Common Utilities"
        TaskUtils
    end
    TaskUtils -->|"support()"| IP_A
    TaskUtils -->|"support()"| MP_A
    TaskUtils -->|"support()"| PP_A
    TaskUtils -->|"support()"| SA_A
    TaskUtils -->|"support()"| TC_A
    TaskUtils -->|"support()"| TP_A

    IP_A -->|"API call"| API
    MP_A -->|"API call"| API
    PP_A -->|"API call"| API
    SA_A -->|"API call"| API
    TC_A -->|"API call"| API
    TP_A -->|"API call"| API

    %% CI/CD
    subgraph "CI/CD Workflows"
        GH_Lint
        GH_Tests
    end
    CM --> GH_Lint
    CM --> GH_Tests
    IP_C --> GH_Lint
    IP_C --> GH_Tests

    %% Click Events
    click CM "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/interfaces/CrewManager.py"
    click TI "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/interfaces/TestInterface.py"
    click Models "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/models.py"
    click TaskUtils "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tasks_utils.py"
    click Browser "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/browser_tools.py"
    click Calculator "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/calculator_tools.py"
    click ExaSearch "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/exa_search_tools.py"
    click Search "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/search_tools.py"
    click Sec "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/sec_tools.py"
    click ToolUtils "https://github.com/uriafranko/taskforce/blob/main/taskforce/lib/tools/utils.py"
    click IP_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/instagram_post/agents.py"
    click IP_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/instagram_post/crew.py"
    click IP_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/instagram_post/tasks.py"
    click MP_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/meeting_prep/agents.py"
    click MP_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/meeting_prep/crew.py"
    click MP_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/meeting_prep/tasks.py"
    click PP_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/product_photographer/agents.py"
    click PP_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/product_photographer/crew.py"
    click PP_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/product_photographer/tasks.py"
    click SA_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/stock_analysis/agents.py"
    click SA_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/stock_analysis/crew.py"
    click SA_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/stock_analysis/tasks.py"
    click TC_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/template_crew/agents.py"
    click TC_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/template_crew/crew.py"
    click TC_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/template_crew/tasks.py"
    click TP_A "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/trip_planner/agents.py"
    click TP_C "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/trip_planner/crew.py"
    click TP_T "https://github.com/uriafranko/taskforce/blob/main/taskforce/crews/trip_planner/tasks.py"
    click main "https://github.com/uriafranko/taskforce/blob/main/taskforce/main.py"
    click Env "https://github.com/uriafranko/taskforce/blob/main/taskforce/.env.example"
    click Config "https://github.com/uriafranko/taskforce/blob/main/taskforce/pyproject.toml"
    click GH_Lint "https://github.com/uriafranko/taskforce/blob/main/.github/workflows/lint_commit.yml"
    click GH_Tests "https://github.com/uriafranko/taskforce/blob/main/.github/workflows/run_ruffus_tests.yml"
    click DevCont "https://github.com/uriafranko/taskforce/blob/main/.devcontainer/devcontainer.json"
    click DockerDev "https://github.com/uriafranko/taskforce/blob/main/Dockerfile.dev"

    %% Styles
    classDef core fill:#D6EAF8,stroke:#21618C,stroke-width:1px
    classDef plugin fill:#D5F5E3,stroke:#1D8348,stroke-width:1px
    classDef tool fill:#FAD7A0,stroke:#B9770E,stroke-width:1px
    classDef infra fill:#D5DBDB,stroke:#909497,stroke-width:1px
    classDef orchestrator fill:#EBDEF0,stroke:#7D3C98,stroke-width:1px
```
