# hheydaroff/rooflow-cookiecutter architecture

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

- Interactive diagram: https://gitdiagram.com/hheydaroff/rooflow-cookiecutter
- Repository: https://github.com/hheydaroff/rooflow-cookiecutter

## Overview

##### Project’s Purpose and Type
- This is a Cookiecutter template designed to generate RooFlow projects.
- RooFlow’s core purpose is to enable AI-assisted development through persistent context across sessions. This involves configuring system prompts for various development modes (coding, debugging, architecture planning, etc.), managing environment variables, and optionally integrating memory banks and UVX for Python package management.

##### Break Down the Main Components
A. Template & Configuration Files
- Cookiecutter Metadata: The cookiecutter.json file provides variables for generating project-specific values (e.g., project_name, project_slug). This determines the final project structure.
- License, README, CONTRIBUTING.md: Standard project documentation and licensing files.

B. RooFlow Core Integration
- System Prompts Directory:
- .rooignore and .roomodes further configure what aspects of the project should be included/excluded in AI interactions.
- Roo Configuration (roo_config Directory):
- Contains environment variable setup scripts for both Windows (insert-variables.cmd) and Unix/Mac (insert-variables.sh).
- The default-mode subdirectory (if enabled) holds files for custom AI assistant behavior: custom instructions (custom-instructions.yaml), role definitions (role-definition.txt), custom modes (cline_custom_modes.json) and accompanying documentation.

C. Optional Enhancements
- Memory Bank Templates:
- If enabled, the memory-bank directory holds templates (with its own README) for storing project-specific context across AI sessions.
- UVX Integration (for enhanced package management):
- Additional directories and files (.uv, uv.toml, uv-setup.cmd, uv-setup.sh, requirements.txt) provide configuration for UVX, including a virtual environment setup.

##### Inter-component Relationships & Data Flow
- The cookiecutter engine uses the cookiecutter.json configuration to scaffold the projects, injecting project-specific values into every generated file.
- The system prompt components (.roo in different locations) serve as the interface for the AI assistant, controlling mode switches (code, architect, debug, etc.).
- The roo_config directory not only holds configuration aspects but also provides environment variable setup scripts that bind the local development context to the AI assistant.
- If memory bank templates are included, they act as a repository that the AI can tap into for context propagation.

##### Architectural Patterns & Technologies
- The template encourages a separation-of-concerns:
- System prompt management for AI operations,
- Configuration and environment setup (separate scripts for Windows vs Unix/Mac),
- Extensibility through default mode settings and memory bank usage.
- That the architectural style leans towards a modular and extensible design where each component (system prompts, configuration, memory bank, etc.) can be developed or modified independently.
- Technologies involved include Python 3.6+ (for the template’s runtime), Cookiecutter itself, and optionally UVX for package management.

## Diagram (Mermaid)

```mermaid
flowchart TD
    Engine["RooFlow Cookiecutter Template Engine"]:::engine

    subgraph "Cookiecutter Metadata & Scaffolding"
        CC1["cookiecutter.json"]:::config
        CC2["LICENSE"]:::config
        CC3["README.md"]:::config
        subgraph "Generated Project Files"
            CC4["CONTRIBUTING.md"]:::doc
            CC5["README.md"]:::doc
        end
    end

    subgraph "System Prompts (.roo & .roomodes)"
        SP1[".roo (system prompts)"]:::prompts
        SP2[".rooignore"]:::prompts
        SP3[".roomodes"]:::prompts
    end

    subgraph "RooConfig & Environment Setup"
        RC1["roo_config"]:::config
        RC2["insert-variables.cmd"]:::script
        RC3["insert-variables.sh"]:::script
    end

    subgraph "Default Mode Configuration"
        DM1["default-mode"]:::config
        DM2["custom-instructions.yaml"]:::config
        DM3["role-definition.txt"]:::config
        DM4["cline_custom_modes.json"]:::config
        DM5["README.md"]:::doc
    end

    MemoryBank["Memory Bank Templates (Optional)"]:::optional
    UVX["UVX Integration (Optional)"]:::optional

    Engine -->|"scaffolds"| CC1
    Engine -->|"scaffolds"| SP1
    Engine -->|"scaffolds"| RC1
    Engine -->|"scaffolds"| DM1
    Engine -->|"optionally integrates"| MemoryBank
    Engine -->|"optionally integrates"| UVX

    RC1 -->|"provides env vars"| RC2
    RC1 -->|"provides env vars"| RC3
    RC1 -->|"includes default-mode config"| DM1
    SP1 -->|"configures AI prompts"| SP2
    SP1 -->|"configures AI prompts"| SP3

    %% Click Events for Cookiecutter Metadata & Scaffolding
    click CC1 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/cookiecutter.json"
    click CC2 "https://github.com/hheydaroff/rooflow-cookiecutter/tree/main/LICENSE"
    click CC3 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/README.md"
    click CC4 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/CONTRIBUTING.md"
    click CC5 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/README.md"

    %% Click Events for System Prompts (.roo & .roomodes)
    click SP1 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/.roo"
    click SP2 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/.rooignore"
    click SP3 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/.roomodes"

    %% Click Events for RooConfig & Environment Setup
    click RC1 "https://github.com/hheydaroff/rooflow-cookiecutter/tree/main/{{cookiecutter.project_slug}}/roo_config"
    click RC2 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/insert-variables.cmd"
    click RC3 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/insert-variables.sh"

    %% Click Events for Default Mode Configuration
    click DM1 "https://github.com/hheydaroff/rooflow-cookiecutter/tree/main/{{cookiecutter.project_slug}}/roo_config/default-mode"
    click DM2 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/default-mode/custom-instructions.yaml"
    click DM3 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/default-mode/role-definition.txt"
    click DM4 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/default-mode/cline_custom_modes.json"
    click DM5 "https://github.com/hheydaroff/rooflow-cookiecutter/blob/main/{{cookiecutter.project_slug}}/roo_config/default-mode/README.md"

    %% Styles
    classDef engine fill:#ffcc00,stroke:#333,stroke-width:2px;
    classDef config fill:#cce5ff,stroke:#333,stroke-width:1px;
    classDef prompts fill:#d4edda,stroke:#333,stroke-width:1px;
    classDef script fill:#ffe6cc,stroke:#333,stroke-width:1px;
    classDef doc fill:#e2e3e5,stroke:#333,stroke-width:1px;
    classDef optional fill:#f8d7da,stroke:#333,stroke-width:1px;
```
