@ia-ccun/code-agent-cli 0.0.59-beta.5 → 0.0.59-beta.6

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.
Files changed (126) hide show
  1. package/config/agent/extensions/aicode-provider-scope.ts +388 -0
  2. package/config/agent/skills/agent-browser/LICENSE +201 -0
  3. package/config/agent/skills/agent-browser/SKILL.md +55 -0
  4. package/config/agent/skills/codebase-design/DEEPENING.md +37 -0
  5. package/config/agent/skills/codebase-design/DESIGN-IT-TWICE.md +44 -0
  6. package/config/agent/skills/{chroma → codebase-design}/LICENSE +1 -1
  7. package/config/agent/skills/codebase-design/SKILL.md +118 -0
  8. package/config/agent/skills/codebase-design/agents/openai.yaml +3 -0
  9. package/config/agent/skills/domain-modeling/ADR-FORMAT.md +47 -0
  10. package/config/agent/skills/domain-modeling/GLOSSARY-FORMAT.md +61 -0
  11. package/config/agent/skills/{fireworks-tech-graph → domain-modeling}/LICENSE +1 -1
  12. package/config/agent/skills/domain-modeling/SKILL.md +78 -0
  13. package/config/agent/skills/domain-modeling/agents/openai.yaml +3 -0
  14. package/config/agent/skills/frontend-design/SKILL.md +55 -26
  15. package/config/agent/skills/grill-with-docs/LICENSE +21 -0
  16. package/config/agent/skills/grill-with-docs/SKILL.md +21 -0
  17. package/config/agent/skills/grill-with-docs/agents/openai.yaml +5 -0
  18. package/config/agent/skills/grilling/LICENSE +21 -0
  19. package/config/agent/skills/grilling/SKILL.md +34 -0
  20. package/config/agent/skills/grilling/agents/openai.yaml +3 -0
  21. package/config/agent/skills/tdd/LICENSE +21 -0
  22. package/config/agent/skills/tdd/SKILL.md +42 -0
  23. package/config/agent/skills/tdd/agents/openai.yaml +3 -0
  24. package/config/agent/skills/tdd/mocking.md +59 -0
  25. package/config/agent/skills/tdd/tests.md +77 -0
  26. package/config/agent/skills/ui-taste/CHECKSUMS.sha256 +25 -0
  27. package/config/agent/skills/{milvus-skill → ui-taste}/LICENSE +12 -23
  28. package/config/agent/skills/ui-taste/MANIFEST.json +256 -0
  29. package/config/agent/skills/ui-taste/MODIFICATIONS.md +23 -0
  30. package/config/agent/skills/ui-taste/NOTICE +74 -0
  31. package/config/agent/skills/ui-taste/SKILL.md +90 -0
  32. package/config/agent/skills/ui-taste/agents/openai.yaml +4 -0
  33. package/config/agent/skills/ui-taste/reference/anti-slop-craft.md +138 -0
  34. package/config/agent/skills/ui-taste/reference/audit.md +71 -0
  35. package/config/agent/skills/ui-taste/reference/audit.native.md +78 -0
  36. package/config/agent/skills/ui-taste/reference/craft.md +48 -0
  37. package/config/agent/skills/ui-taste/reference/distill.md +20 -0
  38. package/config/agent/skills/ui-taste/reference/image-assets.md +31 -0
  39. package/config/agent/skills/ui-taste/reference/ios.md +35 -0
  40. package/config/agent/skills/ui-taste/reference/mobile-controls.md +37 -0
  41. package/config/agent/skills/ui-taste/reference/mobile-state-performance.md +34 -0
  42. package/config/agent/skills/ui-taste/reference/native-verification.md +33 -0
  43. package/config/agent/skills/ui-taste/reference/new-work.md +87 -0
  44. package/config/agent/skills/ui-taste/reference/operate.md +37 -0
  45. package/config/agent/skills/ui-taste/reference/overdrive.md +65 -0
  46. package/config/agent/skills/ui-taste/reference/polish.md +63 -0
  47. package/config/agent/skills/ui-taste/reference/research.md +45 -0
  48. package/config/agent/skills/ui-taste/references/uizze-image-to-ui.md +77 -0
  49. package/config/agent/skills/ui-taste/references/uizze-reference-policy.md +27 -0
  50. package/config/agent/skills/ui-taste/references/uizze-visual-verification.md +62 -0
  51. package/config/agent/skills/ui-taste/scripts/verify-visual-evidence.mjs +108 -0
  52. package/package.json +5 -5
  53. package/config/agent/skills/chroma/chroma-local/SKILL.md +0 -165
  54. package/config/agent/skills/chroma/chroma-local/cli.md +0 -48
  55. package/config/agent/skills/chroma/chroma-local/data-model.md +0 -103
  56. package/config/agent/skills/chroma/chroma-local/error-handling/python.md +0 -166
  57. package/config/agent/skills/chroma/chroma-local/error-handling/typescript.md +0 -231
  58. package/config/agent/skills/chroma/chroma-local/local-chroma/python.md +0 -95
  59. package/config/agent/skills/chroma/chroma-local/local-chroma/typescript.md +0 -101
  60. package/config/agent/skills/chroma/chroma-local/metadata/python.md +0 -154
  61. package/config/agent/skills/chroma/chroma-local/metadata/typescript.md +0 -153
  62. package/config/agent/skills/chroma/chroma-local/querying/python.md +0 -147
  63. package/config/agent/skills/chroma/chroma-local/querying/typescript.md +0 -157
  64. package/config/agent/skills/chroma/chroma-local/regex/python.md +0 -69
  65. package/config/agent/skills/chroma/chroma-local/regex/typescript.md +0 -71
  66. package/config/agent/skills/chroma/chroma-local/understanding-a-codebase.md +0 -80
  67. package/config/agent/skills/chroma/chroma-local/updating-deleting/python.md +0 -159
  68. package/config/agent/skills/chroma/chroma-local/updating-deleting/typescript.md +0 -228
  69. package/config/agent/skills/find-skills/SKILL.md +0 -137
  70. package/config/agent/skills/fireworks-tech-graph/README.md +0 -528
  71. package/config/agent/skills/fireworks-tech-graph/README.zh.md +0 -499
  72. package/config/agent/skills/fireworks-tech-graph/SKILL.md +0 -538
  73. package/config/agent/skills/fireworks-tech-graph/agentloop-core.svg +0 -101
  74. package/config/agent/skills/fireworks-tech-graph/agents/openai.yaml +0 -4
  75. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style1-flat.png +0 -0
  76. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style2-dark.png +0 -0
  77. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style3-blueprint.png +0 -0
  78. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style4-notion.png +0 -0
  79. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style5-glass.png +0 -0
  80. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style6-claude.png +0 -0
  81. package/config/agent/skills/fireworks-tech-graph/assets/samples/sample-style7-openai.png +0 -0
  82. package/config/agent/skills/fireworks-tech-graph/fixtures/agent-memory-types-style4.json +0 -181
  83. package/config/agent/skills/fireworks-tech-graph/fixtures/api-flow-style7.json +0 -40
  84. package/config/agent/skills/fireworks-tech-graph/fixtures/mem0-style1.json +0 -297
  85. package/config/agent/skills/fireworks-tech-graph/fixtures/microservices-style3.json +0 -64
  86. package/config/agent/skills/fireworks-tech-graph/fixtures/multi-agent-style5.json +0 -45
  87. package/config/agent/skills/fireworks-tech-graph/fixtures/system-architecture-style6.json +0 -48
  88. package/config/agent/skills/fireworks-tech-graph/fixtures/tool-call-style2.json +0 -182
  89. package/config/agent/skills/fireworks-tech-graph/package.json +0 -42
  90. package/config/agent/skills/fireworks-tech-graph/references/icons.md +0 -406
  91. package/config/agent/skills/fireworks-tech-graph/references/style-1-flat-icon.md +0 -108
  92. package/config/agent/skills/fireworks-tech-graph/references/style-2-dark-terminal.md +0 -107
  93. package/config/agent/skills/fireworks-tech-graph/references/style-3-blueprint.md +0 -113
  94. package/config/agent/skills/fireworks-tech-graph/references/style-4-notion-clean.md +0 -94
  95. package/config/agent/skills/fireworks-tech-graph/references/style-5-glassmorphism.md +0 -125
  96. package/config/agent/skills/fireworks-tech-graph/references/style-6-claude-official.md +0 -209
  97. package/config/agent/skills/fireworks-tech-graph/references/style-7-openai.md +0 -215
  98. package/config/agent/skills/fireworks-tech-graph/references/style-diagram-matrix.md +0 -135
  99. package/config/agent/skills/fireworks-tech-graph/references/svg-layout-best-practices.md +0 -100
  100. package/config/agent/skills/fireworks-tech-graph/scripts/README.md +0 -244
  101. package/config/agent/skills/fireworks-tech-graph/scripts/generate-diagram.sh +0 -157
  102. package/config/agent/skills/fireworks-tech-graph/scripts/generate-from-template.py +0 -1556
  103. package/config/agent/skills/fireworks-tech-graph/scripts/test-all-styles.sh +0 -135
  104. package/config/agent/skills/fireworks-tech-graph/scripts/validate-svg.sh +0 -292
  105. package/config/agent/skills/fireworks-tech-graph/templates/agent-architecture.svg +0 -28
  106. package/config/agent/skills/fireworks-tech-graph/templates/architecture.svg +0 -23
  107. package/config/agent/skills/fireworks-tech-graph/templates/comparison-matrix.svg +0 -14
  108. package/config/agent/skills/fireworks-tech-graph/templates/data-flow.svg +0 -28
  109. package/config/agent/skills/fireworks-tech-graph/templates/er-diagram.svg +0 -21
  110. package/config/agent/skills/fireworks-tech-graph/templates/flowchart.svg +0 -21
  111. package/config/agent/skills/fireworks-tech-graph/templates/sequence.svg +0 -20
  112. package/config/agent/skills/fireworks-tech-graph/templates/state-machine.svg +0 -20
  113. package/config/agent/skills/fireworks-tech-graph/templates/timeline.svg +0 -19
  114. package/config/agent/skills/fireworks-tech-graph/templates/use-case.svg +0 -21
  115. package/config/agent/skills/hello/SKILL.md +0 -26
  116. package/config/agent/skills/librarian/SKILL.md +0 -199
  117. package/config/agent/skills/milvus-skill/README.md +0 -37
  118. package/config/agent/skills/milvus-skill/SKILL.md +0 -259
  119. package/config/agent/skills/milvus-skill/references/collection.md +0 -86
  120. package/config/agent/skills/milvus-skill/references/database.md +0 -24
  121. package/config/agent/skills/milvus-skill/references/index.md +0 -69
  122. package/config/agent/skills/milvus-skill/references/partition.md +0 -29
  123. package/config/agent/skills/milvus-skill/references/patterns.md +0 -150
  124. package/config/agent/skills/milvus-skill/references/user-role.md +0 -90
  125. package/config/agent/skills/milvus-skill/references/vector.md +0 -247
  126. package/config/agent/skills/pr/SKILL.md +0 -59
