riazmo commited on
Commit
58eca4e
·
verified ·
1 Parent(s): ca31d8a

Upload agents.yaml

Browse files
Files changed (1) hide show
  1. config/agents.yaml +435 -0
config/agents.yaml ADDED
@@ -0,0 +1,435 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # =============================================================================
2
+ # DESIGN SYSTEM EXTRACTOR v2 - AGENT CONFIGURATIONS
3
+ # =============================================================================
4
+ #
5
+ # This file defines the personas and configurations for each agent in the
6
+ # design system extraction pipeline.
7
+ #
8
+ # Model Provider Options (via HuggingFace Inference Providers):
9
+ # - novita (default, good balance of cost/quality)
10
+ # - groq (fastest, good for Llama/Qwen)
11
+ # - cerebras (ultra-fast)
12
+ # - sambanova (good for Llama)
13
+ # - together (wide model selection)
14
+ # - fireworks-ai (good for code models)
15
+ #
16
+ # =============================================================================
17
+
18
+ # =============================================================================
19
+ # INFERENCE PROVIDER CONFIGURATION
20
+ # =============================================================================
21
+ inference:
22
+ # Default provider for all LLM calls
23
+ default_provider: "novita"
24
+
25
+ # Fallback chain if primary fails
26
+ fallback_providers:
27
+ - "together"
28
+ - "sambanova"
29
+ - "groq"
30
+
31
+ # HuggingFace account tiers
32
+ billing:
33
+ free_tier_credits: 0.10 # USD per month
34
+ pro_tier_credits: 2.00 # USD per month ($9/mo subscription)
35
+ warning_threshold: 0.80 # Warn at 80% usage
36
+
37
+ # Show cost tracking in logs
38
+ show_cost_tracking: true
39
+
40
+ # =============================================================================
41
+ # STAGE 1: EXTRACTION (No LLM needed)
42
+ # =============================================================================
43
+
44
+ agent1_crawler:
45
+ name: "Website Crawler"
46
+ persona: "Meticulous Design Archaeologist"
47
+ description: |
48
+ Discovers and crawls website pages to extract design tokens.
49
+ Uses Playwright for browser automation.
50
+ model: null # Rule-based, no LLM needed
51
+
52
+ agent1_extractor:
53
+ name: "Token Extractor"
54
+ persona: "Meticulous Design Archaeologist"
55
+ description: |
56
+ Extracts colors, typography, spacing, radius, and shadows from pages.
57
+ Pure CSS/computed style extraction.
58
+ model: null # Rule-based, no LLM needed
59
+
60
+ # =============================================================================
61
+ # STAGE 1: NORMALIZATION
62
+ # =============================================================================
63
+
64
+ agent2_normalizer:
65
+ name: "Token Normalizer"
66
+ persona: "Design System Librarian"
67
+ description: |
68
+ Cleans, deduplicates, and structures extracted tokens.
69
+ Infers naming patterns and semantic roles.
70
+ model: "microsoft/Phi-3.5-mini-instruct"
71
+ provider: "novita"
72
+ max_tokens: 1000
73
+ temperature: 0.3
74
+ tasks:
75
+ - Clean noisy extraction data
76
+ - Deduplicate similar tokens
77
+ - Infer semantic naming (primary, secondary, etc.)
78
+ - Tag confidence levels
79
+
80
+ # =============================================================================
81
+ # STAGE 2: MULTI-AGENT ANALYSIS (LangGraph Parallel)
82
+ # =============================================================================
83
+ #
84
+ # Architecture:
85
+ # LLM 1 ─┐
86
+ # ├──> HEAD ──> Final Recommendations
87
+ # LLM 2 ─┘
88
+ #
89
+ # LLM 1 and LLM 2 run in PARALLEL via LangGraph
90
+ # HEAD compiles results and resolves conflicts
91
+ #
92
+ # =============================================================================
93
+
94
+ stage2_llm1:
95
+ name: "Design Analyst 1"
96
+ persona: "Senior Design Systems Architect (Global Perspective)"
97
+ description: |
98
+ Analyzes design tokens against industry best practices.
99
+ Focuses on global/Asian design systems (Ant Design, etc.)
100
+ model: "Qwen/Qwen2.5-72B-Instruct"
101
+ provider: "novita"
102
+ max_tokens: 1500
103
+ temperature: 0.4
104
+ # Cost tracking (per million tokens)
105
+ cost_per_million_input: 0.29
106
+ cost_per_million_output: 0.59
107
+ tasks:
108
+ - Analyze typography patterns and scale consistency
109
+ - Evaluate color system and semantic usage
110
+ - Check AA/WCAG accessibility compliance
111
+ - Assess spacing consistency and grid alignment
112
+ - Compare against competitor design systems
113
+ expertise:
114
+ - Typography best practices and type scales
115
+ - Color theory and accessibility standards
116
+ - Spacing systems (4px, 8px grids)
117
+ - International design standards
118
+ - Ant Design, Chakra UI patterns
119
+
120
+ stage2_llm2:
121
+ name: "Design Analyst 2"
122
+ persona: "Senior Design Systems Architect (Western Perspective)"
123
+ description: |
124
+ Analyzes design tokens against industry best practices.
125
+ Focuses on Western/US design systems (Material, Apple, etc.)
126
+ model: "meta-llama/Llama-3.3-70B-Instruct"
127
+ provider: "novita"
128
+ max_tokens: 1500
129
+ temperature: 0.4
130
+ # Cost tracking (per million tokens)
131
+ cost_per_million_input: 0.59
132
+ cost_per_million_output: 0.79
133
+ tasks:
134
+ - Analyze typography patterns and scale consistency
135
+ - Evaluate color system and semantic usage
136
+ - Check AA/WCAG accessibility compliance
137
+ - Assess spacing consistency and grid alignment
138
+ - Compare against competitor design systems
139
+ expertise:
140
+ - Material Design 3 patterns
141
+ - Apple Human Interface Guidelines
142
+ - Shopify Polaris conventions
143
+ - IBM Carbon design standards
144
+ - Atlassian Design System
145
+
146
+ stage2_head:
147
+ name: "Head Compiler"
148
+ persona: "Principal Design Systems Architect"
149
+ description: |
150
+ Compiles analyses from both LLM analysts.
151
+ Resolves conflicts and synthesizes final recommendations.
152
+ model: "meta-llama/Llama-3.3-70B-Instruct"
153
+ provider: "novita"
154
+ max_tokens: 2000
155
+ temperature: 0.3
156
+ # Cost tracking (per million tokens)
157
+ cost_per_million_input: 0.59
158
+ cost_per_million_output: 0.79
159
+ tasks:
160
+ - Compare both analyst perspectives
161
+ - Identify agreements and disagreements
162
+ - Resolve conflicts with clear reasoning
163
+ - Synthesize final recommendations
164
+ - Provide confidence scores
165
+ expertise:
166
+ - Cross-cultural design synthesis
167
+ - Conflict resolution and arbitration
168
+ - Best practice prioritization
169
+
170
+ stage2_rules:
171
+ name: "Rule Engine"
172
+ persona: "Calculation Engine"
173
+ description: |
174
+ Performs deterministic calculations.
175
+ No LLM needed - pure math/logic.
176
+ model: null # No LLM - FREE
177
+ tasks:
178
+ - Generate type scale options (1.2, 1.25, 1.333)
179
+ - Calculate spacing grid alignments (4px, 8px)
180
+ - Generate color ramps (50-950 shades)
181
+ - Compute contrast ratios for accessibility
182
+
183
+ # =============================================================================
184
+ # STAGE 3: GENERATION
185
+ # =============================================================================
186
+
187
+ agent4_generator:
188
+ name: "JSON Generator"
189
+ persona: "Automation Engineer"
190
+ description: |
191
+ Converts finalized tokens to production-ready JSON.
192
+ Generates Figma-compatible token files.
193
+ model: "mistralai/Codestral-22B-v0.1"
194
+ provider: "novita"
195
+ max_tokens: 2000
196
+ temperature: 0.2
197
+ tasks:
198
+ - Generate final JSON structure
199
+ - Apply selected upgrades
200
+ - Format for Figma Tokens Studio
201
+ - Include metadata and versioning
202
+
203
+ # =============================================================================
204
+ # COMPETITOR DESIGN SYSTEMS
205
+ # =============================================================================
206
+
207
+ competitors:
208
+ # Default list (shown in UI, user can edit)
209
+ default:
210
+ - "Material Design 3"
211
+ - "Apple Human Interface Guidelines"
212
+ - "Shopify Polaris"
213
+ - "IBM Carbon"
214
+ - "Atlassian Design System"
215
+
216
+ # Suggestions for user to add
217
+ suggestions:
218
+ - "Ant Design"
219
+ - "Chakra UI"
220
+ - "Tailwind CSS"
221
+ - "Bootstrap"
222
+ - "Salesforce Lightning"
223
+ - "Adobe Spectrum"
224
+ - "GitHub Primer"
225
+ - "Microsoft Fluent"
226
+ - "Radix UI"
227
+ - "MUI (Material UI)"
228
+
229
+ # =============================================================================
230
+ # LLM PROMPT TEMPLATES
231
+ # =============================================================================
232
+
233
+ prompts:
234
+ # Prompt for LLM 1 and LLM 2 (same structure, different perspective)
235
+ analyst: |
236
+ You are a {persona}.
237
+
238
+ ## YOUR TASK
239
+ Analyze these design tokens extracted from a website and compare against industry best practices.
240
+
241
+ ## EXTRACTED TOKENS
242
+ {tokens_summary}
243
+
244
+ ## COMPETITOR DESIGN SYSTEMS TO RESEARCH
245
+ {competitors}
246
+
247
+ ## ANALYZE THE FOLLOWING:
248
+
249
+ ### 1. Typography
250
+ - Is the type scale consistent? Does it follow a mathematical ratio?
251
+ - What is the detected base size?
252
+ - Compare to competitors: what ratios do they use?
253
+ - Score (1-10) and specific recommendations
254
+
255
+ ### 2. Colors
256
+ - Is the color palette cohesive?
257
+ - Are semantic colors properly defined (primary, secondary, etc.)?
258
+ - Compare to competitors: how do they structure colors?
259
+ - Score (1-10) and specific recommendations
260
+
261
+ ### 3. Accessibility (AA Compliance)
262
+ - What contrast issues exist?
263
+ - Which color combinations fail WCAG AA (4.5:1 for text)?
264
+ - Specific fixes needed
265
+ - Score (1-10)
266
+
267
+ ### 4. Spacing
268
+ - Is spacing consistent? Does it follow a grid (4px, 8px)?
269
+ - What base unit is detected?
270
+ - Compare to competitors: what spacing systems do they use?
271
+ - Score (1-10) and specific recommendations
272
+
273
+ ### 5. Overall Assessment
274
+ - Top 3 priorities for improvement
275
+ - What works well (keep these)
276
+ - What needs immediate attention
277
+
278
+ ## RESPOND IN JSON FORMAT:
279
+ ```json
280
+ {{
281
+ "typography": {{
282
+ "analysis": "...",
283
+ "detected_ratio": 1.2,
284
+ "detected_base": 16,
285
+ "score": 7,
286
+ "recommendations": ["...", "..."]
287
+ }},
288
+ "colors": {{
289
+ "analysis": "...",
290
+ "score": 6,
291
+ "recommendations": ["...", "..."]
292
+ }},
293
+ "accessibility": {{
294
+ "issues": ["...", "..."],
295
+ "score": 5,
296
+ "fixes": ["...", "..."]
297
+ }},
298
+ "spacing": {{
299
+ "analysis": "...",
300
+ "detected_base": 8,
301
+ "score": 7,
302
+ "recommendations": ["...", "..."]
303
+ }},
304
+ "overall_assessment": "...",
305
+ "top_3_priorities": ["...", "...", "..."],
306
+ "confidence": 85
307
+ }}
308
+ ```
309
+
310
+ # Prompt for HEAD compiler
311
+ head_compiler: |
312
+ You are a Principal Design Systems Architect compiling analyses from two expert analysts.
313
+
314
+ ## ANALYST 1 (Global/Asian Perspective) FINDINGS:
315
+ {llm1_analysis}
316
+
317
+ ## ANALYST 2 (Western/US Perspective) FINDINGS:
318
+ {llm2_analysis}
319
+
320
+ ## RULE-BASED CALCULATIONS:
321
+ {rule_calculations}
322
+
323
+ ## YOUR TASK:
324
+ 1. Compare both analyst perspectives
325
+ 2. Identify where they AGREE (high confidence)
326
+ 3. Identify where they DISAGREE (need resolution)
327
+ 4. Resolve disagreements with clear reasoning
328
+ 5. Synthesize final recommendations
329
+
330
+ ## RESPOND IN JSON FORMAT:
331
+ ```json
332
+ {{
333
+ "agreements": [
334
+ {{"topic": "typography", "finding": "...", "confidence": 95}},
335
+ ...
336
+ ],
337
+ "disagreements": [
338
+ {{"topic": "spacing", "llm1_view": "...", "llm2_view": "...", "resolution": "...", "reasoning": "..."}}
339
+ ],
340
+ "final_recommendations": {{
341
+ "type_scale": "1.25",
342
+ "type_scale_rationale": "Both analysts agree 1.25 (Major Third) balances readability and hierarchy",
343
+ "spacing_base": "8px",
344
+ "spacing_rationale": "8px grid provides better alignment with industry standards",
345
+ "color_improvements": ["Generate full ramps", "Fix contrast on secondary"],
346
+ "accessibility_fixes": ["Increase body text contrast to 4.5:1"]
347
+ }},
348
+ "overall_confidence": 88,
349
+ "summary": "The extracted design system shows strong typography foundations but needs spacing normalization and color accessibility improvements."
350
+ }}
351
+ ```
352
+
353
+ # =============================================================================
354
+ # EXTRACTION SETTINGS
355
+ # =============================================================================
356
+
357
+ extraction:
358
+ viewports:
359
+ desktop:
360
+ width: 1440
361
+ height: 900
362
+ name: "Desktop"
363
+ mobile:
364
+ width: 375
365
+ height: 812
366
+ name: "Mobile"
367
+
368
+ crawling:
369
+ max_pages: 20
370
+ min_pages: 10
371
+ scroll_behavior: "smooth"
372
+ wait_for_network_idle: true
373
+ network_idle_timeout_ms: 5000
374
+ skip_infinite_scroll: true
375
+
376
+ # =============================================================================
377
+ # TYPE SCALE OPTIONS
378
+ # =============================================================================
379
+
380
+ type_scales:
381
+ minor_second:
382
+ ratio: 1.067
383
+ name: "Minor Second"
384
+ description: "Very subtle, good for dense data UIs"
385
+ major_second:
386
+ ratio: 1.125
387
+ name: "Major Second"
388
+ description: "Subtle progression"
389
+ minor_third:
390
+ ratio: 1.2
391
+ name: "Minor Third"
392
+ description: "Balanced, widely used"
393
+ major_third:
394
+ ratio: 1.25
395
+ name: "Major Third"
396
+ description: "Classic, recommended for most UIs"
397
+ recommended: true
398
+ perfect_fourth:
399
+ ratio: 1.333
400
+ name: "Perfect Fourth"
401
+ description: "Strong hierarchy, good for marketing"
402
+ golden_ratio:
403
+ ratio: 1.618
404
+ name: "Golden Ratio"
405
+ description: "Dramatic, use sparingly"
406
+
407
+ # =============================================================================
408
+ # SPACING SYSTEMS
409
+ # =============================================================================
410
+
411
+ spacing_systems:
412
+ 4px_grid:
413
+ base: 4
414
+ name: "4px Grid"
415
+ description: "Fine-grained control, good for dense UIs"
416
+ scale: [0, 4, 8, 12, 16, 20, 24, 32, 40, 48, 64]
417
+ 8px_grid:
418
+ base: 8
419
+ name: "8px Grid"
420
+ description: "Industry standard, recommended"
421
+ recommended: true
422
+ scale: [0, 8, 16, 24, 32, 48, 64, 80, 96, 128]
423
+
424
+ # =============================================================================
425
+ # COLOR RAMP GENERATION
426
+ # =============================================================================
427
+
428
+ color_ramps:
429
+ shades: [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]
430
+ method: "oklch" # Modern perceptually uniform
431
+
432
+ accessibility:
433
+ aa_minimum: 4.5
434
+ aaa_minimum: 7.0
435
+ large_text_aa: 3.0