# with-pebbly/aseprite-ai-artist architecture

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

- Interactive diagram: https://gitdiagram.com/with-pebbly/aseprite-ai-artist
- Repository: https://github.com/with-pebbly/aseprite-ai-artist

## Overview

Aseprite AI Artist is an agent-facing MCP control layer that lets coding agents inspect and edit the user’s open Aseprite document, with explicit headless operation as an alternative. The documented workflow connects, plans, draws, animates, reviews, and exports; the sampled implementation evidence most clearly supports the MCP-to-tool-to-Aseprite path and grid-based drawing. The repository also includes a public pixel-art gallery and knowledge website. Some documented capabilities are represented at their enclosing directory because their implementation files were not included in the source excerpts.

Main entry points: [`src/server.ts`](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/server.ts) (MCP server), [`src/bridge/selector.ts`](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/selector.ts) (Mode selector), [`src/bridge/client.ts`](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/client.ts) (Live client), [`src/tools/draw.ts`](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/draw.ts) (Drawing tools)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Agent entry"]
  node_cli["CLI commands<br/>[cli.ts]"]
  node_mcp["MCP server<br/>[server.ts]"]
  node_skills["Skills and rules<br/>[skills.ts]"]
end

subgraph group_control["Aseprite control"]
  node_selector["Mode selector<br/>[selector.ts]"]
  node_live["Live client<br/>[client.ts]"]
  node_headless["Headless client<br/>[headless.ts]"]
  node_bridge["WebSocket bridge<br/>[bridge.ts]"]
  node_extension["Aseprite extension<br/>[extension.ts]"]
  node_protocol["Wire protocol<br/>[protocol.ts]"]
end

subgraph group_tools["Art tools"]
  node_session["Session tools<br/>[session.ts]"]
  node_drawing["Drawing tools<br/>[draw.ts]"]
  node_looking["Canvas inspection<br/>[look.ts]"]
  node_palette["Palette tools<br/>[palette.ts]"]
  node_assets["Asset tools<br/>[assets.ts]"]
  node_craft["Craft tools<br/>[craft.ts]"]
  node_structure["Sprite structure<br/>[structure.ts]"]
  node_escape["Escape tools<br/>[escape.ts]"]
  node_grid["Grid utilities<br/>[grid.ts]"]
  node_text["Bitmap text<br/>[text.ts]"]
  node_render["Preview rendering<br/>[render.ts]"]
end

subgraph group_web["Public gallery"]
  node_web["Pixel-art website"]
  node_gallery["Gallery data<br/>[load.ts]"]
  node_knowledge["Knowledge content"]
end

node_agent(("Coding agent"))
node_visitor(("Website visitor"))

node_agent -->|"invokes"| node_cli
node_cli -->|"starts server"| node_mcp
node_mcp -->|"creates"| node_selector
node_mcp -->|"loads"| node_skills
node_mcp -.->|"registers"| node_session
node_mcp -.->|"registers"| node_drawing
node_mcp -.->|"registers"| node_looking
node_mcp -.->|"registers"| node_palette
node_mcp -.->|"registers"| node_assets
node_mcp -.->|"registers"| node_craft
node_mcp -.->|"registers"| node_structure
node_mcp -.->|"registers"| node_escape
node_selector -->|"selects mode"| node_live
node_selector -->|"selects mode"| node_headless
node_live -->|"connects"| node_bridge
node_bridge -.->|"relays commands"| node_extension
node_live -->|"encodes frames"| node_protocol
node_headless -->|"uses frames"| node_protocol
node_session -->|"checks session"| node_selector
node_drawing -->|"uses grid"| node_grid
node_drawing -->|"lays out text"| node_text
node_looking -->|"renders previews"| node_render
node_visitor -->|"browses"| node_web
node_web -.->|"presents"| node_knowledge
node_web -.->|"shows gallery"| node_gallery

