# tulsyanlakshya009/relayforge architecture

> Architecture diagram of the GitHub repository tulsyanlakshya009/relayforge, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tulsyanlakshya009/relayforge
- Repository: https://github.com/tulsyanlakshya009/relayforge

## Overview

RelayForge is a local CLI for turning reviewed requirements into durable, ordered coding-agent work. Its main path runs from project initialization and human imports through task selection, agent execution, verification and saved results; bugs, planning, group gates and cooldown recovery are additional workflow branches. The excerpts show the CLI, orchestrator and adapter boundaries, but not every core method, so edges for documented capabilities without visible callers are omitted. The local SQLite state and generated project files are represented as stores and artifacts.

Main entry points: [`relayforge/core.py`](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py) (Task execution), [`relayforge/cli.py`](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py) (Command interface), [`relayforge/adapters.py`](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/adapters.py) (Agent adapters)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["CLI entry"]
  node_cli["Command interface<br/>[cli.py]"]
  node_init["Project initialization<br/>[cli.py]"]
end

subgraph group_workflow["Work orchestration"]
  node_requirements["Requirements import<br/>[core.py]"]
  node_planning["Brief planning<br/>[cli.py]"]
  node_scheduler["Task scheduling<br/>[core.py]"]
  node_execution["Task execution<br/>[core.py]"]
  node_verification["Test gates<br/>[core.py]"]
  node_bugqueue["Bug repairs<br/>[core.py]"]
  node_cooldown["Limit cooldown<br/>[core.py]"]
end

subgraph group_integration["Agent integration"]
  node_adapters["Agent adapters<br/>[adapters.py]"]
end

subgraph group_state["Project state"]
  node_state_db[("Queue and event state<br/>[core.py]")]
  node_project_files["Project workflow files<br/>[cli.py]"]
  node_reports["Agent reports and logs<br/>[core.py]"]
  node_history["Summaries and history<br/>[core.py]"]
end

node_user(("Project maintainer"))
node_coding_agent(("Coding agent"))
node_test_commands["Configured test commands"]
node_workspace["Application workspace"]

node_user -->|"runs commands"| node_cli
node_cli -->|"dispatches"| node_init
node_init -->|"creates templates"| node_project_files
node_init -->|"initializes"| node_state_db
node_cli -->|"dispatches imports"| node_requirements
node_requirements -->|"adds tasks"| node_state_db
node_cli -->|"queues brief"| node_planning
node_planning -->|"adds plan task"| node_state_db
node_cli -->|"ticks worker"| node_scheduler
node_scheduler -->|"selects tasks"| node_state_db
node_scheduler -->|"runs selected task"| node_execution
node_execution -->|"builds command"| node_adapters
node_adapters -->|"invokes"| node_coding_agent
node_execution -->|"agent edits"| node_workspace
node_execution -->|"reads report and log"| node_reports
node_execution -.->|"runs configured tests"| node_verification
node_verification -.->|"executes commands"| node_test_commands
node_execution -.->|"records reported bugs"| node_bugqueue
node_bugqueue -.->|"prioritizes repairs"| node_state_db
node_execution -->|"detects usage limits"| node_cooldown
node_cooldown -->|"parses reset signals"| node_adapters
node_cooldown -->|"saves resume time"| node_state_db
node_execution -->|"records outcome"| node_state_db
node_execution -->|"renders summaries"| node_history
node_user -->|"reviews requirements"| node_project_files
node_user -->|"configures checks"| node_test_commands

click node_cli "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py"
click node_init "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py"
click node_requirements "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_planning "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py"
click node_scheduler "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_execution "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_verification "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_bugqueue "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_cooldown "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_adapters "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/adapters.py"
click node_state_db "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_project_files "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py"
click node_reports "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"
click node_history "https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_init toneBlue
class node_requirements,node_planning,node_scheduler,node_execution,node_verification,node_bugqueue,node_cooldown toneAmber
class node_adapters toneMint
class node_state_db,node_project_files,node_reports,node_history toneRose
class node_user,node_coding_agent,node_test_commands,node_workspace toneIndigo
```

## Components

### CLI entry

- [Command interface](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py): `relayforge/cli.py`
- [Project initialization](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py): `relayforge/cli.py`

### Work orchestration

- [Requirements import](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Brief planning](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py): `relayforge/cli.py`
- [Task scheduling](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Task execution](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Test gates](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Bug repairs](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Limit cooldown](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`

### Agent integration

- [Agent adapters](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/adapters.py): `relayforge/adapters.py`

### Project state

- [Queue and event state](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Project workflow files](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/cli.py): `relayforge/cli.py`
- [Agent reports and logs](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`
- [Summaries and history](https://github.com/tulsyanlakshya009/relayforge/blob/main/relayforge/core.py): `relayforge/core.py`

### Other components

- **Project maintainer**
- **Coding agent**
- **Configured test commands**
- **Application workspace**

## Connections

- Project maintainer → Command interface: runs commands (evidence: `README.md`)
- Command interface → Project initialization: dispatches (evidence: `relayforge/cli.py`)
- Project initialization → Project workflow files: creates templates (evidence: `relayforge/cli.py`)
- Project initialization → Queue and event state: initializes (evidence: `relayforge/cli.py`)
- Command interface → Requirements import: dispatches imports (evidence: `relayforge/cli.py`)
- Requirements import → Queue and event state: adds tasks (evidence: `relayforge/core.py`)
- Command interface → Brief planning: queues brief (evidence: `relayforge/cli.py`)
- Brief planning → Queue and event state: adds plan task (evidence: `relayforge/cli.py`)
- Command interface → Task scheduling: ticks worker (evidence: `relayforge/cli.py`)
- Task scheduling → Queue and event state: selects tasks (evidence: `relayforge/core.py`)
- Task scheduling → Task execution: runs selected task (evidence: `relayforge/core.py`)
- Task execution → Agent adapters: builds command (evidence: `relayforge/core.py`)
- Agent adapters → Coding agent: invokes (evidence: `relayforge/adapters.py`)
- Task execution → Application workspace: agent edits (evidence: `README.md`)
- Task execution → Agent reports and logs: reads report and log (evidence: `relayforge/core.py`)
- Task execution → Test gates: runs configured tests (evidence: `relayforge/core.py`)
- Test gates → Configured test commands: executes commands
- Task execution → Bug repairs: records reported bugs (evidence: `relayforge/core.py`)
- Bug repairs → Queue and event state: prioritizes repairs (evidence: `relayforge/core.py`)
- Task execution → Limit cooldown: detects usage limits (evidence: `relayforge/core.py`)
- Limit cooldown → Agent adapters: parses reset signals (evidence: `relayforge/core.py`)
- Limit cooldown → Queue and event state: saves resume time (evidence: `relayforge/core.py`)
- Task execution → Queue and event state: records outcome (evidence: `relayforge/core.py`)
- Task execution → Summaries and history: renders summaries (evidence: `README.md`)
- Project maintainer → Project workflow files: reviews requirements (evidence: `README.md`)
- Project maintainer → Configured test commands: configures checks (evidence: `README.md`)
