nika-init 0.64.0

Nika project scaffolding — course generator, workflow templates, showcase
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
//! Showcase LLM workflows — 20 production-ready multi-verb demos
//!
//! Each workflow combines 2+ verbs (fetch+infer, exec+infer, infer+for_each, etc.)
//! and demonstrates real-world LLM patterns: structured output, artifact generation,
//! for_each iteration, DAG orchestration.
//!
//! All use `{{PROVIDER}}` / `{{MODEL}}` placeholders for provider portability.
//! All require an LLM provider (`requires_llm: true`).

use super::showcase::ShowcaseWorkflow;

/// All 20 LLM-powered showcase workflows
pub static SHOWCASE_LLM: &[ShowcaseWorkflow] = &[
    // =========================================================================
    // CATEGORY: CONTENT (1-5)
    // =========================================================================
    ShowcaseWorkflow {
        name: "blog-post-generator",
        description: "Research a topic, outline, write sections in parallel, assemble final post",
        category: "content",
        content: BLOG_POST_GENERATOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "email-draft-generator",
        description: "Three-pass email: draft, self-review with scoring, polish to final version",
        category: "content",
        content: EMAIL_DRAFT_GENERATOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "social-media-calendar",
        description: "Generate a week of posts, write platform-specific copy, compile calendar",
        category: "content",
        content: SOCIAL_MEDIA_CALENDAR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "product-description-writer",
        description: "Extract features, write descriptions for 4 platforms in parallel",
        category: "content",
        content: PRODUCT_DESCRIPTION_WRITER,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "startup-pitch-generator",
        description: "Market research, problem validation, solution design, 10-slide pitch deck",
        category: "content",
        content: STARTUP_PITCH_GENERATOR,
        requires_llm: true,
    },
    // =========================================================================
    // CATEGORY: ENGINEERING (6-10)
    // =========================================================================
    ShowcaseWorkflow {
        name: "code-review-assistant",
        description: "Capture git diff, analyze for bugs and security issues, structured report",
        category: "engineering",
        content: CODE_REVIEW_ASSISTANT,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "release-notes-generator",
        description: "Parse git history, categorize commits, generate polished release notes",
        category: "engineering",
        content: RELEASE_NOTES_GENERATOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "technical-rfc-writer",
        description:
            "Problem analysis, solution design, alternatives evaluation, full RFC document",
        category: "engineering",
        content: TECHNICAL_RFC_WRITER,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "api-docs-generator",
        description: "Fetch OpenAPI spec, parse endpoints, generate reference docs and quickstart",
        category: "engineering",
        content: API_DOCS_GENERATOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "vulnerability-scanner-report",
        description:
            "Run cargo audit, analyze findings with CVSS scoring, executive security report",
        category: "engineering",
        content: VULNERABILITY_SCANNER_REPORT,
        requires_llm: true,
    },
    // =========================================================================
    // CATEGORY: ANALYSIS (11-15)
    // =========================================================================
    ShowcaseWorkflow {
        name: "competitive-analysis",
        description:
            "Scrape 3 competitor sites, extract profiles in parallel, strategic comparison",
        category: "analysis",
        content: COMPETITIVE_ANALYSIS,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "seo-content-optimizer",
        description: "Fetch metadata, content, and links, perform full SEO audit with scoring",
        category: "analysis",
        content: SEO_CONTENT_OPTIMIZER,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "data-analysis-report",
        description: "Generate sample data, compute statistics, extract insights, executive report",
        category: "analysis",
        content: DATA_ANALYSIS_REPORT,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "customer-feedback-analyzer",
        description: "Categorize feedback by sentiment, aggregate NPS metrics, insights report",
        category: "analysis",
        content: CUSTOMER_FEEDBACK_ANALYZER,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "knowledge-base-builder",
        description: "Scrape docs, extract Q&A pairs, organize FAQ, generate chatbot training data",
        category: "analysis",
        content: KNOWLEDGE_BASE_BUILDER,
        requires_llm: true,
    },
    // =========================================================================
    // CATEGORY: OPERATIONS (16-20)
    // =========================================================================
    ShowcaseWorkflow {
        name: "meeting-notes-processor",
        description: "Summarize notes, extract structured action items, generate follow-up email",
        category: "operations",
        content: MEETING_NOTES_PROCESSOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "interview-question-generator",
        description: "Analyze role, generate questions per category in parallel, interview guide",
        category: "operations",
        content: INTERVIEW_QUESTION_GENERATOR,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "sprint-retrospective",
        description:
            "Analyze sprint metrics, structured went-well/needs-improvement, retro document",
        category: "operations",
        content: SPRINT_RETROSPECTIVE,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "translation-pipeline",
        description: "Prepare source text, translate to 5 languages in parallel, quality report",
        category: "operations",
        content: TRANSLATION_PIPELINE,
        requires_llm: true,
    },
    ShowcaseWorkflow {
        name: "content-localization",
        description:
            "Write marketing copy, localize for 4 markets with cultural adaptation, review matrix",
        category: "operations",
        content: CONTENT_LOCALIZATION,
        requires_llm: true,
    },
];

// =============================================================================
// 01: BLOG POST GENERATOR
// fetch: topic research -> infer: outline -> for_each: write sections -> infer: assemble
// =============================================================================

const BLOG_POST_GENERATOR: &str = r##"# Blog Post Generator
# Researches a topic online, generates an outline, writes each section
# in parallel, then assembles the final post with intro and conclusion.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  topic:
    type: string
    default: "Why Rust is the Future of Infrastructure Software"

tasks:
  - id: research
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://blog.rust-lang.org/"
      extract: markdown
      timeout: 20

  - id: outline
    depends_on: [research]
    with:
      sources: $research
    infer:
      prompt: |
        Create a detailed blog post outline about "{{inputs.topic}}".
        Use these sources for context: {{with.sources | first(2000)}}
        Return JSON: { "title": "...", "sections": [{"heading": "...", "key_points": ["..."]}] }
        Include 4-5 sections with 3 key points each.
      response_format: json
      temperature: 0.5
      max_tokens: 1000
    artifact:
      path: output/blog-outline.json
      format: json

  - id: write_sections
    depends_on: [outline]
    with:
      plan: $outline
    for_each: "$outline.sections"
    as: section
    concurrency: 3
    infer:
      prompt: |
        Write this blog section about "{{inputs.topic}}":
        Heading: {{with.section.heading}}
        Key points to cover: {{with.section.key_points}}
        Write 200-400 words. Professional but engaging tone.
        Include code examples where relevant.
      temperature: 0.6
      max_tokens: 800

  - id: assemble
    depends_on: [outline, write_sections]
    with:
      plan: $outline
      sections: $write_sections
    infer:
      prompt: |
        Assemble this blog post with a compelling intro and conclusion.
        Outline: {{with.plan}}
        Sections: {{with.sections}}
        Add a TL;DR at the top and a call-to-action at the bottom.
      temperature: 0.4
      max_tokens: 3000
    artifact:
      path: output/blog-post.md
"##;

// =============================================================================
// 02: EMAIL DRAFT GENERATOR
// infer: draft -> infer: review -> infer: polish
// =============================================================================

const EMAIL_DRAFT_GENERATOR: &str = r##"# Email Draft Generator
# Three-pass email writing: draft, self-review with scoring, then polish + summary.
# Produces professional emails with the right tone for any context.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  context:
    type: string
    default: "Declining a job offer from TechCorp while keeping the door open for future opportunities"
  tone:
    type: string
    default: "professional, warm, grateful"

