# hxelec/slopmachine architecture

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

- Interactive diagram: https://gitdiagram.com/hxelec/slopmachine
- Repository: https://github.com/hxelec/slopmachine

## Overview

This is a command-line video repurposing tool: it turns one long video into rendered vertical Shorts, caption files, and upload metadata. The main workflow transcribes locally, asks Claude to select clips, then renders every selection without an approval step. A separate re-render command lets users edit a title or caption and regenerate one clip. The README documents caching and outputs; sampled source confirms the Claude call and re-render helper reuse. Some orchestration and rendering details are omitted from the excerpts, so those links rely on README statements.

Main entry points: [`run_pipeline.py`](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py) (Pipeline CLI), [`rerender_clip.py`](https://github.com/hxelec/slopmachine/blob/main/rerender_clip.py) (Re-render CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Clip workflow"]
  node_video["Source video"]
  node_pipeline["Pipeline CLI<br/>[run_pipeline.py]"]
  node_transcription["Transcription<br/>[run_pipeline.py]"]
  node_transcript["Transcript cache<br/>[run_pipeline.py]"]
  node_selection["Clip selection<br/>[run_pipeline.py]"]
  node_candidates["Clip candidates<br/>[run_pipeline.py]"]
end

subgraph group_rendering["Rendering and outputs"]
  node_renderer["Clip renderer<br/>[run_pipeline.py]"]
  node_captions["Caption builder<br/>[run_pipeline.py]"]
  node_upload_info["Upload metadata<br/>[run_pipeline.py]"]
  node_outputs["Shorts output<br/>[run_pipeline.py]"]
end

subgraph group_rerender["Single-clip rerender"]
  node_rerender_cli["Re-render CLI<br/>[rerender_clip.py]"]
  node_render_helpers["Render helpers<br/>[run_pipeline.py]"]
end

node_user(("Video operator"))
node_claude(("Claude API"))
node_editor(("Manual editor"))

node_user -->|"runs"| node_pipeline
node_pipeline -->|"reads"| node_video
node_pipeline -->|"invokes"| node_transcription
node_transcription -->|"caches"| node_transcript
node_pipeline -->|"reuses cache"| node_transcript
node_pipeline -->|"invokes"| node_selection
node_selection -->|"requests selections"| node_claude
node_selection -->|"caches selections"| node_candidates
node_pipeline -->|"renders selections"| node_renderer
node_renderer -->|"builds"| node_captions
node_renderer -->|"generates"| node_upload_info
node_renderer -->|"writes"| node_outputs
node_user -->|"edits files"| node_editor
node_editor -->|"runs"| node_rerender_cli
node_rerender_cli -->|"reads"| node_video
node_rerender_cli -->|"reads"| node_candidates
node_rerender_cli -->|"reads edited files"| node_captions
node_rerender_cli -->|"reuses"| node_render_helpers
node_rerender_cli -->|"writes clip"| node_outputs

click node_pipeline "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_transcription "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_transcript "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_selection "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_candidates "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_renderer "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_captions "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_upload_info "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_outputs "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py"
click node_rerender_cli "https://github.com/hxelec/slopmachine/blob/main/rerender_clip.py"
click node_render_helpers "https://github.com/hxelec/slopmachine/blob/main/run_pipeline.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_video,node_pipeline,node_transcription,node_transcript,node_selection,node_candidates toneBlue
class node_renderer,node_captions,node_upload_info,node_outputs toneAmber
class node_rerender_cli,node_render_helpers,node_claude toneMint
class node_user,node_editor toneIndigo
```

## Components

### Clip workflow

- **Source video**
- [Pipeline CLI](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Transcription](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Transcript cache](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Clip selection](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Clip candidates](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`

### Rendering and outputs

- [Clip renderer](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Caption builder](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Upload metadata](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`
- [Shorts output](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`

### Single-clip rerender

- [Re-render CLI](https://github.com/hxelec/slopmachine/blob/main/rerender_clip.py): `rerender_clip.py`
- [Render helpers](https://github.com/hxelec/slopmachine/blob/main/run_pipeline.py): `run_pipeline.py`

### Other components

- **Video operator**
- **Claude API**
- **Manual editor**

## Connections

- Video operator → Pipeline CLI: runs (evidence: `README.md`)
- Pipeline CLI → Source video: reads (evidence: `README.md`)
- Pipeline CLI → Transcription: invokes (evidence: `README.md`)
- Transcription → Transcript cache: caches (evidence: `README.md`)
- Pipeline CLI → Transcript cache: reuses cache (evidence: `README.md`)
- Pipeline CLI → Clip selection: invokes (evidence: `README.md`)
- Clip selection → Claude API: requests selections (evidence: `run_pipeline.py`)
- Clip selection → Clip candidates: caches selections (evidence: `README.md`)
- Pipeline CLI → Clip renderer: renders selections (evidence: `README.md`)
- Clip renderer → Caption builder: builds (evidence: `run_pipeline.py`)
- Clip renderer → Upload metadata: generates (evidence: `run_pipeline.py`)
- Clip renderer → Shorts output: writes (evidence: `README.md`)
- Video operator → Manual editor: edits files (evidence: `README.md`)
- Manual editor → Re-render CLI: runs (evidence: `README.md`)
- Re-render CLI → Source video: reads (evidence: `rerender_clip.py`)
- Re-render CLI → Clip candidates: reads (evidence: `rerender_clip.py`)
- Re-render CLI → Caption builder: reads edited files (evidence: `rerender_clip.py`)
- Re-render CLI → Render helpers: reuses (evidence: `rerender_clip.py`)
- Re-render CLI → Shorts output: writes clip (evidence: `rerender_clip.py`)
