# yizhiyanhua-ai/fireworks-tech-graph architecture

> Architecture diagram of the GitHub repository yizhiyanhua-ai/fireworks-tech-graph, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-06-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/yizhiyanhua-ai/fireworks-tech-graph
- Repository: https://github.com/yizhiyanhua-ai/fireworks-tech-graph

## Overview

1. This repository is a **Claude Code Skill / diagram-generation package**, not a traditional application. Its core job is to convert natural-language requests into **inline SVG technical diagrams** and optionally export them to **PNG**.

2. The main control surface is **`SKILL.md`**. That file defines the skill behavior: how prompts are interpreted, which diagram types are supported, how styles are selected, what shape/arrow semantics mean, and how layouts should be structured.

3. The repo is organized around a **style system**. The `references/` directory contains the canonical style specs for styles 1–7, plus icon and layout guidance. These documents act as the design contract for the generator, so style fidelity is encoded in the repo rather than left to freeform prompting.

4. Diagram generation is driven by **templates** and **style rules**. The `templates/` directory holds starter SVG layouts for common diagram categories, while `scripts/generate-from-template.py` appears to produce new diagrams from those templates with style-specific content.

5. Style 8, **Dark Luxury**, is different from the template-driven styles. The README explicitly says it is **AI-authored** and rendered by directly reading `references/style-8-dark-luxury.md`, so it is a separate path from the more deterministic template pipeline.

6. The repository includes a large **semantic vocabulary** for diagrams: node kinds like LLM, Agent, Vector Store, Graph DB, Tool, API Gateway, and memory tiers, plus arrow semantics for read/write/async/loop. This is important because the output diagrams are not just visual; they encode system meaning through consistent shapes and connectors.

7. The **rendering/export boundary** is explicit. SVG is the primary artifact, and PNG is a derived artifact. The README names `cairosvg` as the preferred renderer, with `rsvg-convert` and `puppeteer` as fallback/high-fidelity options. That means the architecture depends on external renderers only at export time, not during diagram design.

8. The `scripts/` directory is the operational layer:
   - `generate-diagram.sh` validates and exports diagrams
   - `validate-svg.sh` checks SVG correctness
   - `test-all-styles.sh` runs regression across styles
   - `generate-from-template.py` builds SVGs from templates
   These scripts form the reproducible execution path for turning a specification into deliverables.

9. The `fixtures/` directory is a **regression corpus**. The JSON files represent canonical diagram scenarios across styles and domains, likely used to verify that the generator continues to produce the expected layouts and styling behaviors.

10. `assets/samples/` contains the **published output examples** shown in the README. This is the visual acceptance layer: sample PNGs demonstrate the expected end state of the generation pipeline.

11. `agents/openai.yaml` is an integration boundary for **agent-compatible runtimes**. It suggests the repository can be consumed as a structured skill/agent asset, not only as a human-run script package.

12. The repo has a strong **documentation-first boundary**: English and Chinese READMEs, style guides, and usage recipes are part of the system. The architecture is therefore split into:
   - prompt/spec layer (`README`, `SKILL.md`)
   - style/content layer (`references`, `fixtures`)
   - diagram source layer (`templates`)
   - validation/export tooling (`scripts`)
   - published examples (`assets/samples`)

13. For an architecture diagram, the most accurate top-level flow is:
   natural-language prompt → skill logic in `SKILL.md` → style/template/reference selection → SVG generation → SVG validation → PNG export via renderer → sample/output artifacts.

Main entry points: [`SKILL.md`](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/SKILL.md) (Skill spec), [`scripts/generate-from-template.py`](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/generate-from-template.py) (Template generator), [`scripts/validate-svg.sh`](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/validate-svg.sh) (SVG check), [`scripts/test-all-styles.sh`](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/test-all-styles.sh) (Style tests)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_docs["Docs & Spec"]
  node_readme["README<br/>docs<br/>[README.md]"]
  node_readme_zh["中文 README<br/>docs<br/>[README.zh.md]"]
  node_skill["Skill spec<br/>[SKILL.md]"]
  node_agent_yaml["Agent config<br/>integration<br/>[openai.yaml]"]