tasks:
  - id: draft
    infer:
      system: "You are an expert business communicator and email writer."
      prompt: |
        Write an email draft for this situation:
        Context: {{inputs.context}}
        Desired tone: {{inputs.tone}}
        Include subject line, greeting, body, and sign-off.
      temperature: 0.6
      max_tokens: 600

  - id: review
    depends_on: [draft]
    with:
      email: $draft
    infer:
      system: |
        You are an email communication coach. Review emails for
        tone, clarity, potential misinterpretation, and professionalism.
      prompt: |
        Review this email draft and provide specific feedback:
        {{with.email}}

        Return JSON: {
          "tone_score": 1-10,
          "clarity_score": 1-10,
          "issues": ["..."],
          "suggestions": ["..."],
          "rewrite_needed": true/false
        }
      response_format: json
      temperature: 0.2
      max_tokens: 600

  - id: polish
    depends_on: [draft, review]
    with:
      original: $draft
      feedback: $review
    infer:
      prompt: |
        Polish this email based on the review feedback:
        Original: {{with.original}}
        Feedback: {{with.feedback}}
        Apply all suggestions. Keep the tone: {{inputs.tone}}.
        Return only the final email, ready to send.
      temperature: 0.3
      max_tokens: 600
    artifact:
      path: output/polished-email.md

  - id: summary
    depends_on: [review, polish]
    with:
      scores: $review
      final_email: $polish
    exec:
      command: |
        echo "=== EMAIL GENERATION SUMMARY ==="
        echo "Tone requested: {{inputs.tone}}"
        echo "Review scores: {{with.scores}}"
        echo "Final email length: $(echo '{{with.final_email}}' | wc -w | tr -d ' ') words"
        echo "Artifact: output/polished-email.md"
      shell: true
"##;

// =============================================================================
// 03: SOCIAL MEDIA CALENDAR
// infer: topics -> for_each: write posts -> infer: compile
// =============================================================================

const SOCIAL_MEDIA_CALENDAR: &str = r##"# Social Media Content Calendar
# Generates a week of social media content across platforms,
# with optimized copy for each platform's format and audience.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  brand:
    type: string
    default: "A developer tools startup building open-source workflow automation"
  week_theme:
    type: string
    default: "Launch week: introducing our new CLI tool"

tasks:
  - id: generate_topics
    infer:
      system: "You are a social media strategist for tech brands."
      prompt: |
        Create a 7-day content calendar for: {{inputs.brand}}
        Week theme: {{inputs.week_theme}}
        Return JSON: {
          "posts": [
            {"day": "Monday", "topic": "...", "hook": "...", "cta": "...", "hashtags": ["..."]}
          ]
        }
        Mix types: educational, behind-the-scenes, announcement, engagement, meme.
      response_format: json
      temperature: 0.7
      max_tokens: 1200
    artifact:
      path: output/content-calendar.json
      format: json

  - id: write_posts
    depends_on: [generate_topics]
    with:
      calendar: $generate_topics
    for_each: "$generate_topics.posts"
    as: post
    concurrency: 4
    fail_fast: false
    infer:
      prompt: |
        Write platform-specific versions of this social media post:
        Day: {{with.post.day}} | Topic: {{with.post.topic}}
        Hook: {{with.post.hook}} | CTA: {{with.post.cta}}
        Hashtags: {{with.post.hashtags}}

        Write 3 versions:
        - Twitter/X (max 280 chars, punchy)
        - LinkedIn (professional, 100-200 words)
        - Mastodon/Bluesky (casual, 300 chars max)
      temperature: 0.7
      max_tokens: 800

  - id: compile_calendar
    depends_on: [write_posts]
    with:
      all_posts: $write_posts
    infer:
      prompt: |
        Compile all posts into a formatted content calendar:
        {{with.all_posts}}
        Create a Markdown table: Day | Platform | Copy | Hashtags.
        Add posting time recommendations for each platform.
      temperature: 0.3
      max_tokens: 3000
    artifact:
      path: output/social-media-calendar.md

  - id: summary
    depends_on: [compile_calendar]
    with:
      calendar: $compile_calendar
    exec:
      command: |
        echo "=== SOCIAL MEDIA CALENDAR GENERATED ==="
        echo "Brand: {{inputs.brand}}"
        echo "Theme: {{inputs.week_theme}}"
        echo "Word count: $(echo '{{with.calendar}}' | wc -w | tr -d ' ') words"
        echo "Artifact: output/social-media-calendar.md"
      shell: true
"##;

// =============================================================================
// 04: PRODUCT DESCRIPTION WRITER
// infer: extract features -> for_each: write per-platform -> infer: compile
// =============================================================================

const PRODUCT_DESCRIPTION_WRITER: &str = r##"# Product Description Writer
# Generates platform-optimized product descriptions for multiple
# marketplaces from a single feature list.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  product:
    type: string
    default: "Wireless noise-canceling headphones with 40h battery, spatial audio, and adaptive EQ"
  price:
    type: string
    default: "$199"

tasks:
  - id: extract_features
    infer:
      prompt: |
        Analyze this product and extract structured features:
        Product: {{inputs.product}} | Price: {{inputs.price}}
        Return JSON: {
          "name": "...", "category": "...",
          "key_features": ["..."], "target_audience": ["..."],
          "unique_selling_points": ["..."],
          "technical_specs": {"...": "..."}
        }
      response_format: json
      temperature: 0.2
      max_tokens: 600
    artifact:
      path: output/product-features.json
      format: json

  - id: write_descriptions
    depends_on: [extract_features]
    with:
      features: $extract_features
    for_each:
      - { platform: "Amazon", style: "SEO-optimized bullet points, keyword-rich title, A+ content" }
      - { platform: "Shopify", style: "storytelling, lifestyle-focused, experience over specs" }
      - { platform: "Product Hunt", style: "concise, tech-savvy, innovation focus" }
      - { platform: "Instagram Shop", style: "emoji-rich, casual, 2-3 punchy sentences" }
    as: target
    concurrency: 4
    infer:
      prompt: |
        Write a product description for {{with.target.platform}}:
        Product: {{with.features}}
        Style: {{with.target.style}} | Price: {{inputs.price}}
      temperature: 0.6
      max_tokens: 800

  - id: compile
    depends_on: [write_descriptions]
    with:
      descriptions: $write_descriptions
    infer:
      prompt: |
        Compile all product descriptions into a reference document:
        {{with.descriptions}}
        Add a comparison table: platform, char count, key messaging angle.
      temperature: 0.3
      max_tokens: 2000
    artifact:
      path: output/product-descriptions.md

  - id: summary
    depends_on: [compile]
    with:
      result: $compile
    exec:
      command: |
        echo "=== PRODUCT DESCRIPTIONS GENERATED ==="
        echo "Product: {{inputs.product}}"
        echo "Price: {{inputs.price}}"
        echo "Platforms: Amazon, Shopify, Product Hunt, Instagram Shop"
        echo "Word count: $(echo '{{with.result}}' | wc -w | tr -d ' ') words"
        echo "Artifact: output/product-descriptions.md"
      shell: true
"##;

// =============================================================================
// 05: STARTUP PITCH GENERATOR
// fetch: market -> infer: market analysis -> infer: problem -> infer: solution -> infer: pitch
// =============================================================================

const STARTUP_PITCH_GENERATOR: &str = r##"# Startup Pitch Generator
# Builds a complete pitch deck narrative through market research,
# problem validation, solution design, and business model analysis.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  idea:
    type: string
    default: "An open-source AI workflow engine that lets developers build LLM pipelines in YAML"
  target_market:
    type: string
    default: "Developer tools, AI/ML infrastructure"

