# rajeev-exe/youtube-agent-studio architecture

> Architecture diagram of the GitHub repository rajeev-exe/youtube-agent-studio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/rajeev-exe/youtube-agent-studio
- Repository: https://github.com/rajeev-exe/youtube-agent-studio

## Overview

This repository combines a YouTube channel-processing application with eleven Claude skills and six standalone Python tools. In the application workflow, the pipeline discovers candidate videos, processes authorized sources through download, splitting and metadata stages, then coordinates scheduling and upload-related checks; SQLite holds workflow state. The README’s creator-facing skills separately produce scripts, packaging, editing, analytics and planning outputs, with publishing explicitly left to the user. Some application modules were not sampled, so their internal interactions are shown only where the excerpts or README support them.

Main entry points: [`pipeline.py`](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/pipeline.py) (Pipeline), [`storage.py`](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/storage.py) (SQLite state), [`run.py`](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/run.py) (Application runner), [`sources.py`](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/sources.py) (Trend discovery)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Application orchestration"]
  node_runner["Application runner<br/>[run.py]"]
  node_pipeline["Pipeline<br/>[pipeline.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_scheduler["Campaign scheduler<br/>[scheduler.py]"]
  node_uploader["Upload checks<br/>[uploader.py]"]
  node_monitor["Workflow monitor<br/>[monitor.py]"]
end

subgraph group_processing["Video processing"]
  node_downloader["Authorized download<br/>[downloader.py]"]
  node_splitter["Video splitting<br/>[splitter.py]"]
  node_metadata["Metadata generation<br/>[metadata.py]"]
  node_ai["AI client<br/>[ai.py]"]
  node_cleanup["Cleanup<br/>[cleanup.py]"]
end

subgraph group_discovery["Discovery and persistence"]
  node_discovery["Trend discovery<br/>[sources.py]"]
  node_youtube["YouTube API client<br/>[youtube_api.py]"]
  node_database[("SQLite state<br/>[storage.py]")]
  node_csvio["CSV I/O<br/>[csvio.py]"]
end

subgraph group_skills["Creator skills"]
  node_skill_script["Script writing<br/>[SKILL.md]"]
  node_skill_package["Title and thumbnail<br/>[SKILL.md]"]
  node_skill_edit["Edit decision list<br/>[SKILL.md]"]
  node_skill_comment["Comment triage<br/>[SKILL.md]"]
  node_skill_plan["Channel planning<br/>[SKILL.md]"]
  node_skill_viral["Niche research<br/>[SKILL.md]"]
  node_skill_retention["Retention analysis<br/>[SKILL.md]"]
  node_skill_shorts["Shorts ideas<br/>[SKILL.md]"]
  node_skill_seo["SEO guidance<br/>[SKILL.md]"]
  node_skill_chapters["Chapter creation<br/>[SKILL.md]"]
  node_skill_audit["Channel audit<br/>[SKILL.md]"]
end

subgraph group_tools["Standalone tools"]
  node_hookscore["Hook scoring<br/>[hookscore.py]"]
  node_title_tool["Pairing linter<br/>[title.py]"]
  node_deadair["Transcript analysis<br/>[deadair.py]"]
  node_chapters_tool["Chapter validator<br/>[chapters.py]"]
  node_retention_tool["Retention analyzer<br/>[retention.py]"]
  node_swipe_tool["Outlier ranking<br/>[swipe.py]"]
end

node_creator(("Channel creator"))

node_creator -->|"starts"| node_runner
node_runner -->|"runs"| node_pipeline
node_runner -->|"uses"| node_database
node_runner -->|"uses"| node_monitor
node_pipeline -->|"downloads"| node_downloader
node_pipeline -->|"splits"| node_splitter
node_pipeline -->|"generates metadata"| node_metadata
node_pipeline -->|"discovers"| node_discovery
node_pipeline -->|"coordinates"| node_scheduler
node_pipeline -->|"coordinates"| node_uploader
node_pipeline -->|"updates state"| node_database
node_metadata -->|"uses"| node_ai
node_downloader -->|"reads rights"| node_database
node_splitter -->|"records clips"| node_database
node_scheduler -->|"reserves slots"| node_database
node_uploader -->|"checks clips"| node_database
node_discovery -->|"searches videos"| node_youtube
node_discovery -->|"classifies candidates"| node_ai
node_discovery -->|"stores candidates"| node_database
node_creator -->|"requests"| node_skill_script
node_creator -->|"requests"| node_skill_package
node_creator -->|"requests"| node_skill_edit
node_creator -->|"requests"| node_skill_comment
node_creator -->|"requests"| node_skill_plan
node_creator -->|"requests"| node_skill_viral
node_creator -->|"requests"| node_skill_retention
node_creator -->|"requests"| node_skill_shorts
node_creator -->|"requests"| node_skill_seo
node_creator -->|"requests"| node_skill_chapters
node_creator -->|"requests"| node_skill_audit
node_skill_script -->|"uses"| node_hookscore
node_skill_package -->|"uses"| node_title_tool
node_skill_edit -->|"uses"| node_deadair
node_skill_chapters -->|"uses"| node_chapters_tool
node_skill_retention -->|"uses"| node_retention_tool
node_skill_viral -->|"uses"| node_swipe_tool
node_retention_tool -->|"loads transcript cues"| node_deadair
node_chapters_tool -->|"imports"| node_deadair

click node_runner "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/run.py"
click node_pipeline "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/pipeline.py"
click node_config "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/config.py"
click node_scheduler "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/scheduler.py"
click node_uploader "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/uploader.py"
click node_downloader "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/downloader.py"
click node_splitter "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/splitter.py"
click node_metadata "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/metadata.py"
click node_ai "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/ai.py"
click node_cleanup "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/cleanup.py"
click node_discovery "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/sources.py"
click node_youtube "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/youtube_api.py"
click node_database "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/storage.py"
click node_csvio "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/csvio.py"
click node_monitor "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/monitor.py"
click node_skill_script "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-script/SKILL.md"
click node_skill_package "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-package/SKILL.md"
click node_skill_edit "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-edit/SKILL.md"
click node_skill_comment "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-comment/SKILL.md"
click node_skill_plan "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-plan/SKILL.md"
click node_skill_viral "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-viral/SKILL.md"
click node_skill_retention "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-retention/SKILL.md"
click node_skill_shorts "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-shorts/SKILL.md"
click node_skill_seo "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-seo/SKILL.md"
click node_skill_chapters "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-chapters/SKILL.md"
click node_skill_audit "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-audit/SKILL.md"
click node_hookscore "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-script/hookscore.py"
click node_title_tool "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-package/title.py"
click node_deadair "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-edit/deadair.py"
click node_chapters_tool "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-chapters/chapters.py"
click node_retention_tool "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-retention/retention.py"
click node_swipe_tool "https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-viral/swipe.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_runner,node_pipeline,node_config,node_scheduler,node_uploader,node_monitor toneBlue
class node_downloader,node_splitter,node_metadata,node_ai,node_cleanup toneAmber
class node_discovery,node_youtube,node_database,node_csvio toneMint
class node_skill_script,node_skill_package,node_skill_edit,node_skill_comment,node_skill_plan,node_skill_viral,node_skill_retention,node_skill_shorts,node_skill_seo,node_skill_chapters,node_skill_audit toneRose
class node_hookscore,node_title_tool,node_deadair,node_chapters_tool,node_retention_tool,node_swipe_tool,node_creator toneIndigo
```

## Components

### Application orchestration

- [Application runner](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/run.py): `run.py`
- [Pipeline](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/pipeline.py): `pipeline.py`
- [Configuration](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/config.py): `config.py`
- [Campaign scheduler](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/scheduler.py): `scheduler.py`
- [Upload checks](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/uploader.py): `uploader.py`
- [Workflow monitor](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/monitor.py): `monitor.py`

### Video processing

- [Authorized download](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/downloader.py): `downloader.py`
- [Video splitting](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/splitter.py): `splitter.py`
- [Metadata generation](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/metadata.py): `metadata.py`
- [AI client](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/ai.py): `ai.py`
- [Cleanup](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/cleanup.py): `cleanup.py`

### Discovery and persistence

- [Trend discovery](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/sources.py): `sources.py`
- [YouTube API client](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/youtube_api.py): `youtube_api.py`
- [SQLite state](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/storage.py): `storage.py`
- [CSV I/O](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/csvio.py): `csvio.py`

### Creator skills

- [Script writing](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-script/SKILL.md): `skills/yt-script/SKILL.md`
- [Title and thumbnail](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-package/SKILL.md): `skills/yt-package/SKILL.md`
- [Edit decision list](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-edit/SKILL.md): `skills/yt-edit/SKILL.md`
- [Comment triage](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-comment/SKILL.md): `skills/yt-comment/SKILL.md`
- [Channel planning](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-plan/SKILL.md): `skills/yt-plan/SKILL.md`
- [Niche research](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-viral/SKILL.md): `skills/yt-viral/SKILL.md`
- [Retention analysis](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-retention/SKILL.md): `skills/yt-retention/SKILL.md`
- [Shorts ideas](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-shorts/SKILL.md): `skills/yt-shorts/SKILL.md`
- [SEO guidance](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-seo/SKILL.md): `skills/yt-seo/SKILL.md`
- [Chapter creation](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-chapters/SKILL.md): `skills/yt-chapters/SKILL.md`
- [Channel audit](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-audit/SKILL.md): `skills/yt-audit/SKILL.md`

### Standalone tools

- [Hook scoring](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-script/hookscore.py): `skills/yt-script/hookscore.py`
- [Pairing linter](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-package/title.py): `skills/yt-package/title.py`
- [Transcript analysis](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-edit/deadair.py): `skills/yt-edit/deadair.py`
- [Chapter validator](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-chapters/chapters.py): `skills/yt-chapters/chapters.py`
- [Retention analyzer](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-retention/retention.py): `skills/yt-retention/retention.py`
- [Outlier ranking](https://github.com/rajeev-exe/youtube-agent-studio/blob/main/skills/yt-viral/swipe.py): `skills/yt-viral/swipe.py`

### Other components

- **Channel creator**

## Connections

- Channel creator → Application runner: starts (evidence: `README.md`)
- Application runner → Pipeline: runs (evidence: `run.py`)
- Application runner → SQLite state: uses (evidence: `run.py`)
- Application runner → Workflow monitor: uses (evidence: `run.py`)
- Pipeline → Authorized download: downloads (evidence: `pipeline.py`)
- Pipeline → Video splitting: splits (evidence: `pipeline.py`)
- Pipeline → Metadata generation: generates metadata (evidence: `pipeline.py`)
- Pipeline → Trend discovery: discovers (evidence: `pipeline.py`)
- Pipeline → Campaign scheduler: coordinates (evidence: `pipeline.py`)
- Pipeline → Upload checks: coordinates (evidence: `pipeline.py`)
- Pipeline → SQLite state: updates state (evidence: `pipeline.py`)
- Metadata generation → AI client: uses (evidence: `metadata.py`)
- Authorized download → SQLite state: reads rights (evidence: `downloader.py`)
- Video splitting → SQLite state: records clips (evidence: `splitter.py`)
- Campaign scheduler → SQLite state: reserves slots (evidence: `scheduler.py`)
- Upload checks → SQLite state: checks clips (evidence: `uploader.py`)
- Trend discovery → YouTube API client: searches videos (evidence: `sources.py`)
- Trend discovery → AI client: classifies candidates (evidence: `sources.py`)
- Trend discovery → SQLite state: stores candidates (evidence: `sources.py`)
- Channel creator → Script writing: requests (evidence: `README.md`)
- Channel creator → Title and thumbnail: requests (evidence: `README.md`)
- Channel creator → Edit decision list: requests (evidence: `README.md`)
- Channel creator → Comment triage: requests (evidence: `README.md`)
- Channel creator → Channel planning: requests (evidence: `README.md`)
- Channel creator → Niche research: requests (evidence: `README.md`)
- Channel creator → Retention analysis: requests (evidence: `README.md`)
- Channel creator → Shorts ideas: requests (evidence: `README.md`)
- Channel creator → SEO guidance: requests (evidence: `README.md`)
- Channel creator → Chapter creation: requests (evidence: `README.md`)
- Channel creator → Channel audit: requests (evidence: `README.md`)
- Script writing → Hook scoring: uses (evidence: `README.md`)
- Title and thumbnail → Pairing linter: uses (evidence: `README.md`)
- Edit decision list → Transcript analysis: uses (evidence: `README.md`)
- Chapter creation → Chapter validator: uses (evidence: `README.md`)
- Retention analysis → Retention analyzer: uses (evidence: `README.md`)
- Niche research → Outlier ranking: uses (evidence: `README.md`)
- Retention analyzer → Transcript analysis: loads transcript cues (evidence: `skills/yt-retention/retention.py`)
- Chapter validator → Transcript analysis: imports (evidence: `skills/yt-chapters/chapters.py`)
