@rashidee/co2 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/index.js +25449 -0
  2. package/drizzle/0000_remarkable_charles_xavier.sql +210 -0
  3. package/drizzle/0001_wise_wolf_cub.sql +13 -0
  4. package/drizzle/0002_secret_spyke.sql +16 -0
  5. package/drizzle/0003_workspace_config_singleton.sql +16 -0
  6. package/drizzle/0004_terminal_claim_v120.sql +11 -0
  7. package/drizzle/0005_brainstorm_v124.sql +10 -0
  8. package/drizzle/0006_project_v140.sql +6 -0
  9. package/drizzle/0007_prd_wizard_v124.sql +14 -0
  10. package/drizzle/0008_workflow_artifact_v126.sql +24 -0
  11. package/drizzle/0009_project_import_v150.sql +7 -0
  12. package/drizzle/0010_quality_v151.sql +3 -0
  13. package/drizzle/meta/0000_snapshot.json +1335 -0
  14. package/drizzle/meta/0001_snapshot.json +1416 -0
  15. package/drizzle/meta/0002_snapshot.json +1510 -0
  16. package/drizzle/meta/_journal.json +83 -0
  17. package/package.json +41 -0
  18. package/plugin/.claude-plugin/marketplace.json +36 -0
  19. package/plugin/.claude-plugin/plugin.json +22 -0
  20. package/plugin/README.md +625 -0
  21. package/plugin/SKILLS.md +350 -0
  22. package/plugin/co2.svg +5 -0
  23. package/plugin/commands/brainstorm-loop.md +129 -0
  24. package/plugin/skills/conductor-defect/SKILL.md +898 -0
  25. package/plugin/skills/conductor-feature-develop/SKILL.md +1383 -0
  26. package/plugin/skills/conductor-feature-develop/references/implementation-domain-template.md +131 -0
  27. package/plugin/skills/conductor-feature-develop/references/implementation-master-template.md +89 -0
  28. package/plugin/skills/conductor-feature-develop/references/playwright-setup.md +224 -0
  29. package/plugin/skills/conductor-feature-prepare/SKILL.md +604 -0
  30. package/plugin/skills/depgen-k8s/SKILL.md +468 -0
  31. package/plugin/skills/depgen-k8s/references/dockerfile-laravel.md +197 -0
  32. package/plugin/skills/depgen-k8s/references/dockerfile-nodejs.md +163 -0
  33. package/plugin/skills/depgen-k8s/references/dockerfile-spring-boot.md +174 -0
  34. package/plugin/skills/depgen-k8s/references/k8s-patterns.md +869 -0
  35. package/plugin/skills/mockgen-shadcn/SKILL.md +1067 -0
  36. package/plugin/skills/mockgen-shadcn/references/admin-layout-template.md +1467 -0
  37. package/plugin/skills/mockgen-shadcn/references/mockup-hub-template.md +498 -0
  38. package/plugin/skills/mockgen-shadcn/references/mockup-index-template.md +216 -0
  39. package/plugin/skills/mockgen-tailwind/SKILL.md +904 -0
  40. package/plugin/skills/mockgen-tailwind/references/admin-layout-template.md +720 -0
  41. package/plugin/skills/mockgen-tailwind/references/mockup-hub-template.md +498 -0
  42. package/plugin/skills/mockgen-tailwind/references/mockup-index-template.md +190 -0
  43. package/plugin/skills/modelgen-nosql/SKILL.md +617 -0
  44. package/plugin/skills/modelgen-nosql/references/model-extraction-methodology.md +497 -0
  45. package/plugin/skills/modelgen-nosql/references/nosql-design-guide.md +258 -0
  46. package/plugin/skills/modelgen-relational/SKILL.md +707 -0
  47. package/plugin/skills/modelgen-relational/references/model-extraction-methodology.md +499 -0
  48. package/plugin/skills/specgen-flutter-riverpod/SKILL.md +898 -0
  49. package/plugin/skills/specgen-flutter-riverpod/references/component-patterns.md +971 -0
  50. package/plugin/skills/specgen-flutter-riverpod/references/notification-patterns.md +457 -0
  51. package/plugin/skills/specgen-flutter-riverpod/references/routing-patterns.md +362 -0
  52. package/plugin/skills/specgen-flutter-riverpod/references/security-patterns.md +709 -0
  53. package/plugin/skills/specgen-flutter-riverpod/references/spec-template.md +1566 -0
  54. package/plugin/skills/specgen-flutter-riverpod/references/state-patterns.md +518 -0
  55. package/plugin/skills/specgen-flutter-riverpod/references/storage-patterns.md +370 -0
  56. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/SKILL.md +984 -0
  57. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/batch-patterns.md +359 -0
  58. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/messaging-patterns.md +468 -0
  59. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/modulith-patterns.md +461 -0
  60. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/reporting-patterns.md +803 -0
  61. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/security-patterns.md +501 -0
  62. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/spec-template.md +1268 -0
  63. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/web-patterns.md +301 -0
  64. package/plugin/skills/specgen-node-cli-web/SKILL.md +561 -0
  65. package/plugin/skills/specgen-node-cli-web/references/auth-patterns.md +293 -0
  66. package/plugin/skills/specgen-node-cli-web/references/cli-packaging-patterns.md +250 -0
  67. package/plugin/skills/specgen-node-cli-web/references/server-patterns.md +247 -0
  68. package/plugin/skills/specgen-node-cli-web/references/spec-template.md +401 -0
  69. package/plugin/skills/specgen-node-cli-web/references/testing-patterns.md +174 -0
  70. package/plugin/skills/specgen-react-mui/SKILL.md +789 -0
  71. package/plugin/skills/specgen-react-mui/references/component-patterns.md +1077 -0
  72. package/plugin/skills/specgen-react-mui/references/reporting-patterns.md +1998 -0
  73. package/plugin/skills/specgen-react-mui/references/routing-patterns.md +461 -0
  74. package/plugin/skills/specgen-react-mui/references/security-patterns.md +599 -0
  75. package/plugin/skills/specgen-react-mui/references/spec-template.md +1030 -0
  76. package/plugin/skills/specgen-react-mui/references/state-patterns.md +327 -0
  77. package/plugin/skills/specgen-react-tailwind/SKILL.md +859 -0
  78. package/plugin/skills/specgen-react-tailwind/references/component-patterns.md +1212 -0
  79. package/plugin/skills/specgen-react-tailwind/references/reporting-patterns.md +1529 -0
  80. package/plugin/skills/specgen-react-tailwind/references/routing-patterns.md +669 -0
  81. package/plugin/skills/specgen-react-tailwind/references/security-patterns.md +656 -0
  82. package/plugin/skills/specgen-react-tailwind/references/spec-template.md +1237 -0
  83. package/plugin/skills/specgen-react-tailwind/references/state-patterns.md +327 -0
  84. package/plugin/skills/specgen-sdk-java/SKILL.md +933 -0
  85. package/plugin/skills/specgen-sdk-java/references/api-extraction-patterns.md +247 -0
  86. package/plugin/skills/specgen-sdk-java/references/http-client-patterns.md +495 -0
  87. package/plugin/skills/specgen-sdk-java/references/packaging-patterns.md +366 -0
  88. package/plugin/skills/specgen-sdk-java/references/spec-template.md +956 -0
  89. package/plugin/skills/specgen-spring-jpa-jtehtmx/SKILL.md +1284 -0
  90. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/batch-patterns.md +1224 -0
  91. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/jasper-patterns.md +1638 -0
  92. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/messaging-patterns.md +512 -0
  93. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/modulith-patterns.md +354 -0
  94. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/security-patterns.md +551 -0
  95. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/spec-template.md +2502 -0
  96. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/web-patterns.md +503 -0
  97. package/plugin/skills/specgen-spring-jpa-restapi/SKILL.md +990 -0
  98. package/plugin/skills/specgen-spring-jpa-restapi/references/batch-patterns.md +1224 -0
  99. package/plugin/skills/specgen-spring-jpa-restapi/references/messaging-patterns.md +512 -0
  100. package/plugin/skills/specgen-spring-jpa-restapi/references/modulith-patterns.md +279 -0
  101. package/plugin/skills/specgen-spring-jpa-restapi/references/reporting-patterns.md +1536 -0
  102. package/plugin/skills/specgen-spring-jpa-restapi/references/restapi-patterns.md +722 -0
  103. package/plugin/skills/specgen-spring-jpa-restapi/references/security-patterns.md +351 -0
  104. package/plugin/skills/specgen-spring-jpa-restapi/references/spec-template.md +553 -0
  105. package/plugin/skills/specgen-ts-cli/SKILL.md +861 -0
  106. package/plugin/skills/specgen-ts-cli/references/async-patterns.md +1101 -0
  107. package/plugin/skills/specgen-ts-cli/references/command-patterns.md +383 -0
  108. package/plugin/skills/specgen-ts-cli/references/config-patterns.md +430 -0
  109. package/plugin/skills/specgen-ts-cli/references/database-patterns.md +750 -0
  110. package/plugin/skills/specgen-ts-cli/references/packaging-patterns.md +426 -0
  111. package/plugin/skills/specgen-ts-cli/references/spec-template.md +1391 -0
  112. package/plugin/skills/specgen-ts-cli/references/testing-patterns.md +909 -0
  113. package/plugin/skills/testgen-functional/SKILL.md +1381 -0
  114. package/plugin/skills/tracegen-matrix/SKILL.md +243 -0
  115. package/plugin/skills/util-preparek8senv/SKILL.md +422 -0
  116. package/plugin/skills/util-projectinit/SKILL.md +307 -0
  117. package/plugin/skills/util-projectinit/reference/brainstorm-loop.md +129 -0
  118. package/plugin/skills/util-projectinit/reference/brainstorm-protocol.md +144 -0
  119. package/plugin/skills/util-projectinit/reference/brainstorm-setup-guide.md +153 -0
  120. package/plugin/skills/util-projectinit/reference/brainstorm-template-appdev.md +87 -0
  121. package/plugin/skills/util-projectinit/reference/co2-context-generation-guide.md +761 -0
  122. package/plugin/skills/util-projectsync/SKILL.md +501 -0
  123. package/plugin/skills/util-updprd/SKILL.md +324 -0
  124. package/plugin/skills/util-usanalyzer/SKILL.md +307 -0
  125. package/plugin/skills/util-ustagger/SKILL.md +154 -0
  126. package/static/assets/abnfDiagram-VRR7QNED-DvPuwyCV.js +1 -0
  127. package/static/assets/arc-DRKw7sjs.js +1 -0
  128. package/static/assets/architectureDiagram-ZJ3FMSHR-CaNcxUbC.js +36 -0
  129. package/static/assets/blockDiagram-677ZJIJ3-Demd4AOK.js +132 -0
  130. package/static/assets/c4Diagram-LMCZKHZV-PVKUfc2x.js +10 -0
  131. package/static/assets/channel-C2nVbuwv.js +1 -0
  132. package/static/assets/chunk-2Q5K7J3B-CExf8ww_.js +1 -0
  133. package/static/assets/chunk-32BRIVSS-CFPaoONF.js +1 -0
  134. package/static/assets/chunk-5VM5RSS4-DE2esM67.js +15 -0
  135. package/static/assets/chunk-EX3LRPZG-SON_YdDG.js +231 -0
  136. package/static/assets/chunk-JWPE2WC7-Qxah8LNr.js +1 -0
  137. package/static/assets/chunk-MOJQB5TN-BcWGQV3j.js +88 -0
  138. package/static/assets/chunk-RYQCIY6F-DkDj-OR5.js +1 -0
  139. package/static/assets/chunk-V7JOEXUC-BlI1Mrah.js +206 -0
  140. package/static/assets/chunk-VR4S4FIN-Agf__duj.js +1 -0
  141. package/static/assets/chunk-XXDRQBXY-B5CfAh85.js +1 -0
  142. package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +1 -0
  143. package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +1 -0
  144. package/static/assets/cose-bilkent-JH36ORCC-DO0cQkcy.js +1 -0
  145. package/static/assets/cynefin-VYW2F7L2-CfOnsnXc.js +178 -0
  146. package/static/assets/cynefinDiagram-TSTJHNR4-BJ8tULAv.js +62 -0
  147. package/static/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
  148. package/static/assets/dagre-VKFMJZFB-DfjwzHqP.js +4 -0
  149. package/static/assets/defaultLocale-DX6XiGOO.js +1 -0
  150. package/static/assets/diagram-FQU43EPY-CndSOIIM.js +3 -0
  151. package/static/assets/diagram-G47NLZAW-Czf5hN0Z.js +24 -0
  152. package/static/assets/diagram-NH7WQ7WH-COAyojGh.js +24 -0
  153. package/static/assets/diagram-OA4YK3LP-H8PoiN2m.js +30 -0
  154. package/static/assets/diagram-WEI45ONY-DzcaVzjp.js +41 -0
  155. package/static/assets/ebnfDiagram-CCIWWBDH-DPazGYLJ.js +1 -0
  156. package/static/assets/erDiagram-Q63AITRT-Bo-fubgF.js +85 -0
  157. package/static/assets/flowDiagram-23GEKE2U-CSvxUDwh.js +156 -0
  158. package/static/assets/ganttDiagram-NO4QXBWP-DnBveWX6.js +292 -0
  159. package/static/assets/gitGraphDiagram-IHSO6WYX-B3rVL8c-.js +106 -0
  160. package/static/assets/graph-C9eacEi8.js +1 -0
  161. package/static/assets/index-LZSQkLE2.css +41 -0
  162. package/static/assets/index-y7XDSgMG.js +495 -0
  163. package/static/assets/infoDiagram-FWYZ7A6U-CvWV9yy2.js +2 -0
  164. package/static/assets/init-Gi6I4Gst.js +1 -0
  165. package/static/assets/ishikawaDiagram-FXEZZL3T-DF28a1N6.js +70 -0
  166. package/static/assets/journeyDiagram-5HDEW3XC-CB6CugYk.js +139 -0
  167. package/static/assets/kanban-definition-HUTT4EX6-ResSLF6d.js +89 -0
  168. package/static/assets/katex-C5jXJg4s.js +257 -0
  169. package/static/assets/layout-DEXfKzaS.js +1 -0
  170. package/static/assets/linear-CLO--ryk.js +1 -0
  171. package/static/assets/map-Czzmt4hB.js +1 -0
  172. package/static/assets/mindmap-definition-LN4V7U3C-BvW3EbxX.js +96 -0
  173. package/static/assets/ordinal-Cboi1Yqb.js +1 -0
  174. package/static/assets/pegDiagram-2B236MQR-BHCgqrrM.js +1 -0
  175. package/static/assets/pieDiagram-ENE6RG2P-DVmCQ5FA.js +39 -0
  176. package/static/assets/quadrantDiagram-ABIIQ3AL-B3e5KR52.js +7 -0
  177. package/static/assets/railroadDiagram-RFXS5EU6-Csv5ysLc.js +1 -0
  178. package/static/assets/requirementDiagram-TGXJPOKE-DOMVzvnB.js +84 -0
  179. package/static/assets/sankeyDiagram-HTMAVEWB-B1dcTOvy.js +40 -0
  180. package/static/assets/sequenceDiagram-DBY2YBRQ-BY414yeO.js +162 -0
  181. package/static/assets/sizeCapture-X5ZJPWSS-CuJfrfBN.js +1 -0
  182. package/static/assets/stateDiagram-2N3HPSRC-FX4rJkzV.js +1 -0
  183. package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +1 -0
  184. package/static/assets/swimlanes-5IMT3BWC-Sfy58mmv.js +2 -0
  185. package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +8 -0
  186. package/static/assets/timeline-definition-FHXFAJF6-CmV7by8p.js +120 -0
  187. package/static/assets/vennDiagram-L72KCM5P-FqIyFZFt.js +34 -0
  188. package/static/assets/wardleyDiagram-EHGQE667-BZ06O45i.js +78 -0
  189. package/static/assets/xychartDiagram-FW5EYKEG-BOkffR06.js +7 -0
  190. package/static/index.html +24 -0