tasks:
  - id: market_research
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://news.ycombinator.com/"
      extract: markdown
      timeout: 20

  - id: market_analysis
    depends_on: [market_research]
    with:
      trends: $market_research
    infer:
      system: "You are a venture capital analyst specializing in developer tools and AI."
      prompt: |
        Analyze the market for: {{inputs.idea}}
        Target: {{inputs.target_market}}
        Trends: {{with.trends | first(2000)}}
        Return JSON: {
          "tam": "...", "sam": "...", "som": "...",
          "growth_rate": "...", "key_trends": ["..."],
          "competitors": [{"name": "...", "positioning": "...", "weakness": "..."}],
          "timing": "Why now?"
        }
      response_format: json
      temperature: 0.4
      max_tokens: 1200
    artifact:
      path: output/market-analysis.json
      format: json

  - id: problem_validation
    depends_on: [market_analysis]
    with:
      market: $market_analysis
    infer:
      prompt: |
        Define and validate the problem for: {{inputs.idea}}
        Market context: {{with.market}}
        Cover: pain points, failed current solutions, cost of the problem,
        customer personas, problem severity score (1-10).
      temperature: 0.4
      max_tokens: 1000

  - id: solution_and_model
    depends_on: [problem_validation, market_analysis]
    with:
      problem: $problem_validation
      market: $market_analysis
    infer:
      prompt: |
        Craft the solution narrative and business model:
        Problem: {{with.problem}}
        Market: {{with.market}}
        Cover: "Aha!" moment, 3-step explanation, differentiators,
        revenue model, pricing tiers, unit economics, milestones.
      temperature: 0.5
      max_tokens: 1500

  - id: pitch_deck
    depends_on: [market_analysis, problem_validation, solution_and_model]
    with:
      market: $market_analysis
      problem: $problem_validation
      solution: $solution_and_model
    infer:
      prompt: |
        Create a 10-slide pitch deck narrative:
        Market: {{with.market}}
        Problem: {{with.problem}}
        Solution & Model: {{with.solution}}

        Each slide: ## Slide N: Title / Key Message / Content / Speaker Notes.
        Order: Hook, Problem, Solution, Market, Business Model,
        Traction, Team, Competition, Financials, Ask.
      temperature: 0.4
      max_tokens: 4000
    artifact:
      path: output/pitch-deck.md
"##;

// =============================================================================
// 06: CODE REVIEW ASSISTANT
// exec: git diff -> infer: analyze -> infer: report
// =============================================================================

const CODE_REVIEW_ASSISTANT: &str = r##"# Code Review Assistant
# Captures the current git diff, analyzes code quality, security, and
# performance, then produces a structured report with recommendations.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: git_diff
    exec:
      command: git diff HEAD~1 --stat && echo "---" && git diff HEAD~1
      shell: true

  - id: git_log
    exec:
      command: git log --oneline -5
      shell: true

  - id: analyze
    depends_on: [git_diff, git_log]
    with:
      diff: $git_diff
      log: $git_log
    infer:
      system: |
        You are a senior code reviewer. Analyze diffs for bugs, security
        vulnerabilities, performance issues, style, and missing error handling.
        Reference line numbers. Be specific.
      prompt: |
        Review this code change:
        Recent commits: {{with.log}}
        Diff: {{with.diff | first(4000)}}

        Return JSON: {
          "summary": "...",
          "risk_level": "low|medium|high|critical",
          "issues": [{"severity": "...", "category": "...", "description": "...", "suggestion": "..."}],
          "approved": true/false
        }
      response_format: json
      temperature: 0.2
      max_tokens: 2000
    artifact:
      path: output/code-review.json
      format: json

  - id: report
    depends_on: [analyze]
    with:
      review: $analyze
    infer:
      prompt: |
        Format this code review as a clean Markdown report:
        {{with.review}}
        Include a summary table of issues sorted by severity.
      temperature: 0.3
      max_tokens: 1500
    artifact:
      path: output/code-review-report.md
"##;

// =============================================================================
// 07: RELEASE NOTES GENERATOR
// exec: git log -> infer: categorize -> infer: release notes
// =============================================================================

const RELEASE_NOTES_GENERATOR: &str = r##"# Release Notes Generator
# Reads recent git history, categorizes commits by type,
# and generates user-friendly release notes with highlights.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: git_history
    exec:
      command: git log --oneline --no-merges -30
      shell: true

  - id: git_stats
    exec:
      command: |
        echo "=== Files Changed ==="
        git diff --stat HEAD~10 HEAD 2>/dev/null || echo "N/A"
        echo ""
        echo "=== Contributors ==="
        git log --format='%aN' -30 | sort | uniq -c | sort -rn 2>/dev/null || echo "N/A"
      shell: true

  - id: categorize
    depends_on: [git_history]
    with:
      log: $git_history
    infer:
      system: |
        You parse git histories into structured changelogs.
        Categories: Features, Bug Fixes, Performance, Breaking Changes,
        Documentation, Internal, Dependencies.
      prompt: |
        Categorize these commits: {{with.log}}
        Return JSON: {
          "version": "suggested semver",
          "categories": {
            "features": [{"commit": "...", "description": "...", "user_impact": "..."}],
            "bug_fixes": [{"commit": "...", "description": "...", "severity": "..."}],
            "performance": [], "breaking_changes": [], "docs": [], "internal": []
          },
          "highlights": ["top 3 most impactful changes"]
        }
      response_format: json
      temperature: 0.2
      max_tokens: 2000
    artifact:
      path: output/changelog-structured.json
      format: json

  - id: release_notes
    depends_on: [categorize, git_stats]
    with:
      changelog: $categorize
      stats: $git_stats
    infer:
      prompt: |
        Write polished release notes:
        Changelog: {{with.changelog}}
        Stats: {{with.stats}}

        Format: # Release vX.Y.Z / > summary / ## Highlights (emoji) /
        ## Features / ## Bug Fixes / ## Breaking Changes (migration guide) /
        ## Contributors / ## Full Changelog
      temperature: 0.4
      max_tokens: 2500
    artifact:
      path: output/release-notes.md
"##;

// =============================================================================
// 08: TECHNICAL RFC WRITER
// infer: problem -> infer: solution -> infer: alternatives -> infer: assemble
// =============================================================================

const TECHNICAL_RFC_WRITER: &str = r##"# Technical RFC Writer
# Guides creation of a complete RFC through four phases:
# problem analysis, solution design, alternatives, and assembly.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  problem:
    type: string
    default: "Our monolithic API is hitting scaling limits at 10k req/sec. Need microservices without downtime."
  constraints:
    type: string
    default: "Zero downtime, 3-month timeline, team of 4, backward compatibility required"

