3-file-codegen.json 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465
  1. {
  2. "version": "3.16",
  3. "name": "VL_FullStack_CodeGen_3Files",
  4. "description": "Full-stack code generation using 3 auxiliary files: PRD -> default Theme/Theme.vth + VDB + ServiceMap + UIMap -> all VL files in parallel.",
  5. "_source": "DocCenter paths: 31-38 (agent prompts), 39 (aux spec), 1 (VL 3.7 syntax)",
  6. "registry": {
  7. "params": [
  8. "userRequest(STRING)",
  9. "targetLang(STRING)"
  10. ],
  11. "services": [],
  12. "apis": [],
  13. "components": [
  14. "ClearExisting"
  15. ],
  16. "vars": [
  17. "$prdJson(OBJECT)",
  18. "$prdJsonStr(STRING)",
  19. "$vdbContent(STRING)",
  20. "$serviceMapJson(OBJECT)",
  21. "$serviceMapJsonStr(STRING)",
  22. "$uiMapJson(OBJECT)",
  23. "$uiMapJsonStr(STRING)"
  24. ],
  25. "files": {
  26. "inputs": [
  27. "Process/Input/*",
  28. "Theme/Theme.vth"
  29. ],
  30. "artifacts": [
  31. "Process/Artifacts/*",
  32. "Database/*",
  33. "Services/*",
  34. "Sections/*",
  35. "ExtComponents/*",
  36. "Apps/*",
  37. "Theme/*"
  38. ]
  39. },
  40. "docs": {
  41. "1": "VL 3.7 Syntax Specification",
  42. "31": "Agent-100-PRD-Prompt",
  43. "32": "Agent-200-DB-Prompt",
  44. "33": "Agent-300-ServiceMap-Prompt",
  45. "34": "Agent-400-UIMap-Prompt",
  46. "35": "Agent-500-Component-Prompt",
  47. "36": "Agent-600-ServiceDomain-Prompt",
  48. "37": "Agent-700-Section-Prompt",
  49. "38": "Agent-800-AppEntry-Prompt"
  50. }
  51. },
  52. "steps": [
  53. {
  54. "id": "Component_ClearExisting",
  55. "meta": {
  56. "title": "0. Clear existing VL files before regeneration"
  57. },
  58. "in": {},
  59. "out": {},
  60. "next": "SeedTheme_050_DefaultTheme"
  61. },
  62. {
  63. "id": "SeedTheme_050_DefaultTheme",
  64. "meta": {
  65. "title": "0a. Seed default Theme/Theme.vth"
  66. },
  67. "in": {
  68. "path": "Theme/Theme.vth"
  69. },
  70. "out": {
  71. "/Theme/Theme.vth": "=_result"
  72. },
  73. "next": "LLM_100_PRD"
  74. },
  75. {
  76. "id": "LLM_100_PRD",
  77. "meta": {
  78. "title": "Agent-1 · PRD Analysis"
  79. },
  80. "in": {
  81. "docs": [
  82. "1",
  83. "31"
  84. ],
  85. "max_tokens": 8192,
  86. "messages": [
  87. {
  88. "role": "user",
  89. "content": "Requirement:"
  90. },
  91. {
  92. "role": "user",
  93. "content": "=userRequest"
  94. },
  95. {
  96. "role": "user",
  97. "content": "Target Language:"
  98. },
  99. {
  100. "role": "user",
  101. "content": "=targetLang"
  102. },
  103. {
  104. "role": "user",
  105. "content": "Naming contract: projectName must be PascalCase; database file is Database/<ProjectName>.vdb; theme file is Theme/Theme.vth."
  106. }
  107. ],
  108. "output_config": {
  109. "format": {
  110. "type": "json_object"
  111. }
  112. }
  113. },
  114. "out": {
  115. "$prdJson": "=_result",
  116. "$prdJsonStr": "=_result",
  117. "/Process/Artifacts/PRD.json": "=_result"
  118. },
  119. "next": "LLM_200_DB"
  120. },
  121. {
  122. "id": "LLM_200_DB",
  123. "meta": {
  124. "title": "Agent-2 · VDB Database Generation"
  125. },
  126. "in": {
  127. "stream": true,
  128. "docs": [
  129. "1",
  130. "32"
  131. ],
  132. "max_tokens": 16000,
  133. "messages": [
  134. {
  135. "role": "user",
  136. "content": "PRD:"
  137. },
  138. {
  139. "role": "user",
  140. "content": "=$prdJsonStr"
  141. }
  142. ]
  143. },
  144. "out": {
  145. "$vdbContent": "=_result",
  146. "/Database/{$prdJson.projectName || 'Project'}.vdb": "=_result"
  147. },
  148. "next": "LLM_300_ServiceMap"
  149. },
  150. {
  151. "id": "LLM_300_ServiceMap",
  152. "meta": {
  153. "title": "Agent-3 · ServiceMap Service Contract"
  154. },
  155. "in": {
  156. "docs": [
  157. "1",
  158. "33"
  159. ],
  160. "max_tokens": 8192,
  161. "messages": [
  162. {
  163. "role": "user",
  164. "content": "PRD:"
  165. },
  166. {
  167. "role": "user",
  168. "content": "=$prdJsonStr"
  169. },
  170. {
  171. "role": "user",
  172. "content": "VDB:"
  173. },
  174. {
  175. "role": "user",
  176. "content": "=$vdbContent"
  177. },
  178. {
  179. "role": "user",
  180. "content": "Service naming contract: every generated service filePath must be Services/<DomainId>.vs."
  181. }
  182. ],
  183. "output_config": {
  184. "format": {
  185. "type": "json_object"
  186. }
  187. }
  188. },
  189. "out": {
  190. "$serviceMapJson": "=_result",
  191. "$serviceMapJsonStr": "=_result",
  192. "/Process/Artifacts/ServiceMap.json": "=_result"
  193. },
  194. "next": "LLM_400_UIMap"
  195. },
  196. {
  197. "id": "LLM_400_UIMap",
  198. "meta": {
  199. "title": "Agent-4 · UIMap UI Architecture"
  200. },
  201. "in": {
  202. "docs": [
  203. "1",
  204. "34"
  205. ],
  206. "max_tokens": 16000,
  207. "messages": [
  208. {
  209. "role": "user",
  210. "content": "PRD:"
  211. },
  212. {
  213. "role": "user",
  214. "content": "=$prdJsonStr"
  215. },
  216. {
  217. "role": "user",
  218. "content": "ServiceMap:"
  219. },
  220. {
  221. "role": "user",
  222. "content": "=$serviceMapJsonStr"
  223. },
  224. {
  225. "role": "user",
  226. "content": "UI naming contract: theme file is Theme/Theme.vth; component filePath is ExtComponents/<Id>.cp; section filePath is Sections/<Id>.sc; app filePath is Apps/<Id>.vx."
  227. }
  228. ],
  229. "output_config": {
  230. "format": {
  231. "type": "json_object"
  232. }
  233. }
  234. },
  235. "out": {
  236. "$uiMapJson": "=_result",
  237. "$uiMapJsonStr": "=_result",
  238. "/Process/Artifacts/UIMap.json": "=_result"
  239. },
  240. "next": "Loop_Components"
  241. },
  242. {
  243. "id": "Loop_Components",
  244. "meta": {
  245. "title": "Phase-5 · Component Generation (.cp, parallel)"
  246. },
  247. "source": "=$uiMapJson.components",
  248. "mode": "parallel",
  249. "children": [
  250. "LLM_500_Component"
  251. ],
  252. "next": "Loop_ServiceDomains"
  253. },
  254. {
  255. "id": "LLM_500_Component",
  256. "meta": {
  257. "title": "Agent-5 · .cp Component"
  258. },
  259. "in": {
  260. "stream": true,
  261. "docs": [
  262. "1",
  263. "35"
  264. ],
  265. "max_tokens": 16000,
  266. "messages": [
  267. {
  268. "role": "user",
  269. "content": "ComponentItem:"
  270. },
  271. {
  272. "role": "user",
  273. "content": "=_item + ''"
  274. },
  275. {
  276. "role": "user",
  277. "content": "UIMap:"
  278. },
  279. {
  280. "role": "user",
  281. "content": "=$uiMapJsonStr"
  282. }
  283. ]
  284. },
  285. "out": {
  286. "/{_item.filePath}": "=_result"
  287. },
  288. "next": "RETURN"
  289. },
  290. {
  291. "id": "Loop_ServiceDomains",
  292. "meta": {
  293. "title": "Phase-6 · Service Generation (.vs)"
  294. },
  295. "source": "=$serviceMapJson.serviceDomains",
  296. "mode": "parallel",
  297. "children": [
  298. "LLM_600_ServiceDomain"
  299. ],
  300. "next": "Loop_Sections"
  301. },
  302. {
  303. "id": "LLM_600_ServiceDomain",
  304. "meta": {
  305. "title": "Agent-6 · .vs Service"
  306. },
  307. "in": {
  308. "stream": true,
  309. "docs": [
  310. "1",
  311. "36"
  312. ],
  313. "max_tokens": 16000,
  314. "messages": [
  315. {
  316. "role": "user",
  317. "content": "DomainItem:"
  318. },
  319. {
  320. "role": "user",
  321. "content": "=_item + ''"
  322. },
  323. {
  324. "role": "user",
  325. "content": "ServiceMap:"
  326. },
  327. {
  328. "role": "user",
  329. "content": "=$serviceMapJsonStr"
  330. },
  331. {
  332. "role": "user",
  333. "content": "VDB:"
  334. },
  335. {
  336. "role": "user",
  337. "content": "=$vdbContent"
  338. }
  339. ]
  340. },
  341. "out": {
  342. "/{_item.filePath}": "=_result"
  343. },
  344. "next": "RETURN"
  345. },
  346. {
  347. "id": "Loop_Sections",
  348. "meta": {
  349. "title": "Phase-7 · Section Generation (.sc, parallel)"
  350. },
  351. "source": "=$uiMapJson.sections",
  352. "mode": "parallel",
  353. "children": [
  354. "LLM_700_Section"
  355. ],
  356. "next": "Loop_Apps"
  357. },
  358. {
  359. "id": "LLM_700_Section",
  360. "meta": {
  361. "title": "Agent-7 · .sc Section"
  362. },
  363. "in": {
  364. "stream": true,
  365. "docs": [
  366. "1",
  367. "37"
  368. ],
  369. "max_tokens": 16000,
  370. "messages": [
  371. {
  372. "role": "user",
  373. "content": "SectionItem:"
  374. },
  375. {
  376. "role": "user",
  377. "content": "=_item + ''"
  378. },
  379. {
  380. "role": "user",
  381. "content": "UIMap:"
  382. },
  383. {
  384. "role": "user",
  385. "content": "=$uiMapJsonStr"
  386. },
  387. {
  388. "role": "user",
  389. "content": "ServiceMap:"
  390. },
  391. {
  392. "role": "user",
  393. "content": "=$serviceMapJsonStr"
  394. },
  395. {
  396. "role": "user",
  397. "content": "Compile-safety rules: 1) style: values must be static string literals only; NEVER use ternary, concat, variables, or any expression inside style:. If appearance depends on data, split the node with If blocks or use StateStyle conditions; never write style:($cond ? \"a\" : \"b\"). 2) NEVER emit CSS-only skin properties such as border-collapse. 3) Use only services that actually exist in ServiceMap, and keep ServiceDomain / Service names aligned with the declared domainId and serviceId. 4) Prefer simple VL-safe layout props over raw CSS. 5) NEVER bind events directly on <For-*> nodes; bind the event on the interactive child inside the loop instead. 6) NEVER emit deprecated <StateStyle-*> trigger:\"hover\" blocks. Output only valid .sc source."
  398. }
  399. ]
  400. },
  401. "out": {
  402. "/{_item.filePath}": "=_result"
  403. },
  404. "next": "RETURN"
  405. },
  406. {
  407. "id": "Loop_Apps",
  408. "meta": {
  409. "title": "Phase-8 · App Entry Generation (.vx)"
  410. },
  411. "source": "=$uiMapJson.apps",
  412. "mode": "parallel",
  413. "children": [
  414. "LLM_800_AppEntry"
  415. ],
  416. "next": "Stop_Done"
  417. },
  418. {
  419. "id": "LLM_800_AppEntry",
  420. "meta": {
  421. "title": "Agent-8 · .vx App Entry"
  422. },
  423. "in": {
  424. "stream": true,
  425. "docs": [
  426. "1",
  427. "38"
  428. ],
  429. "max_tokens": 16000,
  430. "messages": [
  431. {
  432. "role": "user",
  433. "content": "AppItem:"
  434. },
  435. {
  436. "role": "user",
  437. "content": "=_item + ''"
  438. },
  439. {
  440. "role": "user",
  441. "content": "UIMap:"
  442. },
  443. {
  444. "role": "user",
  445. "content": "=$uiMapJsonStr"
  446. },
  447. {
  448. "role": "user",
  449. "content": "Compile-safety rules: generate only VL-valid .vx source. Do not invent raw CSS properties, and only reference sections/components that exist in UIMap."
  450. }
  451. ]
  452. },
  453. "out": {
  454. "/{_item.filePath}": "=_result"
  455. },
  456. "next": "RETURN"
  457. },
  458. {
  459. "id": "Stop_Done",
  460. "meta": {
  461. "title": "✅ Code Generation Complete"
  462. }
  463. }
  464. ]
  465. }