@haposoft/cafekit 0.7.23 → 0.7.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +81 -862
- package/bin/install.js +4 -3
- package/package.json +2 -3
- package/src/claude/agents/code-auditor.md +25 -1
- package/src/claude/agents/god-developer.md +1 -1
- package/src/claude/agents/spec-maker.md +25 -3
- package/src/claude/agents/test-runner.md +22 -3
- package/src/claude/hooks/spec-state.cjs +24 -5
- package/src/claude/migration-manifest.json +1 -1
- package/src/claude/rules/manage-docs.md +5 -5
- package/src/claude/rules/state-sync.md +11 -8
- package/src/claude/skills/code-review/references/spec-compliance-review.md +8 -1
- package/src/claude/skills/develop/SKILL.md +32 -4
- package/src/claude/skills/develop/references/quality-gate.md +23 -13
- package/src/claude/skills/generate-graph/LICENSE +21 -0
- package/src/claude/skills/generate-graph/README.md +523 -0
- package/src/claude/skills/generate-graph/SKILL.md +427 -0
- package/src/claude/skills/generate-graph/agentloop-core.svg +101 -0
- package/src/claude/skills/generate-graph/agents/openai.yaml +4 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style1-flat.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style2-dark.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style3-blueprint.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style4-notion.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style5-glass.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style6-claude.png +0 -0
- package/src/claude/skills/generate-graph/assets/samples/sample-style7-openai.png +0 -0
- package/src/claude/skills/generate-graph/fixtures/agent-memory-types-style4.json +181 -0
- package/src/claude/skills/generate-graph/fixtures/api-flow-style7.json +40 -0
- package/src/claude/skills/generate-graph/fixtures/mem0-style1.json +297 -0
- package/src/claude/skills/generate-graph/fixtures/microservices-style3.json +64 -0
- package/src/claude/skills/generate-graph/fixtures/multi-agent-style5.json +45 -0
- package/src/claude/skills/generate-graph/fixtures/system-architecture-style6.json +48 -0
- package/src/claude/skills/generate-graph/fixtures/tool-call-style2.json +182 -0
- package/src/claude/skills/generate-graph/package.json +42 -0
- package/src/claude/skills/generate-graph/references/icons.md +281 -0
- package/src/claude/skills/generate-graph/references/style-1-flat-icon.md +108 -0
- package/src/claude/skills/generate-graph/references/style-2-dark-terminal.md +107 -0
- package/src/claude/skills/generate-graph/references/style-3-blueprint.md +113 -0
- package/src/claude/skills/generate-graph/references/style-4-notion-clean.md +94 -0
- package/src/claude/skills/generate-graph/references/style-5-glassmorphism.md +125 -0
- package/src/claude/skills/generate-graph/references/style-6-claude-official.md +209 -0
- package/src/claude/skills/generate-graph/references/style-7-openai.md +215 -0
- package/src/claude/skills/generate-graph/references/style-diagram-matrix.md +135 -0
- package/src/claude/skills/generate-graph/references/svg-layout-best-practices.md +100 -0
- package/src/claude/skills/generate-graph/scripts/generate-diagram.sh +157 -0
- package/src/claude/skills/generate-graph/scripts/generate-from-template.py +1556 -0
- package/src/claude/skills/generate-graph/scripts/test-all-styles.sh +135 -0
- package/src/claude/skills/generate-graph/scripts/validate-svg.sh +292 -0
- package/src/claude/skills/generate-graph/templates/agent-architecture.svg +28 -0
- package/src/claude/skills/generate-graph/templates/architecture.svg +23 -0
- package/src/claude/skills/generate-graph/templates/comparison-matrix.svg +14 -0
- package/src/claude/skills/generate-graph/templates/data-flow.svg +28 -0
- package/src/claude/skills/generate-graph/templates/er-diagram.svg +21 -0
- package/src/claude/skills/generate-graph/templates/flowchart.svg +21 -0
- package/src/claude/skills/generate-graph/templates/sequence.svg +20 -0
- package/src/claude/skills/generate-graph/templates/state-machine.svg +20 -0
- package/src/claude/skills/generate-graph/templates/timeline.svg +19 -0
- package/src/claude/skills/generate-graph/templates/use-case.svg +21 -0
- package/src/claude/skills/specs/SKILL.md +67 -10
- package/src/claude/skills/specs/references/review.md +32 -3
- package/src/claude/skills/specs/references/task-hydration.md +14 -12
- package/src/claude/skills/specs/rules/tasks-generation.md +21 -0
- package/src/claude/skills/specs/templates/design.md +14 -0
- package/src/claude/skills/specs/templates/init.json +7 -2
- package/src/claude/skills/specs/templates/requirements.md +21 -8
- package/src/claude/skills/specs/templates/task.md +16 -3
- package/src/claude/skills/sync/SKILL.md +11 -10
- package/src/claude/skills/sync/references/sync-protocols.md +33 -13
|
@@ -0,0 +1,523 @@
|
|
|
1
|
+
# generate-graph
|
|
2
|
+
|
|
3
|
+
> **Stop drawing diagrams by hand.** Describe your system in English or Chinese — get publication-ready SVG + PNG technical diagrams in seconds.
|
|
4
|
+
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
[](https://claude.ai/code)
|
|
7
|
+
[]()
|
|
8
|
+
[]()
|
|
9
|
+
[]()
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Overview
|
|
14
|
+
|
|
15
|
+
`generate-graph` turns natural language descriptions into polished SVG diagrams, then exports them as high-resolution PNG via `rsvg-convert`. It ships with **7 visual styles** and deep knowledge of AI/Agent domain patterns (RAG, Agentic Search, Mem0, Multi-Agent, Tool Call flows), plus full support for all 14 UML diagram types.
|
|
16
|
+
|
|
17
|
+
```
|
|
18
|
+
User: "Generate a Mem0 memory architecture diagram, dark style"
|
|
19
|
+
→ Skill classifies: Memory Architecture Diagram, Style 2
|
|
20
|
+
→ Generates SVG with swim lanes, cylinders, semantic arrows
|
|
21
|
+
→ Exports 1920px PNG
|
|
22
|
+
→ Reports: mem0-architecture.svg / mem0-architecture.png
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Showcase
|
|
28
|
+
|
|
29
|
+
> All samples exported at 1920px width (2× retina) via `rsvg-convert`. PNG is lossless and the right choice for technical diagrams — sharp edges, no JPEG compression artifacts on text/lines.
|
|
30
|
+
|
|
31
|
+
### Style 1 — Flat Icon (default)
|
|
32
|
+
*Mem0 Memory Architecture — white background, semantic arrows, layered memory system*
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
### Style 2 — Dark Terminal
|
|
36
|
+
*Tool Call Flow — dark background, neon accents, monospace font*
|
|
37
|
+

|
|
38
|
+
|
|
39
|
+
### Style 3 — Blueprint
|
|
40
|
+
*Microservices Architecture — deep blue background, grid lines, cyan strokes*
|
|
41
|
+

|
|
42
|
+
|
|
43
|
+
### Style 4 — Notion Clean
|
|
44
|
+
*Agent Memory Types — minimal white, single accent color*
|
|
45
|
+

|
|
46
|
+
|
|
47
|
+
### Style 5 — Glassmorphism
|
|
48
|
+
*Multi-Agent Collaboration — dark gradient background, frosted glass cards*
|
|
49
|
+

|
|
50
|
+
|
|
51
|
+
### Style 6 — Claude Official
|
|
52
|
+
*System Architecture — warm cream background (#f8f6f3), Anthropic brand colors, clean professional aesthetic*
|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
### Style 7 — OpenAI Official
|
|
56
|
+
*API Integration Flow — pure white background, OpenAI brand palette, modern minimalist design*
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Stable Prompt Recipes
|
|
62
|
+
|
|
63
|
+
Use prompts like these when you want the model to stay close to the repo's strongest regression-tested outputs:
|
|
64
|
+
|
|
65
|
+
### Style 1 — Flat Icon
|
|
66
|
+
```text
|
|
67
|
+
Draw a Mem0 memory architecture diagram in style 1 (Flat Icon).
|
|
68
|
+
Use four horizontal sections: Input Layer, Memory Manager, Storage Layer, Output / Retrieval.
|
|
69
|
+
Include User, AI App / Agent, LLM, mem0 Client, Memory Manager, Vector Store, Graph DB, Key-Value Store, History Store, Context Builder, Ranked Results, Personalized Response.
|
|
70
|
+
Use semantic arrows for read, write, control, and data flow. Keep the layout clean and product-doc friendly.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Style 2 — Dark Terminal
|
|
74
|
+
```text
|
|
75
|
+
Draw a tool call flow diagram in style 2 (Dark Terminal).
|
|
76
|
+
Show User query, Retrieve chunks, Generate answer, Knowledge base, Agent, Terminal, Source documents, and Grounded answer.
|
|
77
|
+
Use terminal chrome, neon accents, monospace typography, and semantic arrows for retrieval, synthesis, and embedding update.
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Style 3 — Blueprint
|
|
81
|
+
```text
|
|
82
|
+
Draw a microservices architecture diagram in style 3 (Blueprint).
|
|
83
|
+
Create numbered engineering sections like 01 // EDGE, 02 // APPLICATION SERVICES, 03 // DATA + EVENT INFRA, 04 // OBSERVABILITY.
|
|
84
|
+
Include Client Apps, API Gateway, Auth / Policy, three services, Event Router, Postgres, Redis Cache, Warehouse, and Metrics / Traces.
|
|
85
|
+
Use blueprint grid, cyan strokes, and a bottom-right title block.
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
### Style 4 — Notion Clean
|
|
89
|
+
```text
|
|
90
|
+
Draw an agent memory types diagram in style 4 (Notion Clean).
|
|
91
|
+
Compare Sensory Memory, Working Memory, Episodic Memory, Semantic Memory, and Procedural Memory around a central Agent core.
|
|
92
|
+
Use a minimal white layout, neutral borders, one accent color for arrows, and short storage tags for each memory type.
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Style 5 — Glassmorphism
|
|
96
|
+
```text
|
|
97
|
+
Draw a multi-agent collaboration diagram in style 5 (Glassmorphism).
|
|
98
|
+
Use three sections: Mission Control, Specialist Agents, and Synthesis.
|
|
99
|
+
Include User brief, Coordinator Agent, Research Agent, Coding Agent, Review Agent, Shared Memory, Synthesis Engine, and Final response.
|
|
100
|
+
Use frosted cards, soft glow, and semantic arrows for delegation, shared memory writes, and synthesis output.
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Style 6 — Claude Official
|
|
104
|
+
```text
|
|
105
|
+
Draw a system architecture diagram in style 6 (Claude Official).
|
|
106
|
+
Use left-side layer labels: Interface Layer, Core Layer, Foundation Layer.
|
|
107
|
+
Include Client Surface, Gateway, Task Planner, Model Runtime, Policy Guardrails, Memory Store, Tool Runtime, Observability, and Registry.
|
|
108
|
+
Use warm cream background, restrained brand-like palette, generous whitespace, and a bottom-right legend.
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### Style 7 — OpenAI Official
|
|
112
|
+
```text
|
|
113
|
+
Draw an API integration flow diagram in style 7 (OpenAI Official).
|
|
114
|
+
Use three sections: Entry, Model + Tools, and Delivery.
|
|
115
|
+
Include Application, OpenAI SDK Layer, Prompt Builder, Model Runtime, Tool Calls, Response Formatter, Observability, and Release Control.
|
|
116
|
+
Keep the look minimal, white, precise, and modern with clean green-accented arrows.
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Features
|
|
122
|
+
|
|
123
|
+
- **7 visual styles** — from clean white docs to dark neon to frosted glass to official brand styles
|
|
124
|
+
- **Executable style system** — style guides are encoded into the generator, not only documented in markdown
|
|
125
|
+
- **14 diagram types** — Full UML support (Class, Component, Deployment, Package, Composite Structure, Object, Use Case, Activity, State Machine, Sequence, Communication, Timing, Interaction Overview, ER Diagram) plus AI/Agent domain diagrams
|
|
126
|
+
- **AI/Agent domain patterns** — RAG, Agentic Search, Mem0, Multi-Agent, Tool Call, and more built-in
|
|
127
|
+
- **Semantic shape vocabulary** — LLM = double-border rect, Agent = hexagon, Vector Store = ringed cylinder
|
|
128
|
+
- **Semantic arrow system** — color + dash pattern encode meaning (write vs read vs async vs loop)
|
|
129
|
+
- **Product icons** — 40+ products with brand colors: OpenAI, Anthropic, Pinecone, Weaviate, Kafka, PostgreSQL…
|
|
130
|
+
- **Swim lane grouping** — automatic layer labeling for complex architectures
|
|
131
|
+
- **SVG + PNG output** — SVG for editing, 1920px PNG for embedding
|
|
132
|
+
- **rsvg-convert compatible** — no external font fetching, pure inline SVG
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
## Installation
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
npx @haposoft/cafekit
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
CafeKit bundles this skill into the Claude Code install under:
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
.claude/skills/generate-graph
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Invoke it in Claude Code with:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
/hapo:generate-graph <diagram request>
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
## Update
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
npx @haposoft/cafekit --upgrade
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
Re-run the CafeKit installer in upgrade mode to refresh the bundled skill files.
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Requirements
|
|
165
|
+
|
|
166
|
+
```bash
|
|
167
|
+
# macOS
|
|
168
|
+
brew install librsvg
|
|
169
|
+
|
|
170
|
+
# Ubuntu/Debian
|
|
171
|
+
sudo apt install librsvg2-bin
|
|
172
|
+
|
|
173
|
+
# Verify
|
|
174
|
+
rsvg-convert --version
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Why Not Mermaid or draw.io?
|
|
180
|
+
|
|
181
|
+
| | Mermaid | draw.io | **generate-graph** |
|
|
182
|
+
|--|---------|---------|--------------------------|
|
|
183
|
+
| Natural language input | ✗ | ✗ | ✅ |
|
|
184
|
+
| AI/Agent domain patterns | ✗ | ✗ | ✅ |
|
|
185
|
+
| Multiple visual styles | ✗ | manual | ✅ 5 built-in |
|
|
186
|
+
| High-res PNG export | ✗ | manual | ✅ auto 1920px |
|
|
187
|
+
| Semantic arrow colors | ✗ | manual | ✅ auto |
|
|
188
|
+
| No online tool needed | ✅ | ✗ | ✅ |
|
|
189
|
+
|
|
190
|
+
Mermaid is great for quick inline diagrams in markdown. draw.io is great for manual polishing. `generate-graph` is optimized for **describing a system and getting a polished diagram immediately**, without writing DSL syntax or clicking around a GUI.
|
|
191
|
+
|
|
192
|
+
---
|
|
193
|
+
|
|
194
|
+
## Usage
|
|
195
|
+
|
|
196
|
+
### Trigger phrases
|
|
197
|
+
|
|
198
|
+
The skill auto-triggers on:
|
|
199
|
+
|
|
200
|
+
```
|
|
201
|
+
generate diagram / draw diagram / create chart / visualize
|
|
202
|
+
architecture diagram / flowchart / sequence diagram / data flow
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Basic usage
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
Draw a RAG pipeline flowchart
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
```
|
|
212
|
+
Generate an Agentic Search architecture diagram
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
### Specify style
|
|
216
|
+
|
|
217
|
+
```
|
|
218
|
+
Draw a microservices architecture diagram, style 2 (dark terminal)
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
```
|
|
222
|
+
Draw a multi-agent collaboration diagram --style glassmorphism
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
### Specify output path
|
|
226
|
+
|
|
227
|
+
```
|
|
228
|
+
Generate a Mem0 architecture diagram, output to ~/Desktop/
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
```
|
|
232
|
+
Create a tool call flow diagram --output /tmp/diagrams/
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
## Example Prompts by Scenario
|
|
238
|
+
|
|
239
|
+
### AI/Agent Systems
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
Compare Agentic RAG vs standard RAG in a feature matrix, Notion clean style
|
|
243
|
+
```
|
|
244
|
+
→ Comparison matrix: RAG vs Agentic RAG, covering retrieval strategy, agent loop, tool use
|
|
245
|
+
|
|
246
|
+
```
|
|
247
|
+
Generate a Mem0 memory architecture diagram with vector store, graph DB, KV store, and memory manager
|
|
248
|
+
```
|
|
249
|
+
→ Memory Architecture with swim lanes: Input → Memory Manager → Storage tiers → Retrieval
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
Draw a Multi-Agent diagram: Orchestrator dispatches 3 SubAgents (search / compute / code execution), results aggregated
|
|
253
|
+
```
|
|
254
|
+
→ Agent Architecture with hexagons, tool layers, and result aggregation
|
|
255
|
+
|
|
256
|
+
```
|
|
257
|
+
Visualize the Tool Call execution flow: LLM → Tool Selector → Execution → Parser → back to LLM
|
|
258
|
+
```
|
|
259
|
+
→ Flowchart with decision loop showing tool invocation cycle
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
Draw the 5 agent memory types: Sensory, Working, Episodic, Semantic, Procedural
|
|
263
|
+
```
|
|
264
|
+
→ Mind map or layered architecture showing memory tiers from sensory to procedural
|
|
265
|
+
|
|
266
|
+
### Infrastructure & Cloud
|
|
267
|
+
|
|
268
|
+
```
|
|
269
|
+
Draw a microservices architecture: Client → API Gateway → [User Service / Order Service / Payment Service] → PostgreSQL + Redis
|
|
270
|
+
```
|
|
271
|
+
→ Architecture diagram with horizontal layers, swim lanes per service cluster
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
Generate a data pipeline diagram: Kafka → Spark processing → write to S3 → Athena query
|
|
275
|
+
```
|
|
276
|
+
→ Data flow diagram with labeled arrows (stream / batch / query)
|
|
277
|
+
|
|
278
|
+
```
|
|
279
|
+
Draw a Kubernetes deployment: Ingress → Service → [Pod × 3] → ConfigMap + PersistentVolume
|
|
280
|
+
```
|
|
281
|
+
→ Architecture with dashed containers per namespace, solid arrows for traffic flow
|
|
282
|
+
|
|
283
|
+
### API & Sequence Flows
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
Draw an OAuth2 authorization code flow sequence diagram: User → Client → Auth Server → Resource Server
|
|
287
|
+
```
|
|
288
|
+
→ Sequence diagram with vertical lifelines and activation boxes
|
|
289
|
+
|
|
290
|
+
```
|
|
291
|
+
Draw the ChatGPT Plugin call sequence diagram
|
|
292
|
+
```
|
|
293
|
+
→ Sequence: User → ChatGPT → Plugin Manifest → API → Response chain
|
|
294
|
+
|
|
295
|
+
### Decision & Process Flows
|
|
296
|
+
|
|
297
|
+
```
|
|
298
|
+
Draw a pre-launch QA flowchart for an AI app: Code Review → Security Scan → Performance Test → Manual Approval → Deploy
|
|
299
|
+
```
|
|
300
|
+
→ Flowchart with diamond decision nodes and parallel branches
|
|
301
|
+
|
|
302
|
+
```
|
|
303
|
+
Generate a feature comparison matrix: RAG vs Fine-tuning vs Prompt Engineering
|
|
304
|
+
```
|
|
305
|
+
→ Comparison matrix with checked/unchecked cells across cost, latency, accuracy, flexibility
|
|
306
|
+
|
|
307
|
+
### Concept Maps
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
Visualize the LLM application tech stack: from foundation model to SDK to app framework to deployment
|
|
311
|
+
```
|
|
312
|
+
→ Layered architecture or mind map from model layer to product layer
|
|
313
|
+
|
|
314
|
+
```
|
|
315
|
+
Draw an AI Agent capability map: Perception / Memory / Reasoning / Action / Learning
|
|
316
|
+
```
|
|
317
|
+
→ Mind map with central "AI Agent" node and 5 radial branches
|
|
318
|
+
|
|
319
|
+
---
|
|
320
|
+
|
|
321
|
+
## Styles
|
|
322
|
+
|
|
323
|
+
| # | Name | Background | Font | Best For |
|
|
324
|
+
|---|------|-----------|------|----------|
|
|
325
|
+
| 1 | **Flat Icon** *(default)* | `#ffffff` | Helvetica | Blogs, slides, docs |
|
|
326
|
+
| 2 | **Dark Terminal** | `#0f0f1a` | SF Mono / Fira Code | GitHub README, dev articles |
|
|
327
|
+
| 3 | **Blueprint** | `#0a1628` | Courier New | Architecture docs, engineering |
|
|
328
|
+
| 4 | **Notion Clean** | `#ffffff` | system-ui | Notion, Confluence, wikis |
|
|
329
|
+
| 5 | **Glassmorphism** | `#0d1117` gradient | Inter | Product sites, keynotes |
|
|
330
|
+
| 6 | **Claude Official** | `#f8f6f3` | system-ui | Anthropic-style diagrams, warm aesthetic |
|
|
331
|
+
| 7 | **OpenAI Official** | `#ffffff` | system-ui | OpenAI-style diagrams, clean modern look |
|
|
332
|
+
|
|
333
|
+
Each style has a dedicated reference file in `references/` with exact color tokens, SVG patterns, and templates.
|
|
334
|
+
The generator also consumes style-aware structure fields such as `containers`, semantic `nodes[].kind`, `arrows[].flow`, and explicit port anchors so sample-grade layouts can be reproduced more consistently.
|
|
335
|
+
|
|
336
|
+
Useful high-leverage fields for style-specific polish:
|
|
337
|
+
- `style_overrides` to nudge title alignment or palette tokens without forking a full style
|
|
338
|
+
- `containers[].header_prefix` / `containers[].header_text` for blueprint-style numbered section headers such as `01 // EDGE`
|
|
339
|
+
- `containers[].side_label` for Claude-style left layer labels
|
|
340
|
+
- `window_controls`, `meta_left`, `meta_center`, `meta_right` for terminal / document chrome
|
|
341
|
+
- `blueprint_title_block` for engineering title boxes in style 3
|
|
342
|
+
|
|
343
|
+
### Style Selection Guide
|
|
344
|
+
|
|
345
|
+
**For UML Diagrams:**
|
|
346
|
+
- **Class/Component/Package**: Style 1 (Flat Icon) or Style 4 (Notion Clean) — clear structure, easy to read
|
|
347
|
+
- **Sequence/Timing**: Style 2 (Dark Terminal) — monospace fonts help with alignment
|
|
348
|
+
- **State Machine/Activity**: Style 3 (Blueprint) — engineering aesthetic fits process flows
|
|
349
|
+
- **Use Case/Interview**: Style 1 (Flat Icon) — colorful, accessible
|
|
350
|
+
|
|
351
|
+
**For AI/Agent Diagrams:**
|
|
352
|
+
- **RAG/Agentic Search**: Style 2 (Dark Terminal) or Style 5 (Glassmorphism) — tech-forward aesthetic
|
|
353
|
+
- **Memory Architecture**: Style 3 (Blueprint) — emphasizes layered storage tiers
|
|
354
|
+
- **Multi-Agent**: Style 5 (Glassmorphism) — frosted cards distinguish agent boundaries
|
|
355
|
+
|
|
356
|
+
**For Documentation:**
|
|
357
|
+
- **Internal docs**: Style 4 (Notion Clean) — minimal, wiki-friendly
|
|
358
|
+
- **Blog posts**: Style 1 (Flat Icon) — colorful, engaging
|
|
359
|
+
- **GitHub README**: Style 2 (Dark Terminal) — matches dark theme
|
|
360
|
+
- **Presentations**: Style 5 (Glassmorphism) or Style 6 (Claude Official) — polished
|
|
361
|
+
|
|
362
|
+
**Brand-Specific:**
|
|
363
|
+
- **Anthropic/Claude projects**: Style 6 (Claude Official) — warm cream background, brand colors
|
|
364
|
+
- **OpenAI projects**: Style 7 (OpenAI Official) — clean white, OpenAI palette
|
|
365
|
+
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
## Diagram Types
|
|
369
|
+
|
|
370
|
+
| Type | Description | Key Layout Rule |
|
|
371
|
+
|------|-------------|-----------------|
|
|
372
|
+
| **Architecture** | Services, components, cloud infra | Horizontal layers top→bottom |
|
|
373
|
+
| **Data Flow** | What data moves where | Label every arrow with data type |
|
|
374
|
+
| **Flowchart** | Decisions, process steps | Diamond = decision, top→bottom |
|
|
375
|
+
| **Agent Architecture** | LLM + tools + memory | 5-layer model: Input/Agent/Memory/Tool/Output |
|
|
376
|
+
| **Memory Architecture** | Mem0, MemGPT-style | Separate read/write paths, memory tiers |
|
|
377
|
+
| **Sequence** | API call chains, time-ordered | Vertical lifelines, horizontal messages |
|
|
378
|
+
| **Comparison** | Feature matrix, side-by-side | Column = system, row = attribute |
|
|
379
|
+
| **Mind Map** | Concept maps, radial | Central node, bezier branches |
|
|
380
|
+
|
|
381
|
+
### UML Diagram Support (14 Types)
|
|
382
|
+
|
|
383
|
+
| UML Type | Description | Best Style |
|
|
384
|
+
|----------|-------------|------------|
|
|
385
|
+
| **Class Diagram** | Classes, attributes, methods, relationships | Style 1, 4 |
|
|
386
|
+
| **Component Diagram** | Software components and dependencies | Style 1, 3 |
|
|
387
|
+
| **Deployment Diagram** | Hardware nodes and software deployment | Style 3 |
|
|
388
|
+
| **Package Diagram** | Package organization and dependencies | Style 1, 4 |
|
|
389
|
+
| **Composite Structure** | Internal structure of classes/components | Style 1, 3 |
|
|
390
|
+
| **Object Diagram** | Object instances and relationships | Style 1, 4 |
|
|
391
|
+
| **Use Case Diagram** | Actors, use cases, system boundaries | Style 1 |
|
|
392
|
+
| **Activity Diagram** | Workflows, parallel processes | Style 3 |
|
|
393
|
+
| **State Machine** | State transitions and events | Style 2, 3 |
|
|
394
|
+
| **Sequence Diagram** | Message exchanges over time | Style 2 |
|
|
395
|
+
| **Communication Diagram** | Object interactions and messages | Style 1, 2 |
|
|
396
|
+
| **Timing Diagram** | State changes over time | Style 2 |
|
|
397
|
+
| **Interaction Overview** | High-level interaction flow | Style 1, 2 |
|
|
398
|
+
| **ER Diagram** | Entity-relationship data models | Style 1, 3 |
|
|
399
|
+
|
|
400
|
+
---
|
|
401
|
+
|
|
402
|
+
## AI/Agent Domain Patterns
|
|
403
|
+
|
|
404
|
+
Built-in pattern knowledge:
|
|
405
|
+
|
|
406
|
+
```
|
|
407
|
+
RAG Pipeline → Query → Embed → VectorSearch → Retrieve → LLM → Response
|
|
408
|
+
Agentic RAG → adds Agent loop + Tool use
|
|
409
|
+
Agentic Search → Query → Planner → [Search/Calc/Code] → Synthesizer
|
|
410
|
+
Mem0 Memory Layer → Input → Memory Manager → [VectorDB + GraphDB] → Context
|
|
411
|
+
Agent Memory Types → Sensory → Working → Episodic → Semantic → Procedural
|
|
412
|
+
Multi-Agent → Orchestrator → [SubAgent×N] → Aggregator → Output
|
|
413
|
+
Tool Call Flow → LLM → Tool Selector → Execution → Parser → LLM (loop)
|
|
414
|
+
```
|
|
415
|
+
|
|
416
|
+
---
|
|
417
|
+
|
|
418
|
+
## Shape Vocabulary
|
|
419
|
+
|
|
420
|
+
Shapes encode semantic meaning consistently across all styles:
|
|
421
|
+
|
|
422
|
+
| Concept | Shape |
|
|
423
|
+
|---------|-------|
|
|
424
|
+
| User / Human | Circle + body |
|
|
425
|
+
| LLM / Model | Rounded rect, double border, ⚡ |
|
|
426
|
+
| Agent / Orchestrator | Hexagon |
|
|
427
|
+
| Memory (short-term) | Dashed-border rounded rect |
|
|
428
|
+
| Memory (long-term) | Solid cylinder |
|
|
429
|
+
| Vector Store | Cylinder with inner rings |
|
|
430
|
+
| Graph DB | 3-circle cluster |
|
|
431
|
+
| Tool / Function | Rect with ⚙ |
|
|
432
|
+
| API / Gateway | Hexagon (single border) |
|
|
433
|
+
| Queue / Stream | Horizontal pipe/tube |
|
|
434
|
+
| Document / File | Folded-corner rect |
|
|
435
|
+
| Browser / UI | Rect with 3-dot titlebar |
|
|
436
|
+
| Decision | Diamond |
|
|
437
|
+
| External Service | Dashed-border rect |
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
## Arrow Semantics
|
|
442
|
+
|
|
443
|
+
| Flow Type | Stroke | Dash | Meaning |
|
|
444
|
+
|-----------|--------|------|---------|
|
|
445
|
+
| Primary data flow | 2px solid | — | Main request/response |
|
|
446
|
+
| Control / trigger | 1.5px solid | — | System A triggers B |
|
|
447
|
+
| Memory read | 1.5px solid | — | Retrieve from store |
|
|
448
|
+
| Memory write | 1.5px | `5,3` | Write/store operation |
|
|
449
|
+
| Async / event | 1.5px | `4,2` | Non-blocking |
|
|
450
|
+
| Feedback / loop | 1.5px curved | — | Iterative reasoning |
|
|
451
|
+
|
|
452
|
+
---
|
|
453
|
+
|
|
454
|
+
## File Structure
|
|
455
|
+
|
|
456
|
+
```
|
|
457
|
+
generate-graph/
|
|
458
|
+
├── SKILL.md # Main skill — diagram types, layout rules, shape vocab
|
|
459
|
+
├── README.md # This file (English)
|
|
460
|
+
├── references/
|
|
461
|
+
│ ├── style-1-flat-icon.md # White background, colored accents
|
|
462
|
+
│ ├── style-2-dark-terminal.md # Dark bg, neon accents, monospace
|
|
463
|
+
│ ├── style-3-blueprint.md # Blueprint grid, cyan lines
|
|
464
|
+
│ ├── style-4-notion-clean.md # Minimal, white, single arrow color
|
|
465
|
+
│ ├── style-5-glassmorphism.md # Dark gradient, frosted glass cards
|
|
466
|
+
│ ├── style-6-claude-official.md # Warm cream background, Anthropic brand
|
|
467
|
+
│ ├── style-7-openai.md # Clean white, OpenAI brand palette
|
|
468
|
+
│ └── icons.md # 40+ product icons + semantic shapes
|
|
469
|
+
├── agents/
|
|
470
|
+
│ └── openai.yaml # Agent metadata for compatible runtimes
|
|
471
|
+
├── fixtures/
|
|
472
|
+
│ ├── mem0-style1.json # Style 1 regression fixture
|
|
473
|
+
│ ├── tool-call-style2.json # Style 2 regression fixture
|
|
474
|
+
│ └── ... # Additional sample-grade fixtures per style
|
|
475
|
+
├── scripts/
|
|
476
|
+
│ ├── generate-diagram.sh # Validate SVG + export PNG
|
|
477
|
+
│ ├── generate-from-template.py # Create starter SVGs from templates
|
|
478
|
+
│ ├── validate-svg.sh # Validate SVG syntax
|
|
479
|
+
│ └── test-all-styles.sh # Batch test all styles
|
|
480
|
+
├── assets/
|
|
481
|
+
│ └── samples/ # Showcase diagram PNGs
|
|
482
|
+
├── templates/
|
|
483
|
+
│ ├── architecture.svg # Architecture starter template
|
|
484
|
+
│ ├── data-flow.svg # Data-flow starter template
|
|
485
|
+
│ └── ... # Additional diagram templates
|
|
486
|
+
└── agentloop-core.svg # Included sample SVG
|
|
487
|
+
```
|
|
488
|
+
|
|
489
|
+
---
|
|
490
|
+
|
|
491
|
+
## Product Icon Coverage
|
|
492
|
+
|
|
493
|
+
**AI/ML:** OpenAI, Anthropic/Claude, Google Gemini, Meta LLaMA, Mistral, Cohere, Groq, Hugging Face
|
|
494
|
+
|
|
495
|
+
**AI Frameworks:** Mem0, LangChain, LlamaIndex, LangGraph, CrewAI, AutoGen, DSPy, Haystack
|
|
496
|
+
|
|
497
|
+
**Vector DBs:** Pinecone, Weaviate, Qdrant, Chroma, Milvus, pgvector, Faiss
|
|
498
|
+
|
|
499
|
+
**Databases:** PostgreSQL, MySQL, MongoDB, Redis, Elasticsearch, Neo4j, Cassandra
|
|
500
|
+
|
|
501
|
+
**Messaging:** Kafka, RabbitMQ, NATS, Pulsar
|
|
502
|
+
|
|
503
|
+
**Cloud:** AWS, GCP, Azure, Cloudflare, Vercel, Docker, Kubernetes
|
|
504
|
+
|
|
505
|
+
**Observability:** Grafana, Prometheus, Datadog, LangSmith, Langfuse, Arize
|
|
506
|
+
|
|
507
|
+
---
|
|
508
|
+
|
|
509
|
+
## Troubleshooting
|
|
510
|
+
|
|
511
|
+
| Symptom | Cause | Fix |
|
|
512
|
+
|---------|-------|-----|
|
|
513
|
+
| PNG is blank or all-black | `@import url()` in SVG — rsvg-convert can't fetch fonts | Remove `@import`, use system font stack |
|
|
514
|
+
| PNG not generated | `rsvg-convert` not installed | `brew install librsvg` (macOS) or `apt install librsvg2-bin` |
|
|
515
|
+
| Diagram cut off at bottom | ViewBox height too short | Increase `height` in `viewBox="0 0 960 <height>"` |
|
|
516
|
+
| Text overflowing boxes | Labels too long | Add `text-anchor="middle"` + `<clipPath>` or shorten label |
|
|
517
|
+
| Icons not rendering | External CDN URL in rsvg-convert context | Use inline SVG paths from `references/icons.md` |
|
|
518
|
+
|
|
519
|
+
---
|
|
520
|
+
|
|
521
|
+
## License
|
|
522
|
+
|
|
523
|
+
Bundled in CafeKit under MIT. Original upstream attribution is preserved in `LICENSE`.
|