tasks:
  - id: problem_analysis
    infer:
      system: "You are a principal engineer writing RFCs for a high-growth startup."
      prompt: |
        Analyze this problem for an RFC:
        Problem: {{inputs.problem}}
        Constraints: {{inputs.constraints}}
        Return JSON: {
          "title": "RFC-NNN: ...", "status": "Draft",
          "problem_statement": "...",
          "impact": {"users_affected": "...", "revenue_risk": "...", "technical_debt": "..."},
          "success_criteria": ["..."], "non_goals": ["..."]
        }
      response_format: json
      temperature: 0.3
      max_tokens: 1000

  - id: solution_design
    depends_on: [problem_analysis]
    with:
      problem: $problem_analysis
    infer:
      system: "You are a system architect designing scalable distributed systems."
      prompt: |
        Design the proposed solution: {{with.problem}}
        Cover: architecture, migration strategy, data model changes,
        API compatibility layer, rollback plan, timeline with milestones.
      temperature: 0.4
      max_tokens: 2000

  - id: alternatives
    depends_on: [problem_analysis]
    with:
      problem: $problem_analysis
    infer:
      prompt: |
        Propose 3 alternatives to: {{with.problem}}
        For each: description, pros/cons, effort, risk, why not chosen.
        Include "Do Nothing" with its consequences.
      temperature: 0.5
      max_tokens: 1500

  - id: assemble_rfc
    depends_on: [problem_analysis, solution_design, alternatives]
    with:
      problem: $problem_analysis
      solution: $solution_design
      alternatives: $alternatives
    infer:
      prompt: |
        Assemble a complete RFC:
        Problem: {{with.problem}}
        Solution: {{with.solution}}
        Alternatives: {{with.alternatives}}

        Standard format: Title/Status/Author/Date, Summary, Problem,
        Proposed Solution, Alternatives, Migration Plan, Success Metrics,
        Open Questions, References.
      temperature: 0.2
      max_tokens: 4000
    artifact:
      path: output/technical-rfc.md

  - id: summary
    depends_on: [assemble_rfc]
    with:
      rfc: $assemble_rfc
    exec:
      command: |
        echo "=== RFC GENERATED ==="
        echo "Problem: {{inputs.problem}}"
        echo "Constraints: {{inputs.constraints}}"
        echo "Word count: $(echo '{{with.rfc}}' | wc -w | tr -d ' ') words"
        echo "Artifact: output/technical-rfc.md"
      shell: true
"##;

// =============================================================================
// 09: API DOCS GENERATOR
// fetch: OpenAPI spec -> infer: parse -> infer: docs -> infer: quickstart -> infer: assemble
// =============================================================================

const API_DOCS_GENERATOR: &str = r##"# API Documentation Generator
# Fetches an API spec, generates human-friendly docs with examples,
# error guides, and a quickstart tutorial.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: fetch_spec
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://petstore3.swagger.io/api/v3/openapi.json"
      timeout: 15

  - id: parse_endpoints
    depends_on: [fetch_spec]
    with:
      spec: $fetch_spec
    infer:
      prompt: |
        Parse this OpenAPI spec and extract endpoints:
        {{with.spec | first(4000)}}
        Return JSON: {
          "api_name": "...", "base_url": "...", "auth_type": "...",
          "endpoints": [{"method": "...", "path": "...", "summary": "...", "params": ["..."]}]
        }
      response_format: json
      temperature: 0.1
      max_tokens: 2000
    artifact:
      path: output/api-endpoints.json
      format: json

  - id: generate_docs
    depends_on: [parse_endpoints]
    with:
      api: $parse_endpoints
    infer:
      system: "You create clear, developer-friendly API documentation with curl examples."
      prompt: |
        Generate complete API docs from: {{with.api}}
        Include: overview, authentication, each endpoint with examples,
        error codes, rate limiting. Markdown with code blocks.
      temperature: 0.3
      max_tokens: 3000

  - id: quickstart
    depends_on: [parse_endpoints]
    with:
      api: $parse_endpoints
    infer:
      prompt: |
        Write a 5-minute quickstart guide: {{with.api}}
        Include: setup, first request, common patterns, next steps.
        Show curl and JavaScript fetch examples.
      temperature: 0.4
      max_tokens: 1200

  - id: assemble
    depends_on: [generate_docs, quickstart]
    with:
      reference: $generate_docs
      guide: $quickstart
    infer:
      prompt: |
        Combine into one API documentation file:
        # Quickstart
        {{with.guide}}
        # Reference
        {{with.reference}}
        Add a table of contents at the top.
      temperature: 0.2
      max_tokens: 4000
    artifact:
      path: output/api-documentation.md
"##;

// =============================================================================
// 10: VULNERABILITY SCANNER REPORT
// exec: cargo audit -> infer: analyze -> infer: report
// =============================================================================

const VULNERABILITY_SCANNER_REPORT: &str = r##"# Vulnerability Scanner Report
# Runs security audit commands, analyzes and prioritizes findings
# with CVSS-like scoring, generates executive security report.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: cargo_audit
    exec:
      command: cargo audit 2>&1 || echo "Audit complete"
      shell: true

  - id: dependency_tree
    exec:
      command: cargo tree --depth 2 2>&1 | head -50 || echo "No Cargo.toml"
      shell: true

  - id: outdated_check
    exec:
      command: cargo outdated 2>&1 | head -30 || echo "cargo-outdated not installed"
      shell: true

  - id: analyze
    depends_on: [cargo_audit, dependency_tree, outdated_check]
    with:
      audit: $cargo_audit
      deps: $dependency_tree
      outdated: $outdated_check
    infer:
      system: |
        You are a senior security engineer. Analyze dependency audits
        with CVSS-like severity scoring. Focus on exploitability.
      prompt: |
        Analyze these scan results:
        Audit: {{with.audit}}
        Deps: {{with.deps}}
        Outdated: {{with.outdated}}

        Return JSON: {
          "scan_summary": {"total_deps": 0, "vulnerabilities": 0, "outdated": 0},
          "critical": [{"package": "...", "cve": "...", "fix": "..."}],
          "high": [], "medium": [], "low": [],
          "recommendations": [{"priority": 1, "action": "...", "effort": "..."}],
          "supply_chain_risk": "low|medium|high"
        }
      response_format: json
      temperature: 0.1
      max_tokens: 2500
    artifact:
      path: output/vulnerability-analysis.json
      format: json

  - id: report
    depends_on: [analyze]
    with:
      analysis: $analyze
    infer:
      prompt: |
        Create an executive security report:
        {{with.analysis}}
        Include: executive summary, risk dashboard, critical findings,
        remediation timeline, dependency health scorecard.
      temperature: 0.2
      max_tokens: 2500
    artifact:
      path: output/security-report.md
"##;

// =============================================================================
// 11: COMPETITIVE ANALYSIS
// fetch: 3 sites -> for_each: extract profiles -> infer: compare
// =============================================================================

const COMPETITIVE_ANALYSIS: &str = r##"# Competitive Analysis
# Scrapes multiple competitor websites, extracts key info from each,
# then synthesizes a comparison matrix with strategic recommendations.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: scrape_vercel
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://vercel.com"
      extract: metadata
      timeout: 20

  - id: scrape_netlify
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://www.netlify.com"
      extract: metadata
      timeout: 20

  - id: scrape_cloudflare
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://pages.cloudflare.com"
      extract: metadata
      timeout: 20

  - id: extract_profiles
    depends_on: [scrape_vercel, scrape_netlify, scrape_cloudflare]
    with:
      vercel: $scrape_vercel
      netlify: $scrape_netlify
      cloudflare: $scrape_cloudflare
    for_each:
      - { name: "Vercel", data: "{{with.vercel}}" }
      - { name: "Netlify", data: "{{with.netlify}}" }
      - { name: "Cloudflare Pages", data: "{{with.cloudflare}}" }
    as: competitor
    concurrency: 3
    fail_fast: false
    infer:
      prompt: |
        Analyze this competitor's positioning:
        Company: {{with.competitor.name}}
        Data: {{with.competitor.data}}
        Return JSON: {
          "name": "...", "tagline": "...", "target_audience": "...",
          "key_features": ["..."], "pricing_model": "...",
          "strengths": ["..."], "weaknesses": ["..."]
        }
      response_format: json
      temperature: 0.3
      max_tokens: 600

  - id: comparison
    depends_on: [extract_profiles]
    with:
      profiles: $extract_profiles
    infer:
      prompt: |
        Create a strategic competitive analysis:
        {{with.profiles}}
        Include: feature comparison table, market positioning map,
        gaps and opportunities, top 5 strategic recommendations.
      temperature: 0.4
      max_tokens: 2000
    artifact:
      path: output/competitive-analysis.md
"##;

