feature-adjust.json 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. {
  2. "version": "3.16",
  3. "name": "FeatureAdjust",
  4. "description": "Add or modify a feature in an existing page/section — e.g., add a button, add a form field, add a chart, modify event behavior. More granular than add-page (which creates a whole new page).",
  5. "sectionMerge": true,
  6. "registry": {
  7. "params": [
  8. "featureRequest(STRING)",
  9. "currentMeta(OBJECT)"
  10. ],
  11. "services": [],
  12. "apis": [],
  13. "components": [],
  14. "vars": [
  15. "$featurePlan(OBJECT)",
  16. "$affectedSections(ARRAY)",
  17. "$affectedServices(ARRAY)",
  18. "$newComponents(ARRAY)",
  19. "$updatedMeta(OBJECT)"
  20. ],
  21. "files": {
  22. "inputs": [
  23. ".vl-code/ProjectMeta.json",
  24. "Sections/*",
  25. "Services/*",
  26. "ExtComponents/*"
  27. ],
  28. "artifacts": [
  29. ".vl-code/ProjectMeta.json",
  30. "Sections/*",
  31. "Services/*",
  32. "ExtComponents/*"
  33. ]
  34. },
  35. "docs": {
  36. "1": "VL 3.7 Syntax Rules"
  37. }
  38. },
  39. "steps": [
  40. {
  41. "id": "LLM_010_PlanFeature",
  42. "meta": {
  43. "title": "1. Analyze project and plan feature changes"
  44. },
  45. "in": {
  46. "docs": [
  47. "1"
  48. ],
  49. "max_tokens": 32768,
  50. "messages": [
  51. {
  52. "role": "user",
  53. "content": "You are a VL project architect. Analyze the current project and plan how to add/modify the requested feature.\n\nCurrent ProjectMeta:"
  54. },
  55. {
  56. "role": "user",
  57. "content": "=currentMeta"
  58. },
  59. {
  60. "role": "user",
  61. "content": "Feature request:"
  62. },
  63. {
  64. "role": "user",
  65. "content": "=featureRequest"
  66. },
  67. {
  68. "role": "user",
  69. "content": "Return a JSON plan with:\n- summary: one-line description of the change\n- affectedSections: [{name, file, changes: string}] — existing sections to modify\n- affectedServices: [{name, file, changes: string}] — existing services to modify\n- newComponents: [{name, description}] — new components to create (if any)\n- dbChanges: [{table, changes: string}] — database changes (if any)\n- updatedMeta: the FULL updated ProjectMeta reflecting the changes\n\nOnly include items that actually need changes. Prefer modifying existing files over creating new ones."
  70. }
  71. ],
  72. "output_config": {
  73. "format": {
  74. "type": "json_object"
  75. }
  76. },
  77. "stream": true
  78. },
  79. "out": {
  80. "$featurePlan": "=_result",
  81. "$affectedSections": "=_result.affectedSections",
  82. "$affectedServices": "=_result.affectedServices",
  83. "$newComponents": "=_result.newComponents",
  84. "$updatedMeta": "=_result.updatedMeta"
  85. },
  86. "next": "Pause_020_ReviewPlan"
  87. },
  88. {
  89. "id": "Pause_020_ReviewPlan",
  90. "meta": {
  91. "title": "2. Review feature plan (developer checkpoint)"
  92. },
  93. "resumeResultTarget": "$approved",
  94. "next": "Branch_030_CheckApproval"
  95. },
  96. {
  97. "id": "Branch_030_CheckApproval",
  98. "meta": {
  99. "title": "3. Check if plan was approved"
  100. },
  101. "cases": [
  102. {
  103. "condition": "=$approved === false",
  104. "next": "Stop_Cancelled"
  105. }
  106. ],
  107. "default": "Fork_040_Execute"
  108. },
  109. {
  110. "id": "Fork_040_Execute",
  111. "meta": {
  112. "title": "4. Execute changes in parallel"
  113. },
  114. "children": [
  115. "Loop_050_EditSections",
  116. "Loop_060_EditServices",
  117. "Loop_070_GenComponents"
  118. ],
  119. "next": "Set_080_UpdateMeta"
  120. },
  121. {
  122. "id": "Loop_050_EditSections",
  123. "meta": {
  124. "title": "4a. Edit affected sections"
  125. },
  126. "source": "=$affectedSections",
  127. "mode": "serial",
  128. "children": [
  129. "LLM_051_EditSection"
  130. ],
  131. "next": "RETURN"
  132. },
  133. {
  134. "id": "LLM_051_EditSection",
  135. "meta": {
  136. "title": "Edit section: =_item.name"
  137. },
  138. "in": {
  139. "docs": [
  140. "1"
  141. ],
  142. "max_tokens": 32768,
  143. "stream": true,
  144. "readFiles": [
  145. "=_item.file"
  146. ],
  147. "messages": [
  148. {
  149. "role": "user",
  150. "content": "You are editing an existing VL section file. Read the CURRENT file content carefully and make ONLY the changes described below.\n\nProject metadata:"
  151. },
  152. {
  153. "role": "user",
  154. "content": "=$updatedMeta"
  155. },
  156. {
  157. "role": "user",
  158. "content": "Changes to make:"
  159. },
  160. {
  161. "role": "user",
  162. "content": "=_item.changes"
  163. },
  164. {
  165. "role": "user",
  166. "content": "IMPORTANT: Output the COMPLETE updated section file. Preserve ALL existing bindings, events, and layout elements. Only add/modify what the changes require. Use VL 3.7 syntax with hyphen indentation.\n\nIMPORTANT: The file MUST start with '// VL_VERSION:3.7' as the first non-empty line."
  167. }
  168. ]
  169. },
  170. "out": {
  171. "/{_item.file}": "=_result"
  172. },
  173. "onError": "retry",
  174. "retryCount": 1
  175. },
  176. {
  177. "id": "Loop_060_EditServices",
  178. "meta": {
  179. "title": "4b. Edit affected services"
  180. },
  181. "source": "=$affectedServices",
  182. "mode": "serial",
  183. "children": [
  184. "LLM_061_EditService"
  185. ],
  186. "next": "RETURN"
  187. },
  188. {
  189. "id": "LLM_061_EditService",
  190. "meta": {
  191. "title": "Edit service: =_item.name"
  192. },
  193. "in": {
  194. "docs": [
  195. "1"
  196. ],
  197. "max_tokens": 32768,
  198. "stream": true,
  199. "readFiles": [
  200. "=_item.file"
  201. ],
  202. "messages": [
  203. {
  204. "role": "user",
  205. "content": "You are editing an existing VL service file. Read the CURRENT file content carefully and make ONLY the changes described below.\n\nChanges to make:"
  206. },
  207. {
  208. "role": "user",
  209. "content": "=_item.changes"
  210. },
  211. {
  212. "role": "user",
  213. "content": "Output the COMPLETE updated service file. Preserve ALL existing methods. Only add/modify what the changes require.\n\nIMPORTANT: The file MUST start with '// VL_VERSION:3.7' as the first non-empty line."
  214. }
  215. ]
  216. },
  217. "out": {
  218. "/{_item.file}": "=_result"
  219. },
  220. "onError": "retry",
  221. "retryCount": 1
  222. },
  223. {
  224. "id": "Loop_070_GenComponents",
  225. "meta": {
  226. "title": "4c. Generate new components (if any)"
  227. },
  228. "source": "=$newComponents",
  229. "mode": "parallel",
  230. "children": [
  231. "LLM_071_GenComponent"
  232. ],
  233. "next": "RETURN",
  234. "onError": "skip"
  235. },
  236. {
  237. "id": "LLM_071_GenComponent",
  238. "meta": {
  239. "title": "Generate component: =_item.name"
  240. },
  241. "in": {
  242. "docs": [
  243. "1"
  244. ],
  245. "max_tokens": 32768,
  246. "stream": true,
  247. "messages": [
  248. {
  249. "role": "user",
  250. "content": "Generate a new VL 3.5 component (.cp) file.\n\nComponent spec:"
  251. },
  252. {
  253. "role": "user",
  254. "content": "=_item"
  255. },
  256. {
  257. "role": "user",
  258. "content": "Project metadata:"
  259. },
  260. {
  261. "role": "user",
  262. "content": "=$updatedMeta\n\nIMPORTANT: The file MUST start with '// VL_VERSION:3.7' as the first non-empty line."
  263. }
  264. ]
  265. },
  266. "out": {
  267. "/{_item.filePath}": "=_result"
  268. },
  269. "onError": "skip"
  270. },
  271. {
  272. "id": "Set_080_UpdateMeta",
  273. "meta": {
  274. "title": "5. Update ProjectMeta"
  275. },
  276. "in": {},
  277. "out": {
  278. "/.vl-code/ProjectMeta.json": "=$updatedMeta"
  279. },
  280. "next": "Set_090_SkipValidation"
  281. },
  282. {
  283. "id": "Set_090_SkipValidation",
  284. "meta": {
  285. "title": "6. Skip validation (generation-only mode)"
  286. },
  287. "target": "$validationSkipped",
  288. "value": "=true",
  289. "next": "Stop_Done"
  290. },
  291. {
  292. "id": "Stop_Done",
  293. "meta": {
  294. "title": "Feature adjustment complete"
  295. }
  296. },
  297. {
  298. "id": "Stop_Cancelled",
  299. "meta": {
  300. "title": "Feature adjustment cancelled by developer"
  301. }
  302. }
  303. ]
  304. }