# buildfastwithai/talking-avatar architecture

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

- Interactive diagram: https://gitdiagram.com/buildfastwithai/talking-avatar
- Repository: https://github.com/buildfastwithai/talking-avatar

## Overview

Talking Avatar is an agent skill that guides an assistant from a photo or character description to a generated, validated avatar and a realtime voice-chat app. Its main workflow covers character specification, portrait and mouth-sprite creation, app scaffolding, audio-driven lip sync, and validation. The README documents the overall workflow and capabilities; the sampled scripts show how scaffolding copies starter templates and how asset dimensions are checked. Starter app internals are not mapped because their source was not sampled.

Main entry points: [`SKILL.md`](https://github.com/buildfastwithai/talking-avatar/blob/main/SKILL.md) (Skill recipe), [`references/app-contract.md`](https://github.com/buildfastwithai/talking-avatar/blob/main/references/app-contract.md) (App and key flow), [`references/image-pipeline.md`](https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md) (Portrait and sprites), [`scripts/scaffold_app.py`](https://github.com/buildfastwithai/talking-avatar/blob/main/scripts/scaffold_app.py) (App scaffolder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_skill["Skill workflow"]
  node_skillguide["Skill recipe<br/>[SKILL.md]"]
  node_characterinput["Character input<br/>[SKILL.md]"]
  node_visualspec["Visual specification<br/>[image-pipeline.md]"]
end

subgraph group_assets["Avatar assets"]
  node_imagepipeline["Image pipeline<br/>[image-pipeline.md]"]
  node_portrait["Portrait and sprites<br/>[image-pipeline.md]"]
  node_assetvalidator["Asset validator"]
end

subgraph group_app["Realtime app"]
  node_scaffolder["App scaffolder<br/>[scaffold_app.py]"]
  node_startertemplates["Starter templates"]
  node_appcontract["App and key flow<br/>[app-contract.md]"]
  node_realtime["Realtime session<br/>[route.ts.tmpl]"]
  node_avatarui["Avatar interface"]
  node_lipsync["Audio lip sync"]
end

node_assistant(("AI assistant"))

node_assistant -->|"uses skill"| node_skillguide
node_skillguide -->|"guides input"| node_characterinput
node_characterinput -->|"normalizes description"| node_visualspec
node_visualspec -->|"guides generation"| node_imagepipeline
node_imagepipeline -->|"creates assets"| node_portrait
node_portrait -->|"validates assets"| node_assetvalidator
node_skillguide -->|"invokes scaffold"| node_scaffolder
node_scaffolder -->|"copies templates"| node_startertemplates
node_startertemplates -->|"follows contract"| node_appcontract
node_appcontract -->|"defines session flow"| node_realtime
node_appcontract -->|"defines app behavior"| node_avatarui
node_avatarui -->|"uses lip-sync contract"| node_lipsync
node_lipsync -->|"animates mouth patches"| node_portrait

click node_skillguide "https://github.com/buildfastwithai/talking-avatar/blob/main/SKILL.md"
click node_characterinput "https://github.com/buildfastwithai/talking-avatar/blob/main/SKILL.md"
click node_visualspec "https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md"
click node_imagepipeline "https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md"
click node_portrait "https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md"
click node_assetvalidator "https://github.com/buildfastwithai/talking-avatar/blob/main/scripts/validate_avatar_assets.py"
click node_scaffolder "https://github.com/buildfastwithai/talking-avatar/blob/main/scripts/scaffold_app.py"
click node_startertemplates "https://github.com/buildfastwithai/talking-avatar/tree/main/assets/starter"
click node_appcontract "https://github.com/buildfastwithai/talking-avatar/blob/main/references/app-contract.md"
click node_realtime "https://github.com/buildfastwithai/talking-avatar/blob/main/assets/starter/app/api/realtime/session/route.ts.tmpl"
click node_avatarui "https://github.com/buildfastwithai/talking-avatar/blob/main/assets/starter/app/TalkingAvatarApp.tsx.tmpl"
click node_lipsync "https://github.com/buildfastwithai/talking-avatar/blob/main/references/realtime-lipsync.md"

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_skillguide,node_characterinput,node_visualspec toneBlue
class node_imagepipeline,node_portrait,node_assetvalidator toneAmber
class node_scaffolder,node_startertemplates,node_appcontract,node_realtime,node_avatarui,node_lipsync toneMint
class node_assistant toneIndigo
```

## Components

### Skill workflow

- [Skill recipe](https://github.com/buildfastwithai/talking-avatar/blob/main/SKILL.md): `SKILL.md`
- [Character input](https://github.com/buildfastwithai/talking-avatar/blob/main/SKILL.md): `SKILL.md`
- [Visual specification](https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md): `references/image-pipeline.md`

### Avatar assets

- [Image pipeline](https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md): `references/image-pipeline.md`
- [Portrait and sprites](https://github.com/buildfastwithai/talking-avatar/blob/main/references/image-pipeline.md): `references/image-pipeline.md`
- [Asset validator](https://github.com/buildfastwithai/talking-avatar/blob/main/scripts/validate_avatar_assets.py): `scripts/validate_avatar_assets.py`

### Realtime app

- [App scaffolder](https://github.com/buildfastwithai/talking-avatar/blob/main/scripts/scaffold_app.py): `scripts/scaffold_app.py`
- [Starter templates](https://github.com/buildfastwithai/talking-avatar/tree/main/assets/starter): `assets/starter`
- [App and key flow](https://github.com/buildfastwithai/talking-avatar/blob/main/references/app-contract.md): `references/app-contract.md`
- [Realtime session](https://github.com/buildfastwithai/talking-avatar/blob/main/assets/starter/app/api/realtime/session/route.ts.tmpl): `assets/starter/app/api/realtime/session/route.ts.tmpl`
- [Avatar interface](https://github.com/buildfastwithai/talking-avatar/blob/main/assets/starter/app/TalkingAvatarApp.tsx.tmpl): `assets/starter/app/TalkingAvatarApp.tsx.tmpl`
- [Audio lip sync](https://github.com/buildfastwithai/talking-avatar/blob/main/references/realtime-lipsync.md): `references/realtime-lipsync.md`

### Other components

- **AI assistant**

## Connections

- AI assistant → Skill recipe: uses skill (evidence: `README.md`)
- Skill recipe → Character input: guides input (evidence: `README.md`)
- Character input → Visual specification: normalizes description (evidence: `README.md`)
- Visual specification → Image pipeline: guides generation (evidence: `README.md`)
- Image pipeline → Portrait and sprites: creates assets (evidence: `README.md`)
- Portrait and sprites → Asset validator: validates assets (evidence: `README.md`)
- Skill recipe → App scaffolder: invokes scaffold (evidence: `README.md`)
- App scaffolder → Starter templates: copies templates (evidence: `scripts/scaffold_app.py`)
- Starter templates → App and key flow: follows contract (evidence: `README.md`)
- App and key flow → Realtime session: defines session flow (evidence: `README.md`)
- App and key flow → Avatar interface: defines app behavior (evidence: `README.md`)
- Avatar interface → Audio lip sync: uses lip-sync contract (evidence: `README.md`)
- Audio lip sync → Portrait and sprites: animates mouth patches (evidence: `README.md`)