click node_cli "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/cli.ts"
click node_mcp "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/server.ts"
click node_skills "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/skills.ts"
click node_selector "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/selector.ts"
click node_live "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/client.ts"
click node_headless "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/headless.ts"
click node_bridge "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/bridge.ts"
click node_extension "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/extension.ts"
click node_protocol "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/protocol.ts"
click node_session "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/session.ts"
click node_drawing "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/draw.ts"
click node_looking "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/look.ts"
click node_palette "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/palette.ts"
click node_assets "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/assets.ts"
click node_craft "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/craft.ts"
click node_structure "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/structure.ts"
click node_escape "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/escape.ts"
click node_grid "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/grid.ts"
click node_text "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/text.ts"
click node_render "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/render.ts"
click node_web "https://github.com/with-pebbly/aseprite-ai-artist/tree/main/apps/web/src/pages"
click node_gallery "https://github.com/with-pebbly/aseprite-ai-artist/blob/main/gallery/src/load.ts"
click node_knowledge "https://github.com/with-pebbly/aseprite-ai-artist/tree/main/apps/web/src/entities/knowledge"

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_mcp,node_skills toneBlue
class node_selector,node_live,node_headless,node_bridge,node_extension,node_protocol toneAmber
class node_session,node_drawing,node_looking,node_palette,node_assets,node_craft,node_structure,node_escape,node_grid,node_text,node_render toneMint
class node_web,node_gallery,node_knowledge toneRose
class node_agent,node_visitor toneIndigo
```

## Components

### Agent entry

- [CLI commands](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/cli.ts): `src/cli.ts`
- [MCP server](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/server.ts): `src/server.ts`
- [Skills and rules](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/skills.ts): `src/lib/skills.ts`

### Aseprite control

- [Mode selector](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/selector.ts): `src/bridge/selector.ts`
- [Live client](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/client.ts): `src/bridge/client.ts`
- [Headless client](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/headless.ts): `src/bridge/headless.ts`
- [WebSocket bridge](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/bridge/bridge.ts): `src/bridge/bridge.ts`
- [Aseprite extension](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/extension.ts): `src/extension.ts`
- [Wire protocol](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/protocol.ts): `src/lib/protocol.ts`

### Art tools

- [Session tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/session.ts): `src/tools/session.ts`
- [Drawing tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/draw.ts): `src/tools/draw.ts`
- [Canvas inspection](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/look.ts): `src/tools/look.ts`
- [Palette tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/palette.ts): `src/tools/palette.ts`
- [Asset tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/assets.ts): `src/tools/assets.ts`
- [Craft tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/craft.ts): `src/tools/craft.ts`
- [Sprite structure](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/structure.ts): `src/tools/structure.ts`
- [Escape tools](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/tools/escape.ts): `src/tools/escape.ts`
- [Grid utilities](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/grid.ts): `src/lib/grid.ts`
- [Bitmap text](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/text.ts): `src/lib/text.ts`
- [Preview rendering](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/src/lib/render.ts): `src/lib/render.ts`

### Public gallery

- [Pixel-art website](https://github.com/with-pebbly/aseprite-ai-artist/tree/main/apps/web/src/pages): `apps/web/src/pages`
- [Gallery data](https://github.com/with-pebbly/aseprite-ai-artist/blob/main/gallery/src/load.ts): `gallery/src/load.ts`
- [Knowledge content](https://github.com/with-pebbly/aseprite-ai-artist/tree/main/apps/web/src/entities/knowledge): `apps/web/src/entities/knowledge`

### Other components

- **Coding agent**
- **Website visitor**

## Connections

- Coding agent → CLI commands: invokes (evidence: `README.md`)
- CLI commands → MCP server: starts server (evidence: `src/cli.ts`)
- MCP server → Mode selector: creates (evidence: `src/server.ts`)
- MCP server → Skills and rules: loads (evidence: `src/server.ts`)
- MCP server → Session tools: registers (evidence: `src/server.ts`)
- MCP server → Drawing tools: registers (evidence: `src/server.ts`)
- MCP server → Canvas inspection: registers (evidence: `src/server.ts`)
- MCP server → Palette tools: registers (evidence: `src/server.ts`)
- MCP server → Asset tools: registers (evidence: `src/server.ts`)
- MCP server → Craft tools: registers (evidence: `src/server.ts`)
- MCP server → Sprite structure: registers (evidence: `src/server.ts`)
- MCP server → Escape tools: registers (evidence: `src/server.ts`)
- Mode selector → Live client: selects mode (evidence: `src/bridge/selector.ts`)
- Mode selector → Headless client: selects mode (evidence: `src/bridge/selector.ts`)
- Live client → WebSocket bridge: connects (evidence: `src/bridge/client.ts`)
- WebSocket bridge → Aseprite extension: relays commands
- Live client → Wire protocol: encodes frames (evidence: `src/bridge/client.ts`)
- Headless client → Wire protocol: uses frames (evidence: `src/bridge/headless.ts`)
- Session tools → Mode selector: checks session (evidence: `src/tools/session.ts`)
- Drawing tools → Grid utilities: uses grid (evidence: `src/tools/draw.ts`)
- Drawing tools → Bitmap text: lays out text (evidence: `src/tools/draw.ts`)
- Canvas inspection → Preview rendering: renders previews (evidence: `src/tools/look.ts`)
- Website visitor → Pixel-art website: browses (evidence: `README.md`)
- Pixel-art website → Knowledge content: presents
- Pixel-art website → Gallery data: shows gallery