end

subgraph group_styles["Style System"]
  node_style1["Style 1<br/>style spec"]
  node_style2["Style 2<br/>style spec"]
  node_style3["Style 3<br/>style spec"]
  node_style4["Style 4<br/>style spec"]
  node_style5["Style 5<br/>style spec"]
  node_style6["Style 6<br/>style spec"]
  node_style7["Style 7<br/>style spec<br/>[style-7-openai.md]"]
  node_style8["Style 8<br/>ai style"]
  node_icons["Icons<br/>vocab<br/>[icons.md]"]
  node_layout["Layout guide<br/>vocab"]
  node_matrix["Style matrix<br/>vocab"]
end

subgraph group_runtime["Generation Pipeline"]
  node_templates["Templates"]
  node_gen_script["Template generator<br/>script"]
  node_gen_cli["Diagram CLI<br/>script"]
  node_svg_check["SVG check<br/>script<br/>[validate-svg.sh]"]
  node_style_tests["Style tests<br/>script<br/>[test-all-styles.sh]"]
  node_svg_out["SVG output<br/>artifact"]
  node_png_export["PNG export<br/>render step"]
end

subgraph group_artifacts["Artifacts"]
  node_fixtures[("Fixtures<br/>corpus")]
  node_samples["Samples<br/>examples"]
end

node_readme -->|"defines"| node_skill
node_readme_zh -.->|"documents"| node_skill
node_skill -->|"uses"| node_icons
node_skill -->|"uses"| node_layout
node_skill -->|"selects"| node_matrix
node_skill -->|"routes"| node_style1
node_skill -->|"routes"| node_style2
node_skill -->|"routes"| node_style3
node_skill -->|"routes"| node_style4
node_skill -->|"routes"| node_style5
node_skill -->|"routes"| node_style6
node_skill -->|"routes"| node_style7
node_skill -->|"routes"| node_style8
node_templates -->|"feeds"| node_gen_script
node_fixtures -->|"regresses"| node_style_tests
node_gen_script -->|"renders"| node_svg_out
node_gen_cli -->|"validates"| node_svg_check
node_svg_check -->|"checks"| node_svg_out
node_svg_out -->|"exports to"| node_png_export
node_png_export -->|"publishes"| node_samples
node_style_tests -.->|"compares"| node_samples
node_agent_yaml -.->|"integrates"| node_skill