// =============================================================================
// 12: SEO CONTENT OPTIMIZER
// fetch: URL (3 extracts) -> infer: audit -> infer: report
// =============================================================================

const SEO_CONTENT_OPTIMIZER: &str = r##"# SEO Content Optimizer
# Fetches a webpage's metadata, content, and links, then performs
# a comprehensive SEO audit with scores and recommendations.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  url:
    type: string
    default: "https://github.com"

tasks:
  - id: fetch_metadata
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "{{inputs.url}}"
      extract: metadata
      timeout: 20

  - id: fetch_content
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "{{inputs.url}}"
      extract: markdown
      timeout: 20

  - id: fetch_links
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "{{inputs.url}}"
      extract: links
      timeout: 20

  - id: seo_audit
    depends_on: [fetch_metadata, fetch_content, fetch_links]
    with:
      meta: $fetch_metadata
      content: $fetch_content
      links: $fetch_links
    infer:
      system: "You are a senior SEO specialist with 10+ years of experience."
      prompt: |
        Perform a complete SEO audit:
        Metadata: {{with.meta}}
        Content: {{with.content | first(3000)}}
        Links: {{with.links | first(2000)}}

        Return JSON: {
          "scores": {"title": 0-100, "meta_description": 0-100, "headings": 0-100, "content_quality": 0-100, "links": 0-100, "overall": 0-100},
          "critical_issues": [{"issue": "...", "impact": "high|medium|low", "fix": "..."}],
          "quick_wins": [{"action": "...", "effort": "...", "impact": "..."}],
          "keyword_opportunities": ["..."]
        }
      response_format: json
      temperature: 0.2
      max_tokens: 2000
    artifact:
      path: output/seo-audit.json
      format: json

  - id: seo_report
    depends_on: [seo_audit]
    with:
      audit: $seo_audit
    infer:
      prompt: |
        Create a professional SEO audit report:
        {{with.audit}}
        Format as Markdown with score badges, priority tables, 30-day plan.
      temperature: 0.3
      max_tokens: 2000
    artifact:
      path: output/seo-report.md
"##;

// =============================================================================
// 13: DATA ANALYSIS REPORT
// exec: generate data + stats -> infer: analyze -> infer: report
// =============================================================================

const DATA_ANALYSIS_REPORT: &str = r##"# Data Analysis Report
# Generates sample business data, computes statistics via shell,
# then uses an LLM to extract insights and build an executive report.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: generate_data
    exec:
      command: |
        echo "month,revenue,users,churn_rate"
        echo "Jan,45000,1200,0.05"
        echo "Feb,52000,1350,0.04"
        echo "Mar,48000,1100,0.06"
        echo "Apr,61000,1500,0.03"
        echo "May,58000,1450,0.04"
        echo "Jun,72000,1800,0.02"
        echo "Jul,68000,1700,0.03"
        echo "Aug,75000,1900,0.02"
        echo "Sep,82000,2100,0.02"
        echo "Oct,79000,2000,0.03"
        echo "Nov,91000,2400,0.01"
        echo "Dec,95000,2600,0.01"
      shell: true
    artifact:
      path: output/sample-data.csv

  - id: compute_stats
    depends_on: [generate_data]
    exec:
      command: |
        echo "=== Revenue ==="
        echo "Total: 826000 | Avg: 68833 | Min: 45000 (Jan) | Max: 95000 (Dec) | Growth: 111%"
        echo ""
        echo "=== Users ==="
        echo "Peak: 2600 (Dec) | Avg: 1758 | Growth: 117%"
        echo ""
        echo "=== Churn ==="
        echo "Avg: 0.030 | Best: 0.01 (Nov,Dec) | Worst: 0.06 (Mar)"
      shell: true

  - id: analyze
    depends_on: [generate_data, compute_stats]
    with:
      data: $generate_data
      stats: $compute_stats
    infer:
      system: "You are a senior data analyst specializing in SaaS metrics."
      prompt: |
        Analyze this business data:
        Raw: {{with.data}}
        Stats: {{with.stats}}

        Return JSON: {
          "executive_summary": "...",
          "trends": [{"metric": "...", "trend": "up|down|stable", "insight": "..."}],
          "anomalies": [{"month": "...", "metric": "...", "description": "..."}],
          "correlations": ["..."],
          "forecast_q1": {"revenue": 0, "users": 0, "churn": 0.0},
          "recommendations": [{"priority": "high|medium|low", "action": "...", "expected_impact": "..."}]
        }
      response_format: json
      temperature: 0.2
      max_tokens: 2000
    artifact:
      path: output/data-analysis.json
      format: json

  - id: report
    depends_on: [analyze]
    with:
      analysis: $analyze
    infer:
      prompt: |
        Create an executive data analysis report:
        {{with.analysis}}
        Include ASCII charts, trend arrows, clear recommendations.
        Polished Markdown for stakeholder presentation.
      temperature: 0.3
      max_tokens: 2500
    artifact:
      path: output/data-report.md
"##;

// =============================================================================
// 14: CUSTOMER FEEDBACK ANALYZER
// infer: categorize -> infer: aggregate -> infer: report
// =============================================================================

const CUSTOMER_FEEDBACK_ANALYZER: &str = r##"# Customer Feedback Analyzer
# Processes customer feedback, categorizes by sentiment and topic,
# aggregates NPS metrics, generates actionable insights report.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  feedback:
    type: string
    default: |
      1. "Love the new dashboard! Dark mode is chef's kiss." - 5 stars
      2. "App crashes on PDF export. Very frustrating." - 1 star
      3. "Good but pricing is confusing. Too many tiers." - 3 stars
      4. "Support was incredible. Resolved in 5 minutes." - 5 stars
      5. "Mobile app missing half the features." - 2 stars
      6. "API docs are outdated. Wasted 2 hours." - 2 stars
      7. "Best workflow tool. Replaced 3 other tools." - 5 stars
      8. "Onboarding tutorial too long." - 3 stars
      9. "Slack integration broken after update." - 1 star
      10. "Feature request: calendar view for timelines." - 4 stars

tasks:
  - id: categorize
    infer:
      system: "You categorize feedback with NPS methodology: promoters (4-5), passives (3), detractors (1-2)."
      prompt: |
        Categorize each piece of feedback:
        {{inputs.feedback}}
        Return JSON: {
          "items": [{
            "id": 1, "text": "...",
            "sentiment": "positive|negative|neutral", "score": 1-5,
            "nps_category": "promoter|passive|detractor",
            "topics": ["..."], "urgency": "critical|high|medium|low",
            "department": "engineering|design|support|product|billing"
          }]
        }
      response_format: json
      temperature: 0.1
      max_tokens: 2000
    artifact:
      path: output/feedback-categorized.json
      format: json

  - id: aggregate
    depends_on: [categorize]
    with:
      data: $categorize
    infer:
      prompt: |
        Aggregate these feedback items into insights:
        {{with.data}}
        Return JSON: {
          "nps_score": 0-100,
          "sentiment_breakdown": {"positive": 0, "negative": 0, "neutral": 0},
          "top_topics": [{"topic": "...", "count": 0, "avg_sentiment": "..."}],
          "critical_issues": ["..."],
          "department_scores": {"engineering": 0, "design": 0, "support": 0, "product": 0}
        }
      response_format: json
      temperature: 0.2
      max_tokens: 1000
    artifact:
      path: output/feedback-aggregate.json
      format: json

  - id: report
    depends_on: [categorize, aggregate]
    with:
      items: $categorize
      summary: $aggregate
    infer:
      prompt: |
        Create an executive customer feedback report:
        Items: {{with.items}} | Summary: {{with.summary}}
        Include: NPS trend, top issues table, department performance,
        customer quotes, prioritized action plan.
      temperature: 0.3
      max_tokens: 2500
    artifact:
      path: output/feedback-report.md

  - id: summary
    depends_on: [aggregate, report]
    with:
      metrics: $aggregate
    exec:
      command: |
        echo "=== FEEDBACK ANALYSIS COMPLETE ==="
        echo "Feedback items processed: 10"
        echo "Metrics: {{with.metrics}}"
        echo "Artifacts:"
        echo "  - output/feedback-categorized.json"
        echo "  - output/feedback-aggregate.json"
        echo "  - output/feedback-report.md"
      shell: true
