# threerocks/hand-drawn-styles architecture

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

- Interactive diagram: https://gitdiagram.com/threerocks/hand-drawn-styles
- Repository: https://github.com/threerocks/hand-drawn-styles

## Overview

hand-drawn-styles is an agent-agnostic library of 21 hand-drawn image-style prompt recipes. The principal workflow is: an agent follows the protocol, selects a style and supplies content, then the renderer fills the recipe and returns a copyable prompt; image generation is performed separately by the user’s chosen model. Styles requiring reference images resolve them through a manifest-backed cache. The README documents these capabilities; the source excerpts show renderer-to-image-helper calls, but do not expose every protocol-to-script detail.

Main entry points: [`scripts/render_prompt.py`](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/render_prompt.py) (Prompt renderer), [`scripts/hosted_images.py`](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/hosted_images.py) (Image resolver), [`PROTOCOL.md`](https://github.com/threerocks/hand-drawn-styles/blob/main/PROTOCOL.md) (Usage protocol), [`scripts/validate_style_20_asset.py`](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/validate_style_20_asset.py) (Style 20 gate)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Prompt workflow"]
  node_protocol["Usage protocol<br/>[PROTOCOL.md]"]
  node_renderer["Prompt renderer<br/>[render_prompt.py]"]
  node_prompt["Final prompt"]
end

subgraph group_recipes["Style recipes"]
  node_recipes_file["Style catalog<br/>[STYLES.md]"]
end

subgraph group_references["Reference images"]
  node_image_helper["Image resolver<br/>[hosted_images.py]"]
  node_manifest["Image manifest"]
end

subgraph group_production["Production validation"]
  node_style20_validator["Style 20 gate"]
end

node_agent(("AI agent"))
node_image_model(("Image model"))
node_host["Netlify image host"]

node_agent -->|"follows"| node_protocol
node_protocol -.->|"guides use"| node_renderer
node_renderer -->|"extracts recipe"| node_recipes_file
node_renderer -->|"resolves references"| node_image_helper
node_image_helper -->|"reads records"| node_manifest
node_image_helper -->|"downloads images"| node_host
node_renderer -->|"renders prompt"| node_prompt
node_prompt -->|"used separately"| node_image_model
node_agent -.->|"supplies content"| node_renderer
node_style20_validator -->|"uses PNG decoder"| node_renderer

click node_protocol "https://github.com/threerocks/hand-drawn-styles/blob/main/PROTOCOL.md"
click node_renderer "https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/render_prompt.py"
click node_recipes_file "https://github.com/threerocks/hand-drawn-styles/blob/main/STYLES.md"
click node_image_helper "https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/hosted_images.py"
click node_manifest "https://github.com/threerocks/hand-drawn-styles/blob/main/assets/image-manifest.json"
click node_style20_validator "https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/validate_style_20_asset.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_protocol,node_renderer,node_prompt toneBlue
class node_recipes_file toneAmber
class node_image_helper,node_manifest toneMint
class node_style20_validator toneRose
class node_agent,node_image_model,node_host toneIndigo
```

## Components

### Prompt workflow

- [Usage protocol](https://github.com/threerocks/hand-drawn-styles/blob/main/PROTOCOL.md): `PROTOCOL.md`
- [Prompt renderer](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/render_prompt.py): `scripts/render_prompt.py`
- **Final prompt**

### Style recipes

- [Style catalog](https://github.com/threerocks/hand-drawn-styles/blob/main/STYLES.md): `STYLES.md`

### Reference images

- [Image resolver](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/hosted_images.py): `scripts/hosted_images.py`
- [Image manifest](https://github.com/threerocks/hand-drawn-styles/blob/main/assets/image-manifest.json): `assets/image-manifest.json`

### Production validation

- [Style 20 gate](https://github.com/threerocks/hand-drawn-styles/blob/main/scripts/validate_style_20_asset.py): `scripts/validate_style_20_asset.py`

### Other components

- **AI agent**
- **Image model**
- **Netlify image host**

## Connections

- AI agent → Usage protocol: follows (evidence: `README.md`)
- Usage protocol → Prompt renderer: guides use
- Prompt renderer → Style catalog: extracts recipe (evidence: `scripts/render_prompt.py`)
- Prompt renderer → Image resolver: resolves references (evidence: `scripts/render_prompt.py`)
- Image resolver → Image manifest: reads records (evidence: `README.md`)
- Image resolver → Netlify image host: downloads images (evidence: `scripts/hosted_images.py`)
- Prompt renderer → Final prompt: renders prompt (evidence: `README.md`)
- Final prompt → Image model: used separately (evidence: `README.md`)
- AI agent → Prompt renderer: supplies content
- Style 20 gate → Prompt renderer: uses PNG decoder (evidence: `scripts/validate_style_20_asset.py`)