click node_readme "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/README.md"
click node_readme_zh "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/README.zh.md"
click node_skill "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/SKILL.md"
click node_agent_yaml "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/agents/openai.yaml"
click node_style1 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-1-flat-icon.md"
click node_style2 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-2-dark-terminal.md"
click node_style3 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-3-blueprint.md"
click node_style4 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-4-notion-clean.md"
click node_style5 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-5-glassmorphism.md"
click node_style6 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-6-claude-official.md"
click node_style7 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-7-openai.md"
click node_style8 "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-8-dark-luxury.md"
click node_icons "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/icons.md"
click node_layout "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/svg-layout-best-practices.md"
click node_matrix "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-diagram-matrix.md"
click node_templates "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/templates"
click node_gen_script "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/generate-from-template.py"
click node_gen_cli "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/generate-diagram.sh"
click node_svg_check "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/validate-svg.sh"
click node_style_tests "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/test-all-styles.sh"
click node_fixtures "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/fixtures"
click node_samples "https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/assets/samples"

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_readme,node_readme_zh,node_skill,node_agent_yaml toneBlue
class node_style1,node_style2,node_style3,node_style4,node_style5,node_style6,node_style7,node_style8,node_icons,node_layout,node_matrix toneAmber
class node_templates,node_gen_script,node_gen_cli,node_svg_check,node_style_tests,node_svg_out,node_png_export toneMint
class node_fixtures,node_samples toneRose
```

## Components

### Docs & Spec

Prompting, usage, and skill contract

- [README](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/README.md): docs · Primary project overview and usage guide · `README.md`
- [中文 README](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/README.zh.md): docs · Chinese-language project overview · `README.zh.md`
- [Skill spec](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/SKILL.md): skill · Claude Code skill behavior, diagram semantics, and style selection · `SKILL.md`
- [Agent config](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/agents/openai.yaml): integration · Agent-facing entrypoint for structured consumption · `agents/openai.yaml`

### Style System

Canonical style references and layout rules

- [Style 1](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-1-flat-icon.md): style spec · Flat icon visual language · `references/style-1-flat-icon.md`
- [Style 2](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-2-dark-terminal.md): style spec · Dark terminal visual language · `references/style-2-dark-terminal.md`
- [Style 3](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-3-blueprint.md): style spec · Blueprint visual language · `references/style-3-blueprint.md`
- [Style 4](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-4-notion-clean.md): style spec · Notion clean visual language · `references/style-4-notion-clean.md`
- [Style 5](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-5-glassmorphism.md): style spec · Glassmorphism visual language · `references/style-5-glassmorphism.md`
- [Style 6](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-6-claude-official.md): style spec · Claude official visual language · `references/style-6-claude-official.md`
- [Style 7](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-7-openai.md): style spec · OpenAI visual language · `references/style-7-openai.md`
- [Style 8](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-8-dark-luxury.md): ai style · AI-authored Dark Luxury style path · `references/style-8-dark-luxury.md`
- [Icons](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/icons.md): vocab · Icon and semantic symbol guidance · `references/icons.md`
- [Layout guide](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/svg-layout-best-practices.md): vocab · SVG layout and composition best practices · `references/svg-layout-best-practices.md`
- [Style matrix](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/references/style-diagram-matrix.md): vocab · Cross-style diagram mapping and selection guidance · `references/style-diagram-matrix.md`

### Generation Pipeline

Templates, scripts, validation, and export

- [Templates](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/templates): svg templates · Starter layouts for common diagram categories · `templates`
- [Template generator](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/generate-from-template.py): script · Builds diagrams from templates and style content · `scripts/generate-from-template.py`
- [Diagram CLI](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/generate-diagram.sh): script · Validates and exports diagrams end to end · `scripts/generate-diagram.sh`
- [SVG check](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/validate-svg.sh): script · Validates SVG correctness · `scripts/validate-svg.sh`
- [Style tests](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/blob/main/scripts/test-all-styles.sh): script · Regression sweep across styles · `scripts/test-all-styles.sh`
- **SVG output**: artifact · Primary generated diagram artifact
- **PNG export**: render step · Derived raster output via external renderer

### Artifacts

Regression fixtures and published examples

- [Fixtures](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/fixtures): corpus · Canonical regression scenarios and expected behaviors · `fixtures`
- [Samples](https://github.com/yizhiyanhua-ai/fireworks-tech-graph/tree/main/assets/samples): examples · Published output examples used in the README · `assets/samples`

## Connections

- README → Skill spec: defines · README points to the skill contract and usage model
- 中文 README → Skill spec: documents · Chinese documentation mirrors the same skill behavior
- Skill spec → Icons: uses · Skill semantics depend on shared icon vocabulary
- Skill spec → Layout guide: uses · Skill behavior includes layout constraints
- Skill spec → Style matrix: selects · Style choice is guided by the style matrix
- Skill spec → Style 1: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 2: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 3: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 4: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 5: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 6: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 7: routes · Style-specific behavior is encoded in canonical references
- Skill spec → Style 8: routes · Dark Luxury uses a separate AI-authored reference path
- Templates → Template generator: feeds · Templates are the structured input for generation
- Fixtures → Style tests: regresses · Canonical scenarios exercise style behavior
- Template generator → SVG output: renders · Template generation produces SVG diagrams
- Diagram CLI → SVG check: validates · CLI pipeline validates SVG before export
- SVG check → SVG output: checks · Validation operates on generated SVG
- SVG output → PNG export: exports to · SVG is converted to PNG as a derived artifact
- PNG export → Samples: publishes · Rendered outputs are surfaced as examples
- Style tests → Samples: compares · Regression sweeps protect visible output consistency
- Agent config → Skill spec: integrates · Agent config exposes the skill to compatible runtimes