"##;

// =============================================================================
// 15: KNOWLEDGE BASE BUILDER
// fetch: docs -> infer: extract QA -> infer: organize -> infer: chatbot data
// =============================================================================

const KNOWLEDGE_BASE_BUILDER: &str = r##"# Knowledge Base Builder
# Scrapes documentation, extracts Q&A pairs, organizes into a
# structured FAQ, and generates chatbot training data.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

tasks:
  - id: scrape_docs
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://doc.rust-lang.org/book/ch01-01-installation.html"
      extract: markdown
      timeout: 20

  - id: scrape_more
    retry:
      max_attempts: 3
      delay_ms: 1000
      backoff: 2.0
    fetch:
      url: "https://doc.rust-lang.org/book/ch01-02-hello-world.html"
      extract: markdown
      timeout: 20

  - id: extract_qa
    depends_on: [scrape_docs, scrape_more]
    with:
      docs: $scrape_docs
      faq: $scrape_more
    infer:
      system: "You build knowledge bases by extracting implicit and explicit questions from documentation."
      prompt: |
        Extract Q&A pairs from these docs:
        Doc 1: {{with.docs | first(3000)}}
        Doc 2: {{with.faq | first(3000)}}
        Return JSON: {
          "qa_pairs": [{
            "question": "...", "answer": "...",
            "category": "getting-started|installation|concepts|troubleshooting|advanced",
            "difficulty": "beginner|intermediate|advanced",
            "keywords": ["..."]
          }]
        }
        Extract at least 10 pairs.
      response_format: json
      temperature: 0.2
      max_tokens: 3000
    artifact:
      path: output/qa-pairs.json
      format: json

  - id: organize_kb
    depends_on: [extract_qa]
    with:
      pairs: $extract_qa
    infer:
      prompt: |
        Organize these Q&A pairs into a structured knowledge base:
        {{with.pairs}}
        Create: table of contents, categories with Q&A, cross-references,
        "Still stuck?" section, keyword index.
      temperature: 0.3
      max_tokens: 3000
    artifact:
      path: output/knowledge-base.md

  - id: chatbot_data
    depends_on: [extract_qa]
    with:
      pairs: $extract_qa
    infer:
      prompt: |
        Convert Q&A pairs into chatbot training data:
        {{with.pairs}}
        Return JSON: {
          "intents": [{
            "intent": "...", "examples": ["..."],
            "response": "...", "follow_up": "..."
          }]
        }
      response_format: json
      temperature: 0.3
      max_tokens: 2000
    artifact:
      path: output/chatbot-training.json
      format: json
"##;

// =============================================================================
// 16: MEETING NOTES PROCESSOR
// infer: summarize -> infer: extract actions -> infer: followup email
// =============================================================================

const MEETING_NOTES_PROCESSOR: &str = r##"# Meeting Notes Processor
# Takes raw meeting notes, extracts key decisions and action items,
# then generates a structured follow-up email.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  notes:
    type: string
    default: |
      Project sync - March 2026. Attendees: Alice (PM), Bob (Eng), Carol (Design).
      Alice: Sprint ends Friday. Ship the dashboard redesign.
      Bob: Backend API ready. Need 2 more days for caching layer.
      Carol: Design handoff complete. Found 3 a11y issues in nav.
      Alice: Bob, prioritize caching. Carol, file a11y bugs by EOD.
      Bob: Should we delay? Caching is critical for perf.
      Alice: No delay. Ship without caching, hotfix Monday.
      Decision: Ship Friday without caching. Hotfix caching Monday.
      Carol: I will update design system tokens by Thursday.

tasks:
  - id: summarize
    infer:
      system: "You are an expert meeting note-taker and project coordinator."
      prompt: |
        Summarize these meeting notes into key discussion points:
        {{inputs.notes}}
        Focus on decisions made and disagreements raised.
      temperature: 0.3
      max_tokens: 600

  - id: extract_actions
    depends_on: [summarize]
    with:
      summary: $summarize
    infer:
      prompt: |
        Extract all action items from:
        Summary: {{with.summary}}
        Original: {{inputs.notes}}
        Return JSON: {
          "decisions": [{"decision": "...", "rationale": "..."}],
          "action_items": [{"owner": "...", "task": "...", "deadline": "...", "priority": "high|medium|low"}],
          "risks": [{"risk": "...", "mitigation": "..."}],
          "next_meeting": "suggested date/topic"
        }
      response_format: json
      temperature: 0.2
      max_tokens: 1000
    artifact:
      path: output/action-items.json
      format: json

  - id: followup_email
    depends_on: [summarize, extract_actions]
    with:
      summary: $summarize
      actions: $extract_actions
    infer:
      prompt: |
        Write a professional follow-up email:
        Summary: {{with.summary}}
        Actions: {{with.actions}}
        Include: subject line, bullet action items with owners, next deadline.
      temperature: 0.4
      max_tokens: 800
    artifact:
      path: output/meeting-followup.md

  - id: summary
    depends_on: [extract_actions, followup_email]
    with:
      actions: $extract_actions
    exec:
      command: |
        echo "=== MEETING NOTES PROCESSED ==="
        echo "Actions extracted: {{with.actions}}"
        echo "Artifacts:"
        echo "  - output/action-items.json"
        echo "  - output/meeting-followup.md"
      shell: true
"##;

// =============================================================================
// 17: INTERVIEW QUESTION GENERATOR
// infer: role analysis -> for_each: question categories -> infer: guide
// =============================================================================

const INTERVIEW_QUESTION_GENERATOR: &str = r##"# Interview Question Generator
# Analyzes a job role, generates targeted questions across categories
# in parallel, then assembles a complete interview guide.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  role:
    type: string
    default: "Senior Backend Engineer - Rust/Python, distributed systems, 5+ years"
  company_values:
    type: string
    default: "Open source, technical excellence, autonomy, user empathy"

tasks:
  - id: role_analysis
    infer:
      system: "You are a senior technical recruiter and hiring manager."
      prompt: |
        Analyze this role for interview planning:
        Role: {{inputs.role}}
        Values: {{inputs.company_values}}
        Return JSON: {
          "role_title": "...", "seniority": "...",
          "core_skills": ["..."], "culture_fit_traits": ["..."],
          "question_categories": [
            {"category": "System Design", "weight": 30},
            {"category": "Coding", "weight": 25},
            {"category": "Behavioral", "weight": 20},
            {"category": "Technical Deep-Dive", "weight": 15},
            {"category": "Culture Fit", "weight": 10}
          ]
        }
      response_format: json
      temperature: 0.3
      max_tokens: 800

  - id: generate_questions
    depends_on: [role_analysis]
    with:
      analysis: $role_analysis
    for_each: "$role_analysis.question_categories"
    as: category
    concurrency: 5
    infer:
      prompt: |
        Generate 4 interview questions for: {{inputs.role}}
        Category: {{with.category.category}} (weight: {{with.category.weight}}%)
        Context: {{with.analysis}}

        Each with: the question, what it tests, green flags,
        red flags, 2 follow-up probes. Scale difficulty.
      temperature: 0.5
      max_tokens: 1200

  - id: interview_guide
    depends_on: [role_analysis, generate_questions]
    with:
      analysis: $role_analysis
      questions: $generate_questions
    infer:
      prompt: |
        Create a complete interview guide:
        Role: {{with.analysis}}
        Questions: {{with.questions}}
        Include: pre-interview checklist, timing per section,
        all questions by category, scoring rubric (1-5),
        post-interview evaluation template.
      temperature: 0.3
      max_tokens: 3500
    artifact:
      path: output/interview-guide.md

  - id: summary
    depends_on: [interview_guide]
    with:
      guide: $interview_guide
    exec:
      command: |
        echo "=== INTERVIEW GUIDE GENERATED ==="
        echo "Role: {{inputs.role}}"
        echo "Word count: $(echo '{{with.guide}}' | wc -w | tr -d ' ') words"
        echo "Artifact: output/interview-guide.md"
      shell: true