@@ -0,0 +1,604 @@
1
+ ---
2
+ name: conductor-feature-prepare
3
+ model: claude-sonnet-4-6
4
+ effort: high
5
+ description: >
6
+ Context artifacts preparation orchestrator — generates all context artifacts (module models,
7
+ HTML mockups, technical specifications, test specifications) by invoking the appropriate
8
+ sub-skills, tracking progress in a PREPARE_MASTER.md file for cross-session resumption.
9
+ Takes an application name (mandatory), with optional version and module filters.
10
+ Version supports single version, comma-separated list, "all", or omit for all versions.
11
+ When multiple versions are resolved, they are processed SEQUENTIALLY in ascending semver
12
+ order — all artifacts for version N are fully generated before version N+1 begins.
13
+ Use this skill when the user asks to "prepare artifacts", "generate context", "prepare for
14
+ development", "generate models and specs", "create mockups and specs", or any request to
15
+ systematically generate all context artifacts from user stories before implementation begins.
16
+ Also trigger when user says "resume preparation" to continue from where a previous session
17
+ left off.
18
+ ---
19
+
20
+ # Feature Conductor — Prepare
21
+
22
+ Context artifacts preparation orchestrator — generates all context artifacts (module models,
23
+ HTML mockups, technical specifications, test specifications) needed before code implementation
24
+ can begin.
25
+
26
+ ## Ralph Loop Integration (AUTO-START — MANDATORY)
27
+
28
+ This skill AUTOMATICALLY starts a Ralph Loop to ensure complete artifact generation across all steps.
29
+ Without Ralph Loop, the preparation may stop prematurely due to context window limits, API
30
+ usage limits, or the agent incorrectly concluding work is "done enough". Ralph Loop ensures
31
+ the same prompt is re-fed after each session exit, and the agent picks up where it left off.
32
+
33
+ ### FIRST ACTION: Start Ralph Loop
34
+
35
+ **BEFORE doing anything else** (before Phase 0, before reading any files), you MUST invoke the
36
+ Ralph Loop skill using the Skill tool. This is a blocking requirement — do NOT proceed with
37
+ any work until Ralph Loop is active.
38
+
39
+ **Invoke this immediately:**
40
+ ```
41
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-prepare <application> [version:<version>] [module:<module>] --completion-promise \"ALL ARTIFACTS GENERATED\" --max-iterations 20")
42
+ ```
43
+
44
+ Replace `<application>` and optional arguments with the actual arguments provided by the user.
45
+
46
+ **Example:** If the user invokes:
47
+ ```
48
+ /conductor-feature-prepare mainapp
49
+ ```
50
+
51
+ Then invoke:
52
+ ```
53
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-prepare mainapp --completion-promise \"ALL ARTIFACTS GENERATED\" --max-iterations 20")
54
+ ```
55
+
56
+ If the user provides optional arguments:
57
+ ```
58
+ /conductor-feature-prepare mainapp version:v2 module:user
59
+ ```
60
+
61
+ Then invoke:
62
+ ```
63
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-prepare mainapp version:v2 module:user --completion-promise \"ALL ARTIFACTS GENERATED\" --max-iterations 20")
64
+ ```
65
+
66
+ After Ralph Loop is active, proceed with Phase 0 (Resume Check) and continue normally.
67
+
68
+ ### How It Works
69
+
70
+ 1. This skill auto-starts a Ralph Loop with the orchestrator prompt as the loop body
71
+ 2. On each iteration, the agent checks which artifacts have already been generated
72
+ 3. The agent generates one or more artifacts until context runs out or all are done
73
+ 4. When the agent tries to exit, the Ralph Loop stop hook re-feeds the same prompt
74
+ 5. The next iteration resumes from where the last one left off
75
+ 6. When ALL artifacts are generated, the agent outputs the completion promise to exit the loop
76
+
77
+ ### Completion Promise
78
+
79
+ When ALL artifacts have been generated (or confirmed to already exist), output the following
80
+ promise tag to signal the Ralph Loop that preparation is finished:
81
+
82
+ ```
83
+ <promise>ALL ARTIFACTS GENERATED</promise>
84
+ ```
85
+
86
+ **CRITICAL**: Only output this promise when EVERY artifact step has completed:
87
+ - User story items tagged
88
+ - Module models generated
89
+ - HTML mockups generated
90
+ - Technical specifications generated
91
+ - Test specifications generated
92
+
93
+ Do NOT output the promise prematurely. Do NOT output it to escape the loop.
94
+
95
+ ### Iteration Awareness
96
+
97
+ At the START of every iteration (including the first), the agent MUST:
98
+ 1. Check if Ralph Loop is already active (if `.claude/ralph-loop.local.md` exists, skip re-invoking)
99
+ 2. Read `<app_folder>/context/prepare/PREPARE_MASTER.md` (the progress source of truth) if it
100
+ exists, to determine which steps and versions are already COMPLETED
101
+ 3. Verify against the `<app_folder>/context/` subfolders that the artifacts the tracker marks
102
+ COMPLETED actually exist (reconcile the tracker if an artifact was deleted)
103
+ 4. Skip steps already marked COMPLETED (unless version increment mode)
104
+ 5. Resume from the first incomplete step
105
+ 6. If the tracker's top-level status is COMPLETED (all steps for all versions done), output the
106
+ completion promise and stop
107
+
108
+ ## Inputs
109
+
110
+ The skill expects these arguments:
111
+
112
+ ```
113
+ /conductor-feature-prepare <application> [version:<version>] [module:<module>]
114
+ ```
115
+
116
+ | Argument | Required | Example | Description |
117
+ |----------|----------|---------|-------------|
118
+ | `<application>` | Yes | `mainapp` | Application name to locate the context folder |
119
+ | `version:<version>` | No | `version:v2` or `version:v1,v2` or `version:all` | Filter user stories and artifacts by version. Supports single version, comma-separated list, `all`, or omit for all versions. Multiple versions are processed sequentially in ascending semver order |
120
+ | `module:<module>` | No | `module:user` | If provided, process only this module. If omitted, process all modules |
121
+
122
+ ### Input Resolution
123
+
124
+ The application name is matched against root-level application folders:
125
+ 1. Strip any leading `<number>_` prefix from folder names (e.g., `1_hub_middleware` → `hub_middleware`)
126
+ 2. Match case-insensitively against the provided application name
127
+ 3. Accept snake_case, kebab-case, or title-case input
128
+ 4. If no match found, list available applications and stop
129
+
130
+ ### Auto-Resolved Paths
131
+
132
+ | File | Resolved Path |
133
+ |------|---------------|
134
+ | PRD.md | `<app_folder>/context/PRD.md` |
135
+ | Module Models | `<app_folder>/context/model/` |
136
+ | HTML Mockups | `<app_folder>/context/mockup/` |
137
+ | Specifications | `<app_folder>/context/specification/` |
138
+ | Test Specs | `<app_folder>/context/test/` |
139
+ | References | `<app_folder>/context/reference/` |
140
+ | Preparation Tracking | `<app_folder>/context/prepare/PREPARE_MASTER.md` |
141
+
142
+ ### Version Resolution
143
+
144
+ The `version:` argument supports four forms:
145
+
146
+ | Form | Example | Behavior |
147
+ |------|---------|----------|
148
+ | Single version | `version:v2` | Process only v2 |
149
+ | Comma-separated list | `version:v1,v2,v3` | Process each version sequentially in ascending semver order |
150
+ | Explicit all | `version:all` | Discover all versions from PRD.md, process sequentially in ascending semver order |
151
+ | Omitted | _(no version arg)_ | Same as `version:all` |
152
+
153
+ #### Version Discovery
154
+
155
+ When `version:all` or omitted:
156
+ 1. Scan PRD.md for all `[vX.Y.Z]` version tags across all module sections
157
+ 2. Collect unique versions
158
+ 3. Sort in ascending semantic version order (v1.0.0 < v1.0.1 < v1.1.0 < v2.0.0)
159
+ 4. This becomes the ordered version list for sequential processing
160
+
161
+ #### Sequential Version Processing Rule
162
+
163
+ **Versions are ALWAYS processed one at a time, in ascending semver order.** All artifacts for
164
+ version N must be fully generated (or confirmed to already exist) before version N+1 begins.
165
+ This ensures:
166
+ - Module models from earlier versions are in place before later version models are layered on
167
+ - Mockups, specifications, and test specs build incrementally on prior version artifacts
168
+ - Each version's artifacts reflect the cumulative state up to that version
169
+
170
+ ## Pre-Requisite: Project Information from CLAUDE.md (MANDATORY)
171
+
172
+ **CLAUDE.md is automatically loaded into context** at the start of every session. It contains
173
+ project details, infrastructure paths, credentials, and configuration. You do NOT need to read
174
+ it manually — the information is already available in your context.
175
+
176
+ ## Redo/Redevelop Guard
177
+
178
+ This guard prevents accidental re-execution of already-completed work while allowing
179
+ incremental processing of new versions. It uses a **partition and filter** approach, driven by
180
+ the `PREPARE_MASTER.md` tracker (the source of truth for what has been prepared).
181
+
182
+ 1. Read `<app_folder>/context/prepare/PREPARE_MASTER.md`. If it does not exist, skip this check
183
+ (nothing has been prepared yet — every resolved version is new).
184
+ 2. Resolve the version list (see Version Resolution).
185
+ 3. **Partition** the resolved versions into two groups, using the tracker's **Version Processing
186
+ Order** table:
187
+ - `completed_versions` — versions whose row is marked `COMPLETED` in PREPARE_MASTER.md
188
+ - `new_versions` — versions with no row, or a row not yet `COMPLETED`
189
+ 4. **Decision**:
190
+
191
+ | `new_versions` | `completed_versions` | Artifacts exist? | Action |
192
+ |---------------|---------------------|-----------------|--------|
193
+ | Not empty | Any (including empty) | Yes (expected — prior versions built them) | **Proceed with `new_versions` only** — filter out completed versions from the processing list. Existing artifacts are the base for version increment. |
194
+ | Not empty | Any | No | **Proceed with all resolved versions** — no prior artifacts, start from scratch. |
195
+ | Empty | Not empty | Yes | **STOP**. Print: `"All requested versions ({list}) for {application} are already marked COMPLETED in <app_folder>/context/prepare/PREPARE_MASTER.md and their context artifacts still exist. To redo, first delete the existing context artifact folders (model/, mockup/, specification/, test/) and PREPARE_MASTER.md, then re-run this skill."` |
196
+ | Empty | Not empty | No | **Proceed with all resolved versions** — artifacts were cleaned up, this is a legitimate redo. |
197
+
198
+ 5. **Update the resolved version list** to contain only the versions that will be processed
199
+ (either `new_versions` or all versions for redo). This filtered list is what the Sequential
200
+ Version Loop in Phase 1 will iterate over.
201
+
202
+ ## Workflow
203
+
204
+ ### Phase 0: Resume Check (Runs Every Ralph Loop Iteration)
205
+
206
+ This phase runs at the START of every iteration, including the first. In a Ralph Loop,
207
+ each iteration begins fresh with the same prompt, so the agent MUST check existing artifacts
208
+ to understand what has already been completed.
209
+
210
+ 0. **Auto-Start Ralph Loop** — Check if `.claude/ralph-loop.local.md` exists. If it does NOT
211
+ exist, Ralph Loop is not yet active. Invoke it NOW using the Skill tool:
212
+ ```
213
+ Skill(skill: "ralph-loop:ralph-loop", args: "<the full /conductor-feature-prepare invocation with args> --completion-promise \"ALL ARTIFACTS GENERATED\" --max-iterations 20")
214
+ ```
215
+ If `.claude/ralph-loop.local.md` already exists, Ralph Loop is active — skip this step.
216
+
217
+ 1. **Use project information from CLAUDE.md (already in context)** — extract database type,
218
+ design system, technology stack, and all infrastructure details.
219
+ 2. **Resolve the version list** using the Version Resolution rules:
220
+ - Single version → `[v2]`
221
+ - Comma-separated → parse and sort ascending by semver → `[v1, v2, v3]`
222
+ - `all` or omitted → scan PRD.md for ALL `[vX.Y.Z]` tags, deduplicate, sort ascending
223
+ 3. Read the progress tracker `<app_folder>/context/prepare/PREPARE_MASTER.md` if it exists:
224
+ - It is the source of truth for which steps/versions are COMPLETED
225
+ - Reconcile it against the artifact folders below (if the tracker says COMPLETED but the
226
+ artifact is missing, reset that entry to PENDING)
227
+ - If it does NOT exist, this is a fresh start — Phase 1 Step 1.1.1 will create it
228
+ Then check which artifacts actually exist on disk:
229
+ - Check `<app_folder>/context/model/` for module model files
230
+ - Check `<app_folder>/context/mockup/` for HTML mockup files
231
+ - Check `<app_folder>/context/specification/` for spec files
232
+ - Check `<app_folder>/context/test/` for test spec files
233
+ 4. If the tracker's top-level status is COMPLETED (all steps for all resolved versions done)
234
+ AND the artifacts still exist:
235
+ - Output `<promise>ALL ARTIFACTS GENERATED</promise>` and stop
236
+ 5. If multiple versions were resolved, proceed to Phase 1 — the version loop will determine
237
+ which versions still need processing (see Phase 1 Sequential Version Loop)
238
+ 6. Otherwise, proceed to Phase 1, starting from the first step not marked COMPLETED in the tracker
239
+
240
+ ### Phase 1: Context Artifacts Generation
241
+
242
+ This phase generates all required context artifacts before code implementation begins. Each step
243
+ checks if the artifact already exists — if it does, the step is skipped. This ensures the phase
244
+ is idempotent and can be resumed safely.
245
+
246
+ **IMPORTANT**: If `module` argument was provided, pass it through to each sub-skill invocation
247
+ so that only the relevant subset of artifacts is generated.
248
+
249
+ #### Sequential Version Loop
250
+
251
+ Steps 1.1, 1.1.1 (tracker init) and 1.2 (tagging) are **once-only setup** — they run a single
252
+ time before the loop. When multiple versions are resolved (list, `all`, or omitted), Phase 1
253
+ wraps the per-version Steps 1.3–1.9 in a **version loop**:
254
+
255
+ ```
256
+ # Once, before the loop: Step 1.1 (resolve folder), Step 1.1.1 (create PREPARE_MASTER.md),
257
+ # Step 1.2 (tag user stories)
258
+
259
+ resolved_versions = [v1.0.0, v1.0.1, v1.0.2] # ascending semver order
260
+
261
+ For each version in resolved_versions:
262
+ 1. Mark this version IN PROGRESS in PREPARE_MASTER.md's Version Processing Order table
263
+ 2. Run Steps 1.3–1.9 with this single version as the version argument
264
+ 3. For the FIRST version: artifacts are generated from scratch (Steps 1.4–1.9)
265
+ 4. For SUBSEQUENT versions: artifacts already exist from the prior version — operate in
266
+ Version Increment Mode (update, not skip)
267
+ 5. All artifacts for this version must be COMPLETED (mark the version COMPLETED in the tracker)
268
+ before moving to the next version
269
+ ```
270
+
271
+ When only a single version is resolved, the loop runs once — no behavioral difference from
272
+ the original single-version flow.
273
+
274
+ #### Version Increment Mode
275
+
276
+ When artifacts exist from a previous version but the current version in the loop has new/changed
277
+ user stories, Steps 1.4–1.9 operate in **update mode**:
278
+
279
+ - **DO NOT skip steps just because artifacts already exist.** The existing artifacts are from a
280
+ previous version and need to be updated with the current version's changes.
281
+ - Re-invoke ALL sub-skills (modelgen, mockgen, specgen, testgen) with BOTH the current `version`
282
+ AND `module` arguments so they can update the existing artifacts incrementally.
283
+ - The sub-skills are responsible for reading the `[v<version>]` sections in PRD.md and
284
+ updating their output files accordingly (appending new fields, modifying existing diagrams,
285
+ updating specs and test scenarios).
286
+
287
+ #### Bug Regression Awareness (Redo/Redevelop Scenario)
288
+
289
+ PRD.md modules may contain a `### Bug` section listing previously fixed bugs (e.g.,
290
+ `[BUG-024] Fixed Message ID link...`). These entries represent validated fixes from prior
291
+ development cycles. When generating or updating artifacts, sub-skills MUST treat bug fix
292
+ entries as supplementary requirements:
293
+
294
+ - **modelgen-***: If a bug fix involved model changes (new fields, changed relationships),
295
+ the model output must reflect the corrected structure.
296
+ - **mockgen-tailwind**: If a bug fix involved UI changes (layout, navigation, styling),
297
+ the mockup must reflect the corrected design.
298
+ - **specgen-***: If a bug fix involved logic changes (event listeners, processing flow,
299
+ validation), the specification must include the corrected behavior.
300
+ - **testgen-functional**: Bug fix descriptions should inform test scenarios to ensure
301
+ regression coverage — each bug fix should have at least one corresponding test assertion.
302
+
303
+ This ensures that when an application is redeveloped from scratch, previously reported bugs
304
+ do not reappear in the new implementation.
305
+
306
+ #### PRD.md Extended Sections Awareness
307
+
308
+ PRD.md may contain three extended sections that influence how downstream skills are invoked
309
+ and what context they receive. Detect each section's presence at the **start of Phase 1** and
310
+ record the result for use throughout the version loop:
311
+
312
+ - **`# Design System`** — Already consumed by Step 1.5 (Infer Design System) for routing
313
+ decisions and resolved-file-path propagation to mockgen-* and specgen-*. No additional action
314
+ needed; Step 1.5 is the canonical handler.
315
+ - **`# Architecture Principle`** — Already consumed by Step 1.3 (Infer Database Type) and
316
+ Step 1.7 (Infer Technology Stack) as the **primary signal** for routing decisions. Sub-skills
317
+ (modelgen-*, specgen-*) read it directly from PRD.md.
318
+ - **`# High Level Process Flow`** — **Detect presence here** so all downstream skills are aware:
319
+ 1. Check PRD.md for a `# High Level Process Flow` section. If present, record:
320
+ - The list of named flows (e.g., "Country submission flow", "Worker registration flow")
321
+ - Any external file references (e.g., `[FLOW_DIAGRAM.md](reference/FLOW_DIAGRAM.md)`)
322
+ - Resolve any referenced file paths relative to PRD.md
323
+ 2. When invoking sub-skills in subsequent steps, pass this awareness as context so each skill
324
+ knows process flows are available and should be consulted:
325
+ - **modelgen-\*** uses flows to identify entities/documents that participate in messaging
326
+ - **specgen-\*** uses flows as the blueprint for service-layer methods, queue topology, and
327
+ message consumer/publisher design
328
+ - **mockgen-\*** uses flows to determine screen-to-screen navigation and async UI states
329
+ - **testgen-functional** uses flows to design end-to-end test scenarios that exercise each
330
+ flow step in order
331
+ 3. If absent, sub-skills fall back to deriving messaging behavior from individual user stories
332
+ (existing behavior).
333
+
334
+ Record the detection result (Design System: yes/no, Architecture Principle: yes/no, Process
335
+ Flow: yes/no + flow names) in your working memory for the duration of the run. This awareness
336
+ does NOT replace each sub-skill's own reading of PRD.md — every sub-skill reads PRD.md directly,
337
+ but knowing which sections are present helps the orchestrator detect missing pre-requisites
338
+ early and surface them to the user.
339
+
340
+ #### Step 1.1: Resolve Application Folder
341
+
342
+ 1. Match the `<application>` argument against root-level folders (same logic as Input Resolution)
343
+ 2. The resolved `<app_folder>` is the root for all context artifacts
344
+ 3. Verify `<app_folder>/context/PRD.md` exists — if not, stop with error
345
+
346
+ #### Step 1.1.1: Initialize Preparation Tracking (PREPARE_MASTER.md)
347
+
348
+ **This step runs ONCE before the version loop starts** (like tagging). It creates the progress
349
+ tracker that this skill — and any resumed Ralph Loop iteration — reads to know what is done.
350
+
351
+ 1. If `<app_folder>/context/prepare/PREPARE_MASTER.md` already exists, read it and reconcile it
352
+ against the resolved version list (add rows for any newly-resolved versions as PENDING). Do
353
+ NOT overwrite existing COMPLETED rows.
354
+ 2. If it does not exist, create `<app_folder>/context/prepare/PREPARE_MASTER.md` with the
355
+ structure below (pre-seed every row as PENDING; the version loop and steps below flip rows to
356
+ COMPLETED / SKIPPED as they run). Add one **Artifact Generation Status** table per resolved
357
+ version.
358
+
359
+ ```markdown
360
+ # Preparation Master - <Application Name>
361
+
362
+ **Started**: <date>
363
+ **Context**: <app_folder>/context
364
+ **Resolved Versions**: <comma-separated sorted version list, e.g., "v1.0.0, v1.0.1, v1.0.2">
365
+ **Status**: IN PROGRESS
366
+
367
+ ---
368
+
369
+ ## Inferred Configuration
370
+
371
+ | Aspect | Value | Source |
372
+ |--------|-------|--------|
373
+ | Database Type | TBD | - |
374
+ | Model Generator | TBD | - |
375
+ | Design System | TBD | - |
376
+ | Mockup Generator | TBD | - |
377
+ | Technology Stack | TBD | - |
378
+ | Spec Generator | TBD | - |
379
+
380
+ > Filled in by the inference steps (1.3, 1.5, 1.7) as the pipeline runs.
381
+
382
+ ---
383
+
384
+ ## User Story Tagging (runs ONCE, applies to all versions)
385
+
386
+ | Step | Skill | Status | Completed |
387
+ |------|-------|--------|-----------|
388
+ | 1.2 Tag items | util-ustagger | PENDING | - |
389
+
390
+ ---
391
+
392
+ ## Version Processing Order
393
+
394
+ | # | Version | Status | Started | Completed |
395
+ |---|---------|--------|---------|-----------|
396
+ | 1 | v1.0.0 | PENDING | - | - |
397
+ | 2 | v1.0.1 | PENDING | - | - |
398
+
399
+ > **Processing Rule**: All artifacts for version N must reach COMPLETED before version N+1 begins.
400
+
401
+ ---
402
+
403
+ ## Artifact Generation Status
404
+
405
+ One table per version. `SKIPPED` = artifact already existed and this is NOT a version increment.
406
+
407
+ ### v1.0.0
408
+
409
+ | Step | Artifact | Skill | Status | Completed |
410
+ |------|----------|-------|--------|-----------|
411
+ | 1.4 | Module Model | modelgen-* | PENDING | - |
412
+ | 1.6 | HTML Mockups | mockgen-* | PENDING | - |
413
+ | 1.8 | Technical Spec | specgen-* | PENDING | - |
414
+ | 1.9 | Test Spec | testgen-functional | PENDING | - |
415
+
416
+ ### v1.0.1
417
+
418
+ <one table per resolved version, same columns>
419
+ ```
420
+
421
+ 3. Statuses used throughout: `PENDING`, `IN PROGRESS`, `COMPLETED`, `SKIPPED`.
422
+
423
+ ##### Tracking Updates (MANDATORY)
424
+
425
+ After each step below completes, update PREPARE_MASTER.md in place — never leave a finished step
426
+ marked PENDING. Use this mapping:
427
+
428
+ | After step | Update in PREPARE_MASTER.md |
429
+ |-----------|------------------------------|
430
+ | 1.2 Tag User Stories | User Story Tagging table → `COMPLETED` + date |
431
+ | 1.3 Infer Database Type | Inferred Configuration → Database Type + Model Generator (with source) |
432
+ | 1.4 Generate Module Model | current version's Artifact table → Module Model = `COMPLETED` (or `SKIPPED`) |
433
+ | 1.5 Infer Design System | Inferred Configuration → Design System + Mockup Generator (with source) |
434
+ | 1.6 Generate HTML Mockups | current version's Artifact table → HTML Mockups = `COMPLETED` (or `SKIPPED`) |
435
+ | 1.7 Infer Technology Stack | Inferred Configuration → Technology Stack + Spec Generator (with source) |
436
+ | 1.8 Generate Technical Spec | current version's Artifact table → Technical Spec = `COMPLETED` (or `SKIPPED`) |
437
+ | 1.9 Generate Test Spec | current version's Artifact table → Test Spec = `COMPLETED` (or `SKIPPED`) |
438
+ | Version's 4 artifacts all done | Version Processing Order → that version = `COMPLETED` + date; then start the next version (mark it `IN PROGRESS`) |
439
+
440
+ At the START of each version iteration, mark that version `IN PROGRESS` in the Version Processing
441
+ Order table. Mark an artifact `SKIPPED` (not `COMPLETED`) when the step is skipped because the
442
+ artifact already existed and this is not a version increment.
443
+
444
+ #### Step 1.2: Tag User Stories
445
+
446
+ Tag all untagged items in PRD.md with unique ID codes before any artifact generation begins.
447
+ This ensures all user stories, NFRs, constraints, and references have stable IDs that downstream
448
+ artifacts (module models, specs, tests) can reference for traceability.
449
+
450
+ **This step runs ONCE before the version loop starts** (not per-version), because tagging
451
+ applies to all items regardless of version.
452
+
453
+ 1. Determine the version label to pass:
454
+ - If processing a single version → use that version (e.g., `v2`)
455
+ - If processing multiple versions → use the HIGHEST version in the resolved list
456
+ - If no `version` argument (all) → use `v1` as the default
457
+ 2. Invoke the tagging skill:
458
+ - `Skill(skill: "co2-skills:util-ustagger", args: "<application> <version>")`
459
+ - Example: `Skill(skill: "co2-skills:util-ustagger", args: "mainapp v1")`
460
+ 3. Wait for the skill to complete. It will tag untagged items in-place in PRD.md.
461
+ 4. This step is idempotent — if all items are already tagged, the skill will report no changes.
462
+
463
+ #### Step 1.3: Infer Database Type
464
+
465
+ 1. **Check PRD.md `# Architecture Principle` section first** (primary signal):
466
+ - If Architecture Principle explicitly mentions "document based database", "document-oriented", "NoSQL", "MongoDB", or similar → **nosql**
467
+ - If Architecture Principle explicitly mentions "relational database", "SQL", "PostgreSQL", "MySQL", or similar → **relational**
468
+ 2. **Fallback to CLAUDE.md** (if Architecture Principle is absent or does not mention database type):
469
+ - Read application details from CLAUDE.md (already in context)
470
+ - Identify the database from the application's dependency list:
471
+ - If the application depends on MySQL, PostgreSQL, or another relational database → **relational**
472
+ - If the application depends on MongoDB or another NoSQL database → **nosql**
473
+ 3. Record the inferred database type for the next step
474
+
475
+ #### Step 1.4: Generate Module Model
476
+
477
+ 1. **Check if artifacts exist**: List files in `<app_folder>/context/model/`
478
+ - If `.md` or `.json` files already exist AND this is NOT a version increment → **SKIP** this step
479
+ - If this IS a version increment, **proceed** to re-invoke the skill with version/module args
480
+ 2. Invoke the appropriate model generation skill:
481
+ - If database type is **relational** → `Skill(skill: "co2-skills:modelgen-relational", args: "<app_folder> [version:<version>] [module:<module>]")`
482
+ - If database type is **nosql** → `Skill(skill: "co2-skills:modelgen-nosql", args: "<app_folder> [version:<version>] [module:<module>]")`
483
+ 3. Wait for the skill to complete. The output will be module model files in `<app_folder>/context/model/`
484
+
485
+ #### Step 1.5: Infer Design System
486
+
487
+ 1. **Check PRD.md `# Design System` section first** (primary signal):
488
+ - If the section exists and references a `DESIGN_SYSTEM.md` file (e.g., `[DESIGN_SYSTEM.md](reference/DESIGN_SYSTEM.md)`), resolve the file path relative to PRD.md
489
+ - Record the resolved design system file path for downstream skills (mockgen, specgen)
490
+ - The referenced file contains design tokens (colors, typography, components) that sub-skills will use
491
+ 2. **Fallback to CLAUDE.md** (if Design System section is absent or has no reference):
492
+ - Read application details from CLAUDE.md (already in context)
493
+ - Identify the design system / CSS framework:
494
+ - Look for mentions of Tailwind CSS, Bootstrap, Material UI, etc.
495
+ - If no design system is explicitly identified → default to **Tailwind CSS**
496
+ 3. Record the inferred design system for the next step
497
+
498
+ #### Step 1.6: Generate HTML Mockups
499
+
500
+ 1. **Check if artifacts exist**: List files in `<app_folder>/context/mockup/`
501
+ - If `.html` files already exist AND this is NOT a version increment → **SKIP** this step
502
+ - If this IS a version increment, **proceed** to re-invoke the skill with version/module args
503
+ 2. Determine the appropriate mockup generator:
504
+ - Check available skills matching `mockgen-*` pattern
505
+ - For Tailwind CSS → `Skill(skill: "co2-skills:mockgen-tailwind", args: "<app_folder> [version:<version>] [module:<module>]")`
506
+ - Default to `mockgen-tailwind` if no specific generator matches the design system
507
+ 3. Wait for the skill to complete. The output will be HTML mockup files in `<app_folder>/context/mockup/`
508
+
509
+ #### Step 1.7: Infer Technology Stack
510
+
511
+ 1. **Check PRD.md `# Architecture Principle` section first** (primary signal):
512
+ - If Architecture Principle explicitly mentions a framework (e.g., "Spring Boot", "Laravel"), use it
513
+ - If it mentions a view engine (e.g., "JTE", "Blade"), use it
514
+ - If it mentions frontend tooling (e.g., "HTMX", "Alpine.js", "Vite"), use it
515
+ - If it mentions architectural style (e.g., "monolithic", "REST API"), use it to disambiguate specgen variant
516
+ 2. **Fallback to CLAUDE.md** (if Architecture Principle is absent or incomplete):
517
+ - Read application details from CLAUDE.md (already in context)
518
+ - Identify the technology stack:
519
+ - Framework (Laravel, Spring Boot, etc.)
520
+ - ORM (Eloquent, JPA/Hibernate, etc.)
521
+ - View engine (Blade, JTE, etc.)
522
+ - Frontend enhancement (HTMX, Alpine.js, etc.)
523
+ 3. Record the inferred technology stack for the next step
524
+
525
+ #### Step 1.8: Generate Technical Specification
526
+
527
+ 1. **Check if artifacts exist**: List files in `<app_folder>/context/specification/`
528
+ - If `.md` files already exist AND this is NOT a version increment → **SKIP** this step
529
+ - If this IS a version increment, **proceed** to re-invoke the skill with version/module args
530
+ 2. Determine the appropriate specification generator:
531
+ - Check available skills matching `specgen-*` pattern
532
+ - For Laravel + Eloquent + Blade + HTMX → `Skill(skill: "co2-skills:specgen-laravel-eloquent-bladehtmx", args: "<app_folder> [version:<version>] [module:<module>]")`
533
+ - For Spring Boot + JPA + JTE + HTMX → `Skill(skill: "co2-skills:specgen-spring-jpa-jtehtmx", args: "<app_folder> [version:<version>] [module:<module>]")`
534
+ - For a self-hosted Node.js web app distributed as a global npm CLI (Hono + embedded React SPA + SQLite) → `Skill(skill: "co2-skills:specgen-node-cli-web", args: "<app_folder> [version:<version>] [module:<module>]")`
535
+ - Match the skill name against the inferred technology stack components
536
+ 3. Wait for the skill to complete. The output will be specification files in `<app_folder>/context/specification/`
537
+
538
+ #### Step 1.9: Generate Test Specification
539
+
540
+ 1. **Check if artifacts exist**: List files in `<app_folder>/context/test/`
541
+ - If `.md` files already exist AND this is NOT a version increment → **SKIP** this step
542
+ - If this IS a version increment, **proceed** to re-invoke the skill with version/module args
543
+ 2. Invoke the test specification generator:
544
+ - `Skill(skill: "co2-skills:testgen-functional", args: "<app_folder> [version:<version>] [module:<module>]")`
545
+ 3. Wait for the skill to complete. The output will be test specification files in `<app_folder>/context/test/`
546
+
547
+ #### Phase 1 Completion
548
+
549
+ After all artifacts for ALL versions in the resolved version list are generated (or confirmed
550
+ to already exist):
551
+ 1. Set the top-level `**Status**:` in `<app_folder>/context/prepare/PREPARE_MASTER.md` to
552
+ `COMPLETED`, and verify every step and every version row is `COMPLETED` or `SKIPPED` (no
553
+ `PENDING` / `IN PROGRESS` rows remain)
554
+ 2. Output a summary of what was generated/skipped per version (sourced from PREPARE_MASTER.md)
555
+ 3. Output `<promise>ALL ARTIFACTS GENERATED</promise>` to signal Ralph Loop completion
556
+
557
+ **IMPORTANT — Version loop completion**: The completion promise is ONLY output after the LAST
558
+ version in the resolved list has been fully processed. Do NOT output it after completing an
559
+ intermediate version — proceed to the next version immediately.
560
+
561
+ ## Critical Rules
562
+
563
+ 1. **CLAUDE.md is the source of truth** — CLAUDE.md is automatically loaded into context. Use
564
+ it for all project details, database types, technology stacks, and infrastructure configuration.
565
+
566
+ 2. **Idempotent execution** — Each step checks if artifacts already exist before generating.
567
+ This ensures the skill can be safely re-run or resumed without duplicating work.
568
+
569
+ 3. **Version increment awareness** — When processing multiple versions sequentially, artifacts
570
+ from the prior version already exist when the next version begins. ALL sub-skills must be
571
+ re-invoked in update mode for each subsequent version.
572
+
573
+ 4. **Pass through filters** — The current version from the version loop AND the `module`
574
+ argument (if provided) MUST be passed to every sub-skill invocation. Each sub-skill
575
+ receives a SINGLE version at a time, never a list.
576
+
577
+ 5. **Sequential version order** — When multiple versions are resolved, they are processed
578
+ in ascending semver order. All artifacts for version N must complete before version N+1
579
+ begins. Never process versions in parallel or merge them into a single invocation.
580
+
581
+ 6. **Context window awareness (Ralph Loop handles recovery)** — If approaching context limits,
582
+ the Ralph Loop will automatically re-feed the prompt, and the next iteration will resume
583
+ from the first step with missing artifacts.
584
+
585
+ 7. **Auto-start Ralph Loop** — When this skill is triggered, the FIRST action (Phase 0, Step 0)
586
+ MUST be to check if Ralph Loop is active (`.claude/ralph-loop.local.md` exists). If not active,
587
+ invoke the Ralph Loop skill. Do NOT proceed with any work until Ralph Loop is confirmed active.
588
+
589
+ 8. **AUTONOMOUS CONTINUATION — NEVER STOP BETWEEN STEPS OR VERSIONS.** This is an orchestrator
590
+ skill that runs a multi-step pipeline (Steps 1.1 through 1.9) across potentially multiple
591
+ versions. When a sub-skill (e.g., util-ustagger, modelgen-relational, mockgen-tailwind,
592
+ specgen-*, testgen-functional) completes and returns control, you MUST immediately proceed
593
+ to the NEXT step in the pipeline. When all steps for the current version are done, you MUST
594
+ immediately proceed to the NEXT version. Do NOT stop, do NOT wait for user input, do NOT
595
+ treat a sub-skill or version completion as the end of your task. The task is only complete
596
+ when ALL steps for ALL versions have been executed and the completion promise
597
+ `<promise>ALL ARTIFACTS GENERATED</promise>` has been output. **Stopping after any
598
+ intermediate step or version is a bug in execution.**
599
+
600
+ 9. **PREPARE_MASTER.md is the progress source of truth** — Every step updates
601
+ `<app_folder>/context/prepare/PREPARE_MASTER.md` per the Tracking Updates table in Step 1.1.1.
602
+ On resume (any Ralph Loop iteration), read it FIRST to determine what is already done; do NOT
603
+ re-run steps it marks COMPLETED (unless in version increment mode). Reconcile it against the
604
+ artifact folders on disk if they disagree.