@@ -1,538 +0,0 @@
1
- ---
2
- name: "fireworks-tech-graph"
3
- description: >-
4
- "Create production-quality SVG technical diagrams (architecture, data flow,
5
- flowchart, sequence, UML, mind map, etc.) exported as PNG. Supports 7 visual
6
- styles including Flat, Dark Terminal, Blueprint, Notion Clean, Glassmorphism,
7
- Claude Official, and OpenAI Official. Trigger on: '画图' '帮我画' '生成图'
8
- '做个图' '架构图' '流程图' '可视化' '出图' '选择风格' '换风格'
9
- 'generate diagram' 'draw diagram' 'visualize' or any system/flow description
10
- the user wants illustrated."
11
- disable-model-invocation: true
12
- ---
13
-
14
- # Fireworks Tech Graph
15
-
16
- Generate production-quality SVG technical diagrams exported as PNG via `rsvg-convert`.
17
-
18
- ## Install Source
19
-
20
- Install this skill from GitHub:
21
-
22
- ```bash
23
- npx skills add yizhiyanhua-ai/fireworks-tech-graph
24
- ```
25
-
26
- Public package page:
27
-
28
- ```text
29
- https://www.npmjs.com/package/@yizhiyanhua-ai/fireworks-tech-graph
30
- ```
31
-
32
- Do not pass `@yizhiyanhua-ai/fireworks-tech-graph` directly to `skills add`, because the CLI expects a GitHub or local repository source.
33
-
34
- Update command:
35
-
36
- ```bash
37
- npx skills add yizhiyanhua-ai/fireworks-tech-graph --force -g -y
38
- ```
39
-
40
- ## Helper Scripts (Recommended)
41
-
42
- Four helper scripts in `scripts/` directory provide stable SVG generation and validation:
43
-
44
- ### 1. `generate-diagram.sh` - Validate SVG + export PNG
45
- ```bash
46
- ./scripts/generate-diagram.sh -t architecture -s 1 -o ./output/arch.svg
47
- ```
48
- - Validates an existing SVG file
49
- - Exports PNG after validation
50
- - Example: `./scripts/generate-diagram.sh -t architecture -s 1 -o ./output/arch.svg`
51
-
52
- ### 2. `generate-from-template.py` - Create starter SVG from template
53
- ```bash
54
- python3 ./scripts/generate-from-template.py architecture ./output/arch.svg '{"title":"My Diagram","nodes":[],"arrows":[]}'
55
- ```
56
- - Loads a built-in SVG template
57
- - Renders nodes, arrows, and legend entries from JSON input
58
- - Escapes text content to keep output XML-valid
59
-
60
- ### 3. `validate-svg.sh` - Validate SVG syntax
61
- ```bash
62
- ./scripts/validate-svg.sh <svg-file>
63
- ```
64
- - Checks XML syntax
65
- - Verifies tag balance
66
- - Validates marker references
67
- - Checks attribute completeness
68
- - Validates path data
69
-
70
- ### 4. `test-all-styles.sh` - Batch test all styles
71
- ```bash
72
- ./scripts/test-all-styles.sh
73
- ```
74
- - Tests multiple diagram sizes
75
- - Validates all generated SVGs
76
- - Generates test report
77
-
78
- **When to use scripts:**
79
- - Use scripts when generating complex SVGs to avoid syntax errors
80
- - Scripts provide automatic validation and error reporting
81
- - Recommended for production diagrams
82
-
83
- **When to generate SVG directly:**
84
- - Simple diagrams with few elements
85
- - Quick prototypes
86
- - When you need full control over SVG structure
87
-
88
- ## Style Selection (Interactive)
89
-
90
- When user requests a diagram **without specifying a style**, always ask for style preference first:
91
-
92
- ### Style Selection Prompt (Chinese)
93
- ```
94
- 🎨 请选择图表风格:
95
-
96
- 1️⃣ Flat Icon(默认) ████ 白底清新,适合技术文档
97
- 2️⃣ Dark Terminal ▓▓▓▓ 深色终端风,适合开发者
98
- 3️⃣ Blueprint ▒▒▒▒ 深蓝蓝图,适合架构图
99
- 4️⃣ Notion Clean ░░░░ 极简白,适合 Notion
100
- 5️⃣ Glassmorphism ▦▦▦▦ 玻璃拟态,适合演讲展示
101
- 6️⃣ Claude Official ▤▤▤▤ 暖奶油色,Claude 风格
102
- 7️⃣ OpenAI Official ▬▬▬▬ 纯白简洁,OpenAI 风格
103
-
104
- 请输入数字 1-7,或直接描述你想要的风格效果。
105
- 直接发送编号即可,例如:「3」表示 Blueprint 风格
106
- ```
107
-
108
- ### Style Selection Prompt (English)
109
- ```
110
- 🎨 Choose a diagram style:
111
-
112
- 1️⃣ Flat Icon (default) White, clean, for docs
113
- 2️⃣ Dark Terminal Dark #0f0f1a, for devs
114
- 3️⃣ Blueprint Deep blue #0a1628, for arch
115
- 4️⃣ Notion Clean Minimal white
116
- 5️⃣ Glassmorphism Dark gradient, for slides
117
- 6️⃣ Claude Official Warm cream #f8f6f3
118
- 7️⃣ OpenAI Official Pure white
119
-
120
- Enter a number 1-7, or describe the style you want.
121
- ```
122
-
123
- ### Style Selection Rules
124
-
125
- 1. **User specifies style** → Use that style directly, skip selection
126
- 2. **User doesn't specify** → Show style selection prompt above
127
- 3. **User says "随便"/"default"/"无所谓"** → Use Style 1 (Flat Icon)
128
- 4. **User says "换风格"/"换个风格"** → Show style options, apply selected
129
- 5. **User provides partial info** (e.g., "深色", "dark") → Map to closest match:
130
- - "深色"/"dark"/"黑色" → Style 2 (Dark Terminal)
131
- - "蓝色"/"蓝色系"/"blue" → Style 3 (Blueprint)
132
- - "简洁"/"简单"/"minimal" → Style 4 (Notion Clean)
133
- - "高级"/"酷"/"fancy"/"modern" → Style 5 (Glassmorphism)
134
- - "Claude"/"暖色"/"温暖" → Style 6
135
- - "OpenAI"/"白色"/"纯白" → Style 7
136
-
137
- ### Quick Style Preview
138
-
139
- After selecting style, show brief confirmation:
140
- - ✓ **已选择 Style 3 (Blueprint)** - 深蓝背景,适合架构文档
141
-
142
- ---
143
-
144
- ## Workflow (Always Follow This Order)
145
-
146
- 1. **Confirm style** — Ask style preference if not specified (see Style Selection above)
147
- 2. **Classify** the diagram type (see Diagram Types below)
148
- 3. **Extract structure** — identify layers, nodes, edges, flows, and semantic groups from user description
149
- 4. **Plan layout** — apply the layout rules for the diagram type
150
- 5. **Load style reference** — load `references/style-N.md` for exact color tokens and SVG patterns (N = selected style number)
151
- 6. **Map nodes to shapes** — use Shape Vocabulary below
152
- 7. **Check icon needs** — load `references/icons.md` for known products
153
- 8. **Write SVG** with adaptive strategy (see SVG Generation Strategy below)
154
- 9. **Validate**: Run `rsvg-convert file.svg -o /dev/null 2>&1` to check syntax
155
- 10. **Export PNG**: `rsvg-convert -w 1920 file.svg -o file.png`
156
- 11. **Add Watermark**: Use sharp to add "世界那么哒" watermark to bottom-right
157
-
158
- ### Watermark Implementation
159
-
160
- ```javascript
161
- // Watermark function using sharp
162
- const addWatermark = async (pngPath) => {
163
- const sharp = require('/path/to/sharp'); // Use known sharp location
164
-
165
- const pngBuffer = fs.readFileSync(pngPath);
166
- const image = sharp(pngBuffer);
167
- const metadata = await image.metadata();
168
-
169
- // Create watermark SVG
170
- const watermarkSvg = Buffer.from(`
171
- <svg width="${metadata.width}" height="${metadata.height}">
172
- <defs>
173
- <filter id="shadow" x="-20%" y="-20%" width="140%" height="140%">
174
- <feDropShadow dx="1" dy="1" stdDeviation="2" flood-opacity="0.5"/>
175
- </filter>
176
- </defs>
177
- <text
178
- x="${metadata.width - 20}"
179
- y="${metadata.height - 20}"
180
- text-anchor="end"
181
- font-family="Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif"
182
- font-size="${Math.max(16, Math.floor(metadata.width / 60))}"
183
- fill="rgba(128, 128, 128, 0.5)"
184
- filter="url(#shadow)"
185
- >世界那么哒</text>
186
- </svg>
187
- `);
188
-
189
- await sharp(watermarkSvg)
190
- .composite([{ input: pngBuffer, blend: 'over' }])
191
- .png()
192
- .toFile(pngPath + '.tmp');
193
-
194
- fs.renameSync(pngPath + '.tmp', pngPath);
195
- };
196
- ```
197
-
198
- **Note**: Watermark size scales with image width (font-size = width / 60, min 16px). Positioned 20px from bottom-right corner with semi-transparent gray color and subtle shadow.
199
-
200
- 12. **Report** the generated file paths
201
-
202
- ## Diagram Types & Layout Rules
203
-
204
- ### Architecture Diagram
205
- Nodes = services/components. Group into **horizontal layers** (top→bottom or left→right).
206
- - Typical layers: Client → Gateway/LB → Services → Data/Storage
207
- - Use `<rect>` dashed containers to group related services in the same layer
208
- - Arrow direction follows data/request flow
209
- - ViewBox: `0 0 960 600` standard, `0 0 960 800` for tall stacks
210
-
211
- ### Data Flow Diagram
212
- Emphasizes **what data moves where**. Focus on data transformation.
213
- - Label every arrow with the data type (e.g., "embeddings", "query", "context")
214
- - Use wider arrows (`stroke-width: 2.5`) for primary data paths
215
- - Dashed arrows for control/trigger flows
216
- - Color arrows by data category (not just Agent/RAG — use semantics)
217
-
218
- ### Flowchart / Process Flow
219
- Sequential decision/process steps.
220
- - Top-to-bottom preferred; left-to-right for wide flows
221
- - Diamond shapes for decisions, rounded rects for processes, parallelograms for I/O
222
- - Keep node labels short (≤3 words); put detail in sub-labels
223
- - Align nodes on a grid: x positions snap to 120px intervals, y to 80px
224
-
225
- ### Agent Architecture Diagram
226
- Shows how an AI agent reasons, uses tools, and manages memory.
227
- Key conceptual layers to always consider:
228
- - **Input layer**: User, query, trigger
229
- - **Agent core**: LLM, reasoning loop, planner
230
- - **Memory layer**: Short-term (context window), Long-term (vector/graph DB), Episodic
231
- - **Tool layer**: Tool calls, APIs, search, code execution
232
- - **Output layer**: Response, action, side-effects
233
- Use cyclic arrows (loop arcs) to show iterative reasoning. Separate memory types visually.
234
-
235
- ### Memory Architecture Diagram (Mem0, MemGPT-style)
236
- Specialized agent diagram focused on memory operations.
237
- - Show memory **write path** and **read path** separately (different arrow colors)
238
- - Memory tiers: Working Memory → Short-term → Long-term → External Store
239
- - Label memory operations: `store()`, `retrieve()`, `forget()`, `consolidate()`
240
- - Use stacked rects or layered cylinders for storage tiers
241
-
242
- ### Sequence Diagram
243
- Time-ordered message exchanges between participants.
244
- - Participants as vertical **lifelines** (top labels + vertical dashed lines)
245
- - Messages as horizontal arrows between lifelines, top-to-bottom time order
246
- - Activation boxes (thin filled rects on lifeline) show active processing
247
- - Group with `<rect>` loop/alt frames with label in top-left corner
248
- - ViewBox height = 80 + (num_messages × 50)
249
-
250
- ### Comparison / Feature Matrix
251
- Side-by-side comparison of approaches, systems, or components.
252
- - Column headers = systems, row headers = attributes
253
- - Row height: 40px; column width: min 120px; header row height: 50px
254
- - Checked cell: tinted background (e.g. `#dcfce7`) + `✓` checkmark; unsupported: `#f9fafb` fill
255
- - Alternating row fills (`#f9fafb` / `#ffffff`) for readability
256
- - Max readable columns: 5; beyond that, split into two diagrams
257
-
258
- ### Timeline / Gantt
259
- Horizontal time axis showing durations, phases, and milestones.
260
- - X-axis = time (weeks/months/quarters); Y-axis = items/tasks/phases
261
- - Bars: rounded rects, colored by category, labeled inside or beside
262
- - Milestone markers: diamond or filled circle at specific x position with label above
263
- - ViewBox: `0 0 960 400` typical; wider for many time periods: `0 0 1200 400`
264
-
265
- ### Mind Map / Concept Map
266
- Radial layout from central concept.
267
- - Central node at `cx=480, cy=280`
268
- - First-level branches: evenly distributed around center (360/N degrees)
269
- - Second-level branches: branch off first-level at 30-45° offset
270
- - Use curved `<path>` with cubic bezier for branches, not straight lines
271
-
272
- ### Class Diagram (UML)
273
- Static structure showing classes, attributes, methods, and relationships.
274
- - **Class box**: 3-compartment rect (name / attributes / methods), min width 160px
275
- - Top compartment: class name, bold, centered (abstract = *italic*)
276
- - Middle: attributes with visibility (`+` public, `-` private, `#` protected)
277
- - Bottom: method signatures, same visibility notation
278
- - **Relationships**:
279
- - Inheritance (extends): solid line + hollow triangle arrowhead, child → parent
280
- - Implementation (interface): dashed line + hollow triangle, class → interface
281
- - Association: solid line + open arrowhead, label with multiplicity (1, 0..*, 1..*)
282
- - Aggregation: solid line + hollow diamond on container side
283
- - Composition: solid line + filled diamond on container side
284
- - Dependency: dashed line + open arrowhead
285
- - **Interface**: `<<interface>>` stereotype above name, or circle/lollipop notation
286
- - **Enum**: compartment rect with `<<enumeration>>` stereotype, values in bottom
287
- - Layout: parent classes top, children below; interfaces to the left/right of implementors
288
- - ViewBox: `0 0 960 600` standard; `0 0 960 800` for deep hierarchies
289
-
290
- ### Use Case Diagram (UML)
291
- System functionality from user perspective.
292
- - **Actor**: stick figure (circle head + body line) placed outside system boundary
293
- - Label below figure, 13-14px
294
- - Primary actors on left, secondary/supporting on right
295
- - **Use case**: ellipse with label centered inside, min 140×60px
296
- - Keep names verb phrases: "Create Order", "Process Payment"
297
- - **System boundary**: large rect with dashed border + system name in top-left
298
- - **Relationships**:
299
- - Include: dashed arrow `<<include>>` from base to included use case
300
- - Extend: dashed arrow `<<extend>>` from extension to base use case
301
- - Generalization: solid line + hollow triangle (specialized → general)
302
- - Layout: system boundary centered, actors outside, use cases inside
303
- - ViewBox: `0 0 960 600` standard
304
-
305
- ### State Machine Diagram (UML)
306
- Lifecycle states and transitions of an entity.
307
- - **State**: rounded rect with state name, min 120×50px
308
- - Internal activities: small text `entry/ action`, `exit/ action`, `do/ activity`
309
- - **Initial state**: filled black circle (r=8), one outgoing arrow
310
- - **Final state**: filled circle (r=8) inside hollow circle (r=12)
311
- - **Choice**: small hollow diamond, guard labels on outgoing arrows `[condition]`
312
- - **Transition**: arrow with optional label `event [guard] / action`
313
- - Guard conditions in square brackets
314
- - Actions after `/`
315
- - **Composite/nested state**: larger rect containing sub-states, with name tab
316
- - **Fork/join**: thick horizontal or vertical black bar (synchronization)
317
- - Layout: initial state top-left, final state bottom-right, flow top-to-bottom
318
- - ViewBox: `0 0 960 600` standard
319
-
320
- ### ER Diagram (Entity-Relationship)
321
- Database schema and data relationships.
322
- - **Entity**: rect with entity name in header (bold), attributes below
323
- - Primary key attribute: underlined
324
- - Foreign key: italic or marked with (FK)
325
- - Min width: 160px; attribute font-size: 12px
326
- - **Relationship**: diamond shape on connecting line
327
- - Label inside diamond: "has", "belongs to", "enrolls in"
328
- - Cardinality labels near entity: `1`, `N`, `0..1`, `0..*`, `1..*`
329
- - **Weak entity**: double-bordered rect with double diamond relationship
330
- - **Associative entity**: diamond + rect hybrid (rect with diamond inside)
331
- - Line style: solid for identifying relationships, dashed for non-identifying
332
- - Layout: entities in 2-3 rows, relationships between related entities
333
- - ViewBox: `0 0 960 600` standard; wider `0 0 1200 600` for many entities
334
-
335
- ### Network Topology
336
- Physical or logical network infrastructure.
337
- - **Devices**: icon-like rects or rounded rects
338
- - Router: circle with cross arrows
339
- - Switch: rect with arrow grid
340
- - Server: stacked rect (rack icon)
341
- - Firewall: brick-pattern rect or shield shape
342
- - Load Balancer: horizontal split rect with arrows
343
- - Cloud: cloud path (overlapping arcs)
344
- - **Connections**: lines between device centers
345
- - Ethernet/wired: solid line, label bandwidth
346
- - Wireless: dashed line with WiFi symbol
347
- - VPN: dashed line with lock icon
348
- - **Subnets/Zones**: dashed rect containers with zone label (DMZ, Internal, External)
349
- - **Labels**: device hostname + IP below, 12-13px
350
- - Layout: tiered top-to-bottom (Internet → Edge → Core → Access → Endpoints)
351
- - ViewBox: `0 0 960 600` standard
352
-
353
- ## UML Coverage Map
354
-
355
- Full mapping of UML 14 diagram types to supported diagram types:
356
-
357
- | UML Diagram | Supported As | Notes |
358
- |-------------|-------------|-------|
359
- | Class | Class Diagram | Full UML notation |
360
- | Component | Architecture Diagram | Use colored fills per component type |
361
- | Deployment | Architecture Diagram | Add node/instance labels |
362
- | Package | Architecture Diagram | Use dashed grouping containers |
363
- | Composite Structure | Architecture Diagram | Nested rects within components |
364
- | Object | Class Diagram | Instance boxes with underlined name |
365
- | Use Case | Use Case Diagram | Full actor/ellipse/relationship |
366
- | Activity | Flowchart / Process Flow | Add fork/join bars |
367
- | State Machine | State Machine Diagram | Full UML notation |
368
- | Sequence | Sequence Diagram | Add alt/opt/loop frames |
369
- | Communication | — | Approximate with Sequence (swap axes) |
370
- | Timing | Timeline | Adapt time axis |
371
- | Interaction Overview | Flowchart | Combine activity + sequence fragments |
372
- | ER Diagram | ER Diagram | Chen/Crow's foot notation |
373
-
374
- ## Shape Vocabulary
375
-
376
- Map semantic concepts to consistent shapes across all diagram types:
377
-
378
- | Concept | Shape | Notes |
379
- |---------|-------|-------|
380
- | User / Human | Circle + body path | Stick figure or avatar |
381
- | LLM / Model | Rounded rect with brain/spark icon or gradient fill | Use accent color |
382
- | Agent / Orchestrator | Hexagon or rounded rect with double border | Signals "active controller" |
383
- | Memory (short-term) | Rounded rect, dashed border | Ephemeral = dashed |
384
- | Memory (long-term) | Cylinder (database shape) | Persistent = solid cylinder |
385
- | Vector Store | Cylinder with grid lines inside | Add 3 horizontal lines |
386
- | Graph DB | Circle cluster (3 overlapping circles) | |
387
- | Tool / Function | Gear-like rect or rect with wrench icon | |
388
- | API / Gateway | Hexagon (single border) | |
389
- | Queue / Stream | Horizontal tube (pipe shape) | |
390
- | File / Document | Folded-corner rect | |
391
- | Browser / UI | Rect with 3-dot titlebar | |
392
- | Decision | Diamond | Flowcharts only |
393
- | Process / Step | Rounded rect | Standard box |
394
- | External Service | Rect with cloud icon or dashed border | |
395
- | Data / Artifact | Parallelogram | I/O in flowcharts |
396
-
397
- ## Arrow Semantics
398
-
399
- Always assign arrow meaning, not just color:
400
-
401
- | Flow Type | Color | Stroke | Dash | Meaning |
402
- |-----------|-------|--------|------|---------|
403
- | Primary data flow | blue `#2563eb` | 2px solid | none | Main request/response path |
404
- | Control / trigger | orange `#ea580c` | 1.5px solid | none | One system triggering another |
405
- | Memory read | green `#059669` | 1.5px solid | none | Retrieval from store |
406
- | Memory write | green `#059669` | 1.5px | `5,3` | Write/store operation |
407
- | Async / event | gray `#6b7280` | 1.5px | `4,2` | Non-blocking, event-driven |
408
- | Embedding / transform | purple `#7c3aed` | 1px solid | none | Data transformation |
409
- | Feedback / loop | purple `#7c3aed` | 1.5px curved | none | Iterative reasoning loop |
410
-
411
- Always include a **legend** when 2+ arrow types are used.
412
-
413
- ## Layout Rules & Validation
414
-
415
- **Spacing**:
416
- - Same-layer nodes: 80px horizontal, 120px vertical between layers
417
- - Canvas margins: 40px minimum, 60px between node edges
418
- - Snap to 8px grid: horizontal 120px intervals, vertical 120px intervals
419
-
420
- **Arrow Labels** (CRITICAL):
421
- - MUST have background rect: `<rect fill="canvas_bg" opacity="0.95"/>` with 4px horizontal, 2px vertical padding
422
- - Place mid-arrow, ≤3 words, stagger by 15-20px when multiple arrows converge
423
- - Maintain 10px safety distance from nodes
424
-
425
- **Arrow Routing**:
426
- - Prefer orthogonal (L-shaped) paths to minimize crossings
427
- - Anchor arrows on component edges, not geometric centers
428
- - Route around dense node clusters, use different y-offsets for parallel arrows
429
- - Jump-over arcs (5px radius) for unavoidable crossings
430
-
431
- **Line Overlap Prevention** (CRITICAL - most common bug on Codex):
432
- When two arrows must cross each other, ALWAYS use jump-over arcs to prevent visual overlap:
433
- - Crossing horizontal arrows: add a small semicircle arc (radius 5px, stroke same color as arrow, fill none) that "jumps over" the other line
434
- - SVG pattern for jump-over: use a white/matching-background arc on the lower layer, then draw the upper arc on top
435
- - Multiple crossings: stagger arc radii (5px, 7px, 9px) so arcs don't overlap each other
436
- - Never let two arrows' straight-line segments cross without a jump-over arc
437
-
438
- **Validation Checklist** (run before finalizing):
439
- 1. **Arrow-Component Collision**: Arrows MUST NOT pass through component interiors (route around with orthogonal paths)
440
- 2. **Text Overflow**: All text MUST fit with 8px padding (estimate: `text.length × 7px ≤ shape_width - 16px`)
441
- 3. **Arrow-Text Alignment**: Arrow endpoints MUST connect to shape edges (not floating); all arrow labels MUST have background rects
442
- 4. **Container Discipline**: Prefer arrows entering and leaving section containers through open gaps between components, not through inner component bodies
443
-
444
- ## SVG Technical Rules
445
-
446
- - ViewBox: `0 0 960 600` default; `0 0 960 800` tall; `0 0 1200 600` wide
447
- - Fonts: embed via `<style>font-family: ...</style>` — no external `@import` (breaks rsvg-convert)
448
- - `<defs>`: arrow markers, gradients, filters, clip paths
449
- - Text: minimum 12px, prefer 13-14px labels, 11px sub-labels, 16-18px titles
450
- - All arrows: `<marker>` with `markerEnd`, sized `markerWidth="10" markerHeight="7"`
451
- - Drop shadows: `<feDropShadow>` in `<filter>`, apply sparingly (key nodes only)
452
- - Curved paths: use `M x1,y1 C cx1,cy1 cx2,cy2 x2,y2` cubic bezier for loops/feedback arrows
453
- - Clip content: use `<clipPath>` if text might overflow a node box
454
-
455
- ## SVG Generation & Error Prevention
456
-
457
- **MANDATORY: Python List Method** (ALWAYS use this):
458
- ```python
459
- python3 << 'EOF'
460
- lines = []
461
- lines.append('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 700">')
462
- lines.append(' <defs>')
463
- # ... each line separately
464
- lines.append('</svg>')
465
-
466
- with open('/path/to/output.svg', 'w') as f:
467
- f.write('\n'.join(lines))
468
- print("SVG generated successfully")
469
- EOF
470
- ```
471
-
472
- **Why mandatory**: Prevents character truncation, typos, and syntax errors. Each line is independent and easy to verify.
473
-
474
- **Pre-Tool-Call Checklist** (CRITICAL - use EVERY time):
475
- 1. ✅ Can I write out the COMPLETE command/content right now?
476
- 2. ✅ Do I have ALL required parameters ready?
477
- 3. ✅ Have I checked for syntax errors in my prepared content?
478
-
479
- **If ANY answer is NO**: STOP. Do NOT call the tool. Prepare the content first.
480
-
481
- **Error Recovery Protocol**:
482
- - **First error**: Analyze root cause, apply targeted fix
483
- - **Second error**: Switch method entirely (Python list → chunked generation)
484
- - **Third error**: STOP and report to user - do NOT loop endlessly
485
- - **Never**: Retry the same failing command or call tools with empty parameters
486
-
487
- **Validation** (run after generation):
488
- ```bash
489
- rsvg-convert file.svg -o /tmp/test.png 2>&1 && echo "✓ Valid" && rm /tmp/test.png
490
- ```
491
-
492
- **If using `generate-from-template.py`**:
493
- - Prefer `source` / `target` node ids in arrow JSON so the generator can snap to node edges
494
- - Keep `x1,y1,x2,y2` as hints or fallback coordinates, not the main routing primitive
495
- - Let the generator choose orthogonal routes; avoid hardcoding center-to-center straight lines unless the path is guaranteed clear
496
-
497
- **Common Syntax Errors to Avoid**:
498
- - ❌ `yt-anchor` → ✅ `y="60" text-anchor="middle"`
499
- - ❌ `x="390` (missing y) → ✅ `x="390" y="250"`
500
- - ❌ `fill=#fff` → ✅ `fill="#ffffff"`
501
- - ❌ `marker-end=` → ✅ `marker-end="url(#arrow)"`
502
- - ❌ `L 29450` → ✅ `L 290,220`
503
- - ❌ Missing `</svg>` at end
504
-
505
- ## Output
506
-
507
- - **Default**: `./[derived-name].svg` and `./[derived-name].png` in current directory
508
- - **Custom**: user specifies path with `--output /path/` or `输出到 /path/`
509
- - **PNG export**: `rsvg-convert -w 1920 file.svg -o file.png` (1920px = 2x retina)
510
- - **Watermark**: Automatically add "世界那么哒" watermark to bottom-right corner
511
-
512
- ## Styles
513
-
514
- | # | Name | Background | Best For |
515
- |---|------|-----------|----------|
516
- | 1 | **Flat Icon** (default) | White | Blogs, docs, presentations |
517
- | 2 | **Dark Terminal** | `#0f0f1a` | GitHub, dev articles |
518
- | 3 | **Blueprint** | `#0a1628` | Architecture docs |
519
- | 4 | **Notion Clean** | White, minimal | Notionnce |
520
- | 5 | **Glassmorphism** | Dark gradient | Product sites, keynotes |
521
- | 6 | **Claude Official** | Warm cream `#f8f6f3` | Anthropic-style diagrams |
522
- | 7 | **OpenAI Official** | Pure white `#ffffff` | OpenAI-style diagrams |
523
-
524
- Load `references/style-N.md` for exact color tokens and SVG patterns.
525
-
526
- ## Style Selection
527
-
528
- **Default**: Style 1 (Flat Icon) for most diagrams. Load `references/style-diagram-matrix.md` for detailed style-to-diagram-type recommendations.
529
-
530
- These patterns appear frequently — internalize them:
531
-
532
- **RAG Pipeline**: Query → Embed → VectorSearch → Retrieve → Augment → LLM → Response
533
- **Agentic RAG**: adds Agent loop with Tool use between Query and LLM
534
- **Agentic Search**: Query → Planner → [Search Tool / Calculator / Code] → Synthesizer → Response
535
- **Mem0 / Memory Layer**: Input → Memory Manager → [Write: VectorDB + GraphDB] / [Read: Retrieve+Rank] → Context
536
- **Agent Memory Types**: Sensory (raw input) → Working (context window) → Episodic (past interactions) → Semantic (facts) → Procedural (skills)
537
- **Multi-Agent**: Orchestrator → [SubAgent A / SubAgent B / SubAgent C] → Aggregator → Output
538
- **Tool Call Flow**: LLM → Tool Selector → Tool Execution → Result Parser → LLM (loop)
@@ -1,101 +0,0 @@
1
- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 960 700">
2
- <defs>
3
- <marker id="arrowBlue" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
4
- <polygon points="0 0, 10 3.5, 0 7" fill="#2563eb"/>
5
- </marker>
6
- <marker id="arrowPurple" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
7
- <polygon points="0 0, 10 3.5, 0 7" fill="#7c3aed"/>
8
- </marker>
9
- <marker id="arrowGreen" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
10
- <polygon points="0 0, 10 3.5, 0 7" fill="#059669"/>
11
- </marker>
12
- <marker id="arrowOrange" markerWidth="10" markerHeight="7" refX="9" refY="3.5" orient="auto">
13
- <polygon points="0 0, 10 3.5, 0 7" fill="#ea580c"/>
14
- </marker>
15
- </defs>
16
- <style>
17
- text { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
18
- .title { font-size: 24px; font-weight: 700; fill: #1e293b; }
19
- .node-label { font-size: 16px; font-weight: 600; fill: #1e293b; }
20
- .sub-label { font-size: 13px; font-weight: 400; fill: #64748b; }
21
- .arrow-label { font-size: 12px; font-weight: 400; fill: #475569; }
22
- </style>
23
- <rect width="960" height="700" fill="#ffffff"/>
24
- <text x="480" y="50" text-anchor="middle" class="title">AgentLoop Core Architecture</text>
25
-
26
- <!-- Input Layer -->
27
- <circle cx="480" cy="120" r="35" fill="#dbeafe" stroke="#2563eb" stroke-width="2.5"/>
28
- <text x="480" y="118" text-anchor="middle" class="node-label">User</text>
29
- <text x="480" y="135" text-anchor="middle" class="sub-label">Input</text>
30
-
31
- <!-- Agent Core -->
32
- <rect x="360" y="200" width="240" height="100" rx="12" fill="#f3e8ff" stroke="#7c3aed" stroke-width="3"/>
33
- <text x="480" y="235" text-anchor="middle" class="node-label">Agent Loop</text>
34
- <text x="480" y="255" text-anchor="middle" class="sub-label">Reasoning Engine</text>
35
- <text x="480" y="275" text-anchor="middle" class="sub-label">Plan → Act → Observe</text>
36
-
37
- <!-- Memory Layer -->
38
- <rect x="100" y="220" width="180" height="60" rx="8" fill="#dcfce7" stroke="#059669" stroke-width="2.5" stroke-dasharray="5,3"/>
39
- <text x="190" y="245" text-anchor="middle" class="node-label">Short-term</text>
40
- <text x="190" y="265" text-anchor="middle" class="sub-label">Context Window</text>
41
-
42
- <ellipse cx="190" cy="400" rx="80" ry="50" fill="#dcfce7" stroke="#059669" stroke-width="2.5"/>
43
- <text x="190" y="395" text-anchor="middle" class="node-label">Long-term</text>
44
- <text x="190" y="415" text-anchor="middle" class="sub-label">Vector Store</text>
45
-
46
- <!-- Tool Layer -->
47
- <rect x="680" y="220" width="160" height="60" rx="8" fill="#fed7aa" stroke="#ea580c" stroke-width="2.5"/>
48
- <text x="760" y="245" text-anchor="middle" class="node-label">Tools</text>
49
- <text x="760" y="265" text-anchor="middle" class="sub-label">Functions</text>
50
-
51
- <!-- Output Layer -->
52
- <rect x="390" y="500" width="180" height="70" rx="8" fill="#dbeafe" stroke="#2563eb" stroke-width="2.5"/>
53
- <text x="480" y="525" text-anchor="middle" class="node-label">Response</text>
54
- <text x="480" y="545" text-anchor="middle" class="sub-label">Action / Output</text>
55
-
56
- <!-- Arrows -->
57
- <line x1="480" y1="155" x2="480" y2="200" stroke="#2563eb" stroke-width="2" marker-end="url(#arrowBlue)"/>
58
- <rect x="455" y="168" width="50" height="18" fill="#ffffff" opacity="0.95"/>
59
- <text x="480" y="180" text-anchor="middle" class="arrow-label">query</text>
60
-
61
- <path d="M 360,250 L 280,250" stroke="#059669" stroke-width="2" marker-end="url(#arrowGreen)"/>
62
- <rect x="295" y="237" width="50" height="18" fill="#ffffff" opacity="0.95"/>
63
- <text x="320" y="249" text-anchor="middle" class="arrow-label">read</text>
64
-
65
- <path d="M 280,250 L 360,250" stroke="#059669" stroke-width="2" stroke-dasharray="5,3" marker-end="url(#arrowGreen)"/>
66
- <rect x="297" y="257" width="50" height="18" fill="#ffffff" opacity="0.95"/>
67
- <text x="320" y="269" text-anchor="middle" class="arrow-label">write</text>
68
-
69
- <path d="M 600,250 L 680,250" stroke="#ea580c" stroke-width="2" marker-end="url(#arrowOrange)"/>
70
- <rect x="615" y="237" width="50" height="18" fill="#ffffff" opacity="0.95"/>
71
- <text x="640" y="249" text-anchor="middle" class="arrow-label">call</text>
72
-
73
- <path d="M 680,250 L 600,250" stroke="#ea580c" stroke-width="2" marker-end="url(#arrowOrange)"/>
74
- <rect x="615" y="257" width="55" height="18" fill="#ffffff" opacity="0.95"/>
75
- <text x="642" y="269" text-anchor="middle" class="arrow-label">result</text>
76
-
77
- <line x1="480" y1="300" x2="480" y2="500" stroke="#2563eb" stroke-width="2" marker-end="url(#arrowBlue)"/>
78
- <rect x="445" y="390" width="70" height="18" fill="#ffffff" opacity="0.95"/>
79
- <text x="480" y="402" text-anchor="middle" class="arrow-label">generate</text>
80
-
81
- <path d="M 240,380 Q 240,320 360,280" stroke="#059669" stroke-width="1.5" marker-end="url(#arrowGreen)"/>
82
- <rect x="265" y="317" width="60" height="18" fill="#ffffff" opacity="0.95"/>
83
- <text x="295" y="329" text-anchor="middle" class="arrow-label">retrieve</text>
84
-
85
- <path d="M 420,300 Q 420,450 390,520" stroke="#7c3aed" stroke-width="2" marker-end="url(#arrowPurple)"/>
86
- <rect x="365" y="400" width="60" height="18" fill="#ffffff" opacity="0.95"/>
87
- <text x="395" y="412" text-anchor="middle" class="arrow-label">feedback</text>
88
-
89
- <!-- Legend -->
90
- <line x1="750" y1="90" x2="780" y2="90" stroke="#2563eb" stroke-width="2" marker-end="url(#arrowBlue)"/>
91
- <text x="790" y="95" class="arrow-label">Data Flow</text>
92
-
93
- <line x1="750" y1="115" x2="780" y2="115" stroke="#059669" stroke-width="2" marker-end="url(#arrowGreen)"/>
94
- <text x="790" y="120" class="arrow-label">Memory</text>
95
-
96
- <line x1="750" y1="140" x2="780" y2="140" stroke="#ea580c" stroke-width="2" marker-end="url(#arrowOrange)"/>
97
- <text x="790" y="145" class="arrow-label">Tool Call</text>
98
-
99
- <line x1="750" y1="165" x2="780" y2="165" stroke="#7c3aed" stroke-width="2" marker-end="url(#arrowPurple)"/>
100
- <text x="790" y="170" class="arrow-label">Feedback Loop</text>
101
- </svg>
@@ -1,4 +0,0 @@
1
- interface:
2
- display_name: "Fireworks Tech Graph"
3
- short_description: "Generate polished SVG and PNG technical diagrams"
4
- default_prompt: "Turn the user's system or workflow description into a polished SVG diagram and export a PNG."