"##;

// =============================================================================
// 18: SPRINT RETROSPECTIVE
// infer: analyze metrics -> infer: retro analysis -> infer: document
// =============================================================================

const SPRINT_RETROSPECTIVE: &str = r##"# Sprint Retrospective Generator
# Analyzes sprint data, produces structured insights with action items,
# and generates a facilitation-ready retro document.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  sprint_data:
    type: string
    default: |
      Sprint 14 - "Project Phoenix" (2 weeks)
      Planned: 34 pts | Completed: 28 | Carried: 6
      Team: 4 engineers, 1 designer
      Velocity: 25, 30, 32, 28 (last 4 sprints)
      Incidents: 1 P2 (auth service down 2h Tuesday)
      Deploys: 8 ok, 1 rollback (Thursday)
      PR cycle time: avg 18h (target 12h)
      Feedback: "Too many meetings", "Great auth fix collab",
      "Unclear dashboard requirements", "On-call needs review"

tasks:
  - id: analyze_metrics
    infer:
      system: "You are an Agile coach. Data-driven insights, not platitudes."
      prompt: |
        Analyze sprint metrics: {{inputs.sprint_data}}
        Return JSON: {
          "sprint_health": "healthy|warning|critical",
          "velocity_trend": "improving|stable|declining",
          "completion_rate": 0.0,
          "metric_insights": [{"metric": "...", "status": "green|yellow|red", "insight": "..."}],
          "risks": [{"risk": "...", "probability": "high|medium|low", "mitigation": "..."}]
        }
      response_format: json
      temperature: 0.2
      max_tokens: 1000
    artifact:
      path: output/sprint-metrics.json
      format: json

  - id: retro_analysis
    depends_on: [analyze_metrics]
    with:
      metrics: $analyze_metrics
    infer:
      prompt: |
        Generate structured retrospective:
        Data: {{inputs.sprint_data}}
        Metrics: {{with.metrics}}
        Return JSON: {
          "went_well": [{"item": "...", "evidence": "...", "keep_doing": "..."}],
          "needs_improvement": [{"item": "...", "root_cause": "...", "fix": "..."}],
          "action_items": [{"action": "...", "owner": "team|pm|lead", "deadline": "...", "metric": "..."}],
          "experiments": [{"hypothesis": "If X then Y", "duration": "1 sprint", "measure": "..."}]
        }
      response_format: json
      temperature: 0.3
      max_tokens: 1500
    artifact:
      path: output/retro-analysis.json
      format: json

  - id: retro_document
    depends_on: [analyze_metrics, retro_analysis]
    with:
      metrics: $analyze_metrics
      retro: $retro_analysis
    infer:
      prompt: |
        Create sprint retrospective document:
        Metrics: {{with.metrics}} | Analysis: {{with.retro}}
        Include: sprint scorecard, wins, improvements (blameless),
        SMART action items, experiments, facilitation notes.
      temperature: 0.3
      max_tokens: 2500
    artifact:
      path: output/sprint-retro.md

  - id: summary
    depends_on: [retro_document]
    with:
      retro: $retro_document
    exec:
      command: |
        echo "=== SPRINT RETRO GENERATED ==="
        echo "Word count: $(echo '{{with.retro}}' | wc -w | tr -d ' ') words"
        echo "Artifacts:"
        echo "  - output/sprint-metrics.json"
        echo "  - output/retro-analysis.json"
        echo "  - output/sprint-retro.md"
      shell: true
"##;

// =============================================================================
// 19: TRANSLATION PIPELINE
// infer: prepare -> for_each: translate 5 langs -> infer: quality report
// =============================================================================

const TRANSLATION_PIPELINE: &str = r##"# Translation Pipeline
# Prepares source text, translates into 5 languages in parallel
# with cultural adaptation, then runs a quality review.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  content:
    type: string
    default: |
      Introducing Nika: the open-source workflow engine that puts AI to work.
      Build powerful automation pipelines in YAML. Chain LLM calls, HTTP requests,
      shell commands, and tool invocations into reproducible workflows.
      No vendor lock-in. No black boxes. Just clean, declarative power.

tasks:
  - id: prepare_source
    infer:
      prompt: |
        Prepare this content for international translation:
        {{inputs.content}}
        Return JSON: {
          "source_text": "...",
          "key_terms": [{"term": "...", "context": "...", "keep_english": true/false}],
          "tone": "...", "cultural_notes": "..."
        }
      response_format: json
      temperature: 0.2
      max_tokens: 600
    artifact:
      path: output/translation-source.json
      format: json

  - id: translate
    depends_on: [prepare_source]
    with:
      source: $prepare_source
    for_each:
      - { code: "fr-FR", name: "French", notes: "Use vous (formal). Tech terms stay English." }
      - { code: "de-DE", name: "German", notes: "Compound nouns ok. Formal register." }
      - { code: "ja-JP", name: "Japanese", notes: "Desu/masu form. Katakana for tech terms." }
      - { code: "es-ES", name: "Spanish", notes: "Castilian. Ustedes form." }
      - { code: "zh-CN", name: "Chinese", notes: "Mainland conventions. Translate tech terms." }
    as: lang
    concurrency: 5
    fail_fast: false
    infer:
      system: "You are a professional translator. Adapt culturally, not just linguistically."
      prompt: |
        Translate to {{with.lang.name}} ({{with.lang.code}}):
        Source: {{with.source}}
        Notes: {{with.lang.notes}}
        Return translated text then a "Translator Notes" section.
      temperature: 0.3
      max_tokens: 1000
    artifact:
      path: "output/translations/{{with.lang.code}}.md"

  - id: quality_report
    depends_on: [translate]
    with:
      translations: $translate
    infer:
      prompt: |
        Review all translations for consistency:
        {{with.translations}}
        Check: key term consistency, tone match, no lost content.
        Produce a quality scorecard per language.
      temperature: 0.2
      max_tokens: 1000
    artifact:
      path: output/translation-quality-report.md

  - id: summary
    depends_on: [quality_report]
    with:
      report: $quality_report
    exec:
      command: |
        echo "=== TRANSLATION PIPELINE COMPLETE ==="
        echo "Languages: fr-FR, de-DE, ja-JP, es-ES, zh-CN"
        echo "Quality report: {{with.report}}"
        echo "Artifact: output/translation-quality-report.md"
      shell: true
"##;

// =============================================================================
// 20: CONTENT LOCALIZATION
// infer: write copy -> for_each: localize 4 markets -> infer: review matrix
// =============================================================================

const CONTENT_LOCALIZATION: &str = r##"# Content Localization Pipeline
# Creates marketing copy then localizes for 4 international markets,
# adapting language, cultural references, and compliance notes.
schema: "nika/workflow@0.12"
provider: "{{PROVIDER}}"
model: "{{MODEL}}"

