How yizhiyanhua-ai/fireworks-tech-graph works
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 Skill spec · generate-from-template.py Template generator · validate-svg.sh SVG check · test-all-styles.sh Style tests
Components 24
Docs & Spec
Prompting, usage, and skill contract
- README · Primary project overview and usage guide
README.md - 中文 README · Chinese-language project overview
README.zh.md - Skill spec · Claude Code skill behavior, diagram semantics, and style selection
SKILL.md - Agent config · Agent-facing entrypoint for structured consumption
agents/openai.yaml
Style System
Canonical style references and layout rules
- Style 1 · Flat icon visual language
references/style-1-flat-icon.md - Style 2 · Dark terminal visual language
references/style-2-dark-terminal.md - Style 3 · Blueprint visual language
references/style-3-blueprint.md - Style 4 · Notion clean visual language
references/style-4-notion-clean.md - Style 5 · Glassmorphism visual language
references/style-5-glassmorphism.md - Style 6 · Claude official visual language
references/style-6-claude-official.md - Style 7 · OpenAI visual language
references/style-7-openai.md - Style 8 · AI-authored Dark Luxury style path
references/style-8-dark-luxury.md - Icons · Icon and semantic symbol guidance
references/icons.md - Layout guide · SVG layout and composition best practices
references/svg-layout-best-practices.md - Style matrix · Cross-style diagram mapping and selection guidance
references/style-diagram-matrix.md
Generation Pipeline
Templates, scripts, validation, and export
- Templates · Starter layouts for common diagram categories
templates - Template generator · Builds diagrams from templates and style content
scripts/generate-from-template.py - Diagram CLI · Validates and exports diagrams end to end
scripts/generate-diagram.sh - SVG check · Validates SVG correctness
scripts/validate-svg.sh - Style tests · Regression sweep across styles
scripts/test-all-styles.sh - SVG output · Primary generated diagram artifact
- PNG export · Derived raster output via external renderer
Connections 22
- 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