inputs:
  product_name:
    type: string
    default: "CloudSync Pro"
  description:
    type: string
    default: "Enterprise file sync with end-to-end encryption, real-time collaboration, and compliance built in"

tasks:
  - id: write_source
    infer:
      system: "You are a marketing copywriter for enterprise SaaS products."
      prompt: |
        Write marketing copy for: {{inputs.product_name}}
        Description: {{inputs.description}}
        Create: hero headline (10 words max), subheadline (25 words),
        3 value proposition blocks, CTA button text, social proof line.
      temperature: 0.6
      max_tokens: 800
    artifact:
      path: output/source-copy.md

  - id: localize
    depends_on: [write_source]
    with:
      source: $write_source
    for_each:
      - { market: "Japan", lang: "ja-JP", notes: "Emphasize security. Keigo forms. Replace Western metaphors." }
      - { market: "Germany", lang: "de-DE", notes: "GDPR emphasis. Formal tone. Engineering quality angle." }
      - { market: "Brazil", lang: "pt-BR", notes: "Warm, relationship-focused. LGPD compliance." }
      - { market: "UAE", lang: "ar-AE", notes: "RTL. Formal business Arabic. Local data residency." }
    as: locale
    concurrency: 4
    infer:
      system: "You are a localization specialist. Re-create impact for the local audience."
      prompt: |
        Localize for {{with.locale.market}} ({{with.locale.lang}}):
        Source: {{with.source}}
        Guidance: {{with.locale.notes}}
        Provide: localized copy, cultural notes, legal/compliance notes.
      temperature: 0.4
      max_tokens: 1200
    artifact:
      path: "output/localized/{{with.locale.lang}}.md"

  - id: review_matrix
    depends_on: [localize]
    with:
      versions: $localize
    infer:
      prompt: |
        Create a localization review matrix:
        {{with.versions}}
        Compare: messaging consistency, cultural adaptation quality,
        compliance completeness. Traffic-light ratings table.
      temperature: 0.2
      max_tokens: 1200
    artifact:
      path: output/localization-review.md

  - id: summary
    depends_on: [review_matrix]
    with:
      review: $review_matrix
    exec:
      command: |
        echo "=== LOCALIZATION COMPLETE ==="
        echo "Product: {{inputs.product_name}}"
        echo "Markets: Japan, Germany, Brazil, UAE"
        echo "Review: {{with.review}}"
        echo "Artifact: output/localization-review.md"
      shell: true
"##;

// =============================================================================
// Tests
// =============================================================================

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn test_showcase_llm_count() {
        assert_eq!(
            SHOWCASE_LLM.len(),
            20,
            "Must have exactly 20 LLM showcase workflows"
        );
    }

    #[test]
    fn test_showcase_llm_names_unique() {
        let mut names: Vec<&str> = SHOWCASE_LLM.iter().map(|w| w.name).collect();
        let len = names.len();
        names.sort();
        names.dedup();
        assert_eq!(names.len(), len, "All names must be unique");
    }

    #[test]
    fn test_showcase_llm_all_require_llm() {
        for w in SHOWCASE_LLM {
            assert!(
                w.requires_llm,
                "Workflow '{}' must have requires_llm = true",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_have_schema() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.contains("schema: \"nika/workflow@0.12\""),
                "Workflow '{}' must declare schema",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_have_provider() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.contains("provider: \"{{PROVIDER}}\""),
                "Workflow '{}' must have provider placeholder",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_have_model() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.contains("model: \"{{MODEL}}\""),
                "Workflow '{}' must have model placeholder",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_have_tasks() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.contains("tasks:"),
                "Workflow '{}' must have tasks section",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_use_infer() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.contains("infer:"),
                "Workflow '{}' must use infer: verb",
                w.name
            );
        }
    }

    #[test]
    fn test_showcase_llm_all_multi_verb() {
        let verbs = ["infer:", "exec:", "fetch:", "invoke:", "agent:"];
        for w in SHOWCASE_LLM {
            let verb_count = verbs.iter().filter(|v| w.content.contains(**v)).count();
            assert!(
                verb_count >= 2,
                "Workflow '{}' must use 2+ verbs, found {}",
                w.name,
                verb_count
            );
        }
    }

    #[test]
    fn test_showcase_llm_uses_depends_on() {
        let with_deps = SHOWCASE_LLM
            .iter()
            .filter(|w| w.content.contains("depends_on:"))
            .count();
        assert!(
            with_deps >= 18,
            "At least 18 workflows should use depends_on, found {}",
            with_deps
        );
    }

    #[test]
    fn test_showcase_llm_uses_with_bindings() {
        let with_bindings = SHOWCASE_LLM
            .iter()
            .filter(|w| w.content.contains("with:"))
            .count();
        assert!(
            with_bindings >= 18,
            "At least 18 workflows should use with: bindings, found {}",
            with_bindings
        );
    }

    #[test]
    fn test_showcase_llm_uses_artifact() {
        let with_artifact = SHOWCASE_LLM
            .iter()
            .filter(|w| w.content.contains("artifact:"))
            .count();
        assert!(
            with_artifact >= 15,
            "At least 15 workflows should produce artifacts, found {}",
            with_artifact
        );
    }

    #[test]
    fn test_showcase_llm_uses_structured_output() {
        let with_json = SHOWCASE_LLM
            .iter()
            .filter(|w| w.content.contains("response_format: json"))
            .count();
        assert!(
            with_json >= 10,
            "At least 10 workflows should use structured JSON output, found {}",
            with_json
        );
    }

    #[test]
    fn test_showcase_llm_uses_for_each() {
        let with_foreach = SHOWCASE_LLM
            .iter()
            .filter(|w| w.content.contains("for_each:"))
            .count();
        assert!(
            with_foreach >= 6,
            "At least 6 workflows should use for_each, found {}",
            with_foreach
        );
    }

    #[test]
    fn test_showcase_llm_verb_diversity() {
        let all: String = SHOWCASE_LLM
            .iter()
            .map(|w| w.content)
            .collect::<Vec<_>>()
            .join("\n");
        assert!(
            all.contains("exec:"),
            "Must include exec: across all workflows"
        );
        assert!(
            all.contains("fetch:"),
            "Must include fetch: across all workflows"
        );
        assert!(
            all.contains("infer:"),
            "Must include infer: across all workflows"
        );
        assert!(all.contains("for_each:"), "Must include for_each: pattern");
        assert!(
            all.contains("response_format: json"),
            "Must include structured output"
        );
    }

    #[test]
    fn test_showcase_llm_categories() {
        let categories: Vec<&str> = SHOWCASE_LLM.iter().map(|w| w.category).collect();
        assert!(
            categories.contains(&"content"),
            "Must have content category"
        );
        assert!(
            categories.contains(&"engineering"),
            "Must have engineering category"
        );
        assert!(
            categories.contains(&"analysis"),
            "Must have analysis category"
        );
        assert!(
            categories.contains(&"operations"),
            "Must have operations category"
        );
    }

    #[test]
    fn test_showcase_llm_content_not_empty() {
        for w in SHOWCASE_LLM {
            assert!(
                w.content.len() > 200,
                "Workflow '{}' content too short ({} bytes)",
                w.name,
                w.content.len()
            );
        }
    }

    #[test]
    fn test_showcase_llm_line_count_range() {
        for w in SHOWCASE_LLM {
            let lines = w.content.lines().count();
            assert!(
                (20..=120).contains(&lines),
                "Workflow '{}' has {} lines (expected 20-120)",
                w.name,
                lines
            );
        }
    }
}