@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,1383 @@
1
+ ---
2
+ name: conductor-feature-develop
3
+ model: claude-sonnet-4-6
4
+ effort: high
5
+ description: >
6
+ Application development orchestrator — orchestrates full-stack code implementation
7
+ module-by-module (code + Playwright E2E tests), tracking progress in IMPLEMENTATION_MASTER.md
8
+ and per-module IMPLEMENTATION_MODULE.md. Takes an application name (mandatory), with optional
9
+ source code path, version and module filters. Version supports single version, comma-separated
10
+ list, "all", or omit for all versions. When multiple versions are resolved, they are processed
11
+ SEQUENTIALLY in ascending semver order — all modules for version N are fully implemented before
12
+ version N+1 begins. Requires context artifacts (module models, HTML mockups, technical
13
+ specifications, test specifications) to already exist — use "conductor-feature-prepare" first
14
+ if they don't. Use this skill when the user asks to "implement the application", "start
15
+ development", "build the app module by module", "orchestrate implementation", "develop from
16
+ specs", "implement from test specs", or any request to systematically develop a full application
17
+ from existing specs. Also trigger when user says "resume implementation" to continue from where
18
+ a previous session left off using IMPLEMENTATION_MASTER.md and IMPLEMENTATION_MODULE.md
19
+ progress files.
20
+ ---
21
+
22
+ # Feature Conductor — Develop
23
+
24
+ Application development orchestrator — implements full-stack code module-by-module, driven by
25
+ test specs and tracked via implementation checklists. Requires context artifacts to already
26
+ exist (use `conductor-feature-prepare` first).
27
+
28
+ ## Ralph Loop Integration (AUTO-START — MANDATORY)
29
+
30
+ This skill AUTOMATICALLY starts a Ralph Loop to ensure complete implementation across all modules.
31
+ Without Ralph Loop, the implementation may stop prematurely due to context window limits, API
32
+ usage limits, or the agent incorrectly concluding work is "done enough". Ralph Loop ensures
33
+ the same prompt is re-fed after each session exit, and the agent picks up where it left off
34
+ using the IMPLEMENTATION_MASTER.md and IMPLEMENTATION_MODULE.md tracking files.
35
+
36
+ ### FIRST ACTION: Start Ralph Loop
37
+
38
+ **BEFORE doing anything else** (before Phase 0, before reading any files), you MUST invoke the
39
+ Ralph Loop skill using the Skill tool. This is a blocking requirement — do NOT proceed with
40
+ any implementation work until Ralph Loop is active.
41
+
42
+ **Invoke this immediately:**
43
+ ```
44
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-develop <application> [source:<source-code-path>] [version:<version>] [module:<module>] --completion-promise \"ALL MODULES IMPLEMENTED\" --max-iterations 100")
45
+ ```
46
+
47
+ Replace `<application>` and optional arguments with the actual arguments provided by the user.
48
+
49
+ **Example:** If the user invokes:
50
+ ```
51
+ /conductor-feature-develop mainapp
52
+ ```
53
+
54
+ Then invoke:
55
+ ```
56
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-develop mainapp --completion-promise \"ALL MODULES IMPLEMENTED\" --max-iterations 100")
57
+ ```
58
+
59
+ If the user provides optional arguments:
60
+ ```
61
+ /conductor-feature-develop mainapp version:v2 module:user
62
+ ```
63
+
64
+ Then invoke:
65
+ ```
66
+ Skill(skill: "ralph-loop:ralph-loop", args: "/conductor-feature-develop mainapp version:v2 module:user --completion-promise \"ALL MODULES IMPLEMENTED\" --max-iterations 100")
67
+ ```
68
+
69
+ After Ralph Loop is active, proceed with Phase 0 (Resume Check) and continue normally.
70
+
71
+ ### How It Works
72
+
73
+ 1. This skill auto-starts a Ralph Loop with the orchestrator prompt as the loop body
74
+ 2. On each iteration, the agent reads IMPLEMENTATION_MASTER.md to find the next pending module
75
+ 3. The agent implements one or more modules until context runs out or a module completes
76
+ 4. When the agent tries to exit, the Ralph Loop stop hook re-feeds the same prompt
77
+ 5. The next iteration resumes from where the last one left off (tracked in IMPLEMENTATION_MASTER.md)
78
+ 6. When ALL modules are COMPLETED, the agent outputs the completion promise to exit the loop
79
+
80
+ ### Completion Promise
81
+
82
+ When ALL modules in IMPLEMENTATION_MASTER.md have status `COMPLETED`, output the following
83
+ promise tag to signal the Ralph Loop that implementation is finished:
84
+
85
+ ```
86
+ <promise>ALL MODULES IMPLEMENTED</promise>
87
+ ```
88
+
89
+ **CRITICAL**: Only output this promise when EVERY module in the execution order has:
90
+ - Status = COMPLETED in IMPLEMENTATION_MASTER.md
91
+ - All E2E tests passing
92
+ - IMPLEMENTATION_MODULE.md fully updated
93
+
94
+ Do NOT output the promise prematurely. Do NOT output it to escape the loop. The Ralph Loop
95
+ will verify this tag and only exit when it is present.
96
+
97
+ ### Iteration Awareness
98
+
99
+ At the START of every iteration (including the first), the agent MUST:
100
+ 1. Check if Ralph Loop is already active (if `.claude/ralph-loop.local.md` exists, skip re-invoking)
101
+ 2. Read IMPLEMENTATION_MASTER.md to determine what is already completed
102
+ 3. Find the FIRST module with status != COMPLETED
103
+ 4. If that module has an IMPLEMENTATION_MODULE.md, read it to find the last incomplete step
104
+ 5. Resume from exactly that point — do NOT re-implement completed work
105
+ 6. If ALL modules are COMPLETED, output the completion promise and stop
106
+
107
+ ### Never Stop Prematurely
108
+
109
+ Within a Ralph Loop iteration, the agent MUST:
110
+ - Continue implementing modules sequentially until context limits force a stop
111
+ - After completing one module, IMMEDIATELY start the next pending module
112
+ - Do NOT stop after a single module "to let the user review" — Ralph Loop handles iteration
113
+ - Do NOT output the completion promise until ALL modules are verified complete
114
+ - If approaching context limits mid-module, save progress to IMPLEMENTATION_MODULE.md so the
115
+ next iteration can resume from the exact step
116
+
117
+ ## Inputs
118
+
119
+ The skill expects these arguments:
120
+
121
+ ```
122
+ /conductor-feature-develop <application> [source:<source-code-path>] [version:<version>] [module:<module>]
123
+ ```
124
+
125
+ | Argument | Required | Example | Description |
126
+ |----------|----------|---------|-------------|
127
+ | `<application>` | Yes | `mainapp` | Application name to locate the context folder |
128
+ | `source:<path>` | No | `source:mainapp` | Path where source code resides. Defaults to `<app_folder>` (same as the resolved application folder) |
129
+ | `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 |
130
+ | `module:<module>` | No | `module:user` | If provided, process only this module. If omitted, process all modules |
131
+
132
+ ### Input Resolution
133
+
134
+ The application name is matched against root-level application folders:
135
+ 1. Strip any leading `<number>_` prefix from folder names (e.g., `1_hub_middleware` → `hub_middleware`)
136
+ 2. Match case-insensitively against the provided application name
137
+ 3. Accept snake_case, kebab-case, or title-case input
138
+ 4. If no match found, list available applications and stop
139
+
140
+ ### Auto-Resolved Paths
141
+
142
+ | File | Resolved Path |
143
+ |------|---------------|
144
+ | PRD.md | `<app_folder>/context/PRD.md` |
145
+ | Module Models | `<app_folder>/context/model/` |
146
+ | HTML Mockups | `<app_folder>/context/mockup/` |
147
+ | Specifications | `<app_folder>/context/specification/` |
148
+ | Test Specs | `<app_folder>/context/test/` |
149
+ | References | `<app_folder>/context/reference/` |
150
+ | Development Output | `<app_folder>/context/develop/` |
151
+
152
+ ### Version Resolution
153
+
154
+ The `version:` argument supports four forms:
155
+
156
+ | Form | Example | Behavior |
157
+ |------|---------|----------|
158
+ | Single version | `version:v2` | Process only v2 |
159
+ | Comma-separated list | `version:v1,v2,v3` | Process each version sequentially in ascending semver order |
160
+ | Explicit all | `version:all` | Discover all versions from PRD.md, process sequentially in ascending semver order |
161
+ | Omitted | _(no version arg)_ | Same as `version:all` |
162
+
163
+ #### Version Discovery
164
+
165
+ When `version:all` or omitted:
166
+ 1. Scan PRD.md for all `[vX.Y.Z]` version tags across all module sections
167
+ 2. Collect unique versions
168
+ 3. Sort in ascending semantic version order (v1.0.0 < v1.0.1 < v1.1.0 < v2.0.0)
169
+ 4. This becomes the ordered version list for sequential processing
170
+
171
+ #### Sequential Version Processing Rule
172
+
173
+ **Versions are ALWAYS processed one at a time, in ascending semver order.** All modules for
174
+ version N must be fully implemented (status `COMPLETED`) before version N+1 begins. This ensures:
175
+ - The application is scaffolded and fully functional at version N before N+1 changes are layered on
176
+ - Feature implementations build incrementally on prior version work
177
+ - E2E tests validate each version's functionality before the next version modifies the codebase
178
+
179
+ #### How It Works with Multiple Versions
180
+
181
+ 1. **First version** (e.g., v1.0.0): Full implementation — scaffolding (Phase 2) + all modules (Phase 3)
182
+ 2. **Each subsequent version** (e.g., v1.0.1, v1.0.2): Version increment — reset affected modules
183
+ to PENDING, update the application version, then re-implement only modules with changes for
184
+ that version. The existing "Version Increment" logic in Phase 0 handles this naturally.
185
+ 3. **README** (Phase 5): Generated ONCE after the LAST version in the list is fully
186
+ implemented
187
+
188
+ ### Application Folder Structure (Expected)
189
+
190
+ Source code and context artifacts coexist in the same `<app_folder>`. The `context/` subfolder
191
+ holds all generated artifacts (models, mockups, specs, tests, tracking). All other files and
192
+ folders at the root of `<app_folder>` are **source code** (e.g., `app/`, `Modules/`, `resources/`,
193
+ `composer.json`, `pom.xml`, `src/`, etc.).
194
+
195
+ **CRITICAL**: When scaffolding a new project (e.g., `composer create-project`, `mvn archetype:generate`),
196
+ the source code MUST be placed directly in `<source-code-path>/` — NOT in a nested subdirectory.
197
+ For example, with `composer create-project laravel/laravel`, you must either:
198
+ - Create in a temp directory and move all files (including dotfiles) up to `<source-code-path>/`, OR
199
+ - Use a technique that installs directly into the existing directory
200
+
201
+ The `context/` folder already exists in `<app_folder>` and must NOT be overwritten or deleted.
202
+
203
+ ```
204
+ <app_folder>/ # = <source-code-path> (by default)
205
+ context/ # Context artifacts (NOT source code)
206
+ PRD.md
207
+ model/
208
+ MODEL.md
209
+ <module-slug>/
210
+ model.md
211
+ schemas.json
212
+ document-model.mermaid
213
+ mockup/
214
+ MOCKUP.html
215
+ mockup-manifest.json
216
+ <role>/content/
217
+ specification/
218
+ SPECIFICATION.md
219
+ <module-slug>/SPEC.md
220
+ test/
221
+ TEST_PLAN.md
222
+ <module-slug>/TEST_SPEC.md
223
+ reference/
224
+ develop/ # Implementation tracking files
225
+ (source code files) # All other files are source code
226
+ app/ # Laravel: app directory
227
+ Modules/ # Laravel: nwidart modules
228
+ resources/ # Laravel: views, CSS, JS
229
+ routes/ # Laravel: route files
230
+ config/ # Laravel: config files
231
+ composer.json # Laravel: PHP dependencies
232
+ package.json # Laravel: JS dependencies
233
+ ... # (or src/, pom.xml for Spring Boot, etc.)
234
+ ```
235
+
236
+ ## Pre-Requisite: Project Information from CLAUDE.md (MANDATORY)
237
+
238
+ **CLAUDE.md is automatically loaded into context** at the start of every session. It contains
239
+ project details, infrastructure paths, credentials, and configuration. You do NOT need to read
240
+ it manually — the information is already available in your context.
241
+
242
+ **Before executing ANY tool command** (Maven build, Spring Boot run, database CLI, Keycloak CLI,
243
+ Playwright test, npm start, etc.), use the following from CLAUDE.md (already in context):
244
+
245
+ - **JDK path** — Use the exact `JAVA_HOME` path specified in CLAUDE.md
246
+ - **Maven path** — Use the exact Maven binary path specified in CLAUDE.md
247
+ - **Database credentials** — Host, port, username, password for MongoDB, MySQL, etc.
248
+ - **Message queue credentials** — RabbitMQ host, port, username, password
249
+ - **Keycloak configuration** — Host, admin credentials, CLI path
250
+ - **Mailcatcher configuration** — SMTP host/port, web UI URL
251
+ - **Any other infrastructure details** — Ports, URLs, connection strings
252
+
253
+ **WHY**: CLAUDE.md contains the actual system paths, credentials, and configuration for the
254
+ developer's machine. Hardcoding or guessing these values will cause commands to fail. Every shell
255
+ command that involves JDK, Maven, database access, or any external service MUST use the values
256
+ from CLAUDE.md.
257
+
258
+ ## PRD.md Extended Sections
259
+
260
+ During implementation, check PRD.md for the following extended sections and use them as high-level context:
261
+
262
+ ### Design System
263
+
264
+ If PRD.md contains a `# Design System` section, read it and any file it references (e.g., `[DESIGN_SYSTEM.md](reference/DESIGN_SYSTEM.md)`) before implementing **any UI module** (Blade views, JTE templates, React components, etc.). Treat the design system as the **authoritative source** for code-level styling:
265
+
266
+ - **Color tokens, typography, spacing, radii, shadows** — apply directly in Tailwind config, CSS variables, or MUI theme. Do not invent new values.
267
+ - **Component patterns** — buttons, forms, tables, dialogs, alerts must match the design system's visual rules and accessibility behavior.
268
+ - **Branding** — logos, favicons, and brand voice must be applied consistently across all rendered views.
269
+ - **Accessibility rules** — WCAG level, contrast ratios, focus states, keyboard navigation requirements declared in the design system are non-negotiable.
270
+
271
+ **Conflict resolution**: If `SPECIFICATION.md`'s "Design System Integration" subsection contradicts the PRD.md design system file (e.g., different color values, different component variants), the **PRD.md design system file wins**. Flag the discrepancy for human review and proceed with the design system file.
272
+
273
+ If absent, fall back to `SPECIFICATION.md`'s design system guidance and CLAUDE.md's CSS framework declaration (existing behavior).
274
+
275
+ ### Architecture Principle
276
+
277
+ If PRD.md contains an `# Architecture Principle` section, read it and use as implementation constraints:
278
+ - **Stateless**: Ensure no module implementation stores data in HTTP session — user context must come from JWT tokens or external identity providers
279
+ - **Event-driven**: Ensure inter-module communication uses event publishing (e.g., Spring ApplicationEvent, Laravel Event) rather than direct service injection across module boundaries
280
+ - **Message driven**: When implementing message consumers/publishers, follow the patterns described in the architecture (e.g., dedicated queues per country, independent queue configurations)
281
+ - **Monolithic with modular architecture**: Modules can share the same database but should not directly access each other's repositories — use events or service interfaces
282
+
283
+ If absent, rely on SPECIFICATION.md for architectural guidance (existing behavior).
284
+
285
+ ### High Level Process Flow
286
+
287
+ If PRD.md contains a `# High Level Process Flow` section, use it as the **implementation blueprint** for message-driven modules:
288
+ 1. Implement flow steps in order: (1) message consumer, (2) validation logic, (3) data persistence, (4) ACK/NACK publishing
289
+ 2. Each flow step maps to a specific method in the service layer
290
+ 3. Treat flow steps as mini-specifications within each module's implementation
291
+ 4. After implementing all steps of a flow, verify the complete end-to-end flow works before moving to the next module
292
+
293
+ If absent, implement from SPECIFICATION.md messaging sections only (existing behavior).
294
+
295
+ ---
296
+
297
+ ## Pre-Requisite: Context Artifacts Must Exist
298
+
299
+ Before starting implementation, verify that all required context artifacts exist:
300
+ - `<app_folder>/context/model/` — must contain module model files
301
+ - `<app_folder>/context/mockup/` — must contain HTML mockup files
302
+ - `<app_folder>/context/specification/` — must contain specification files
303
+ - `<app_folder>/context/test/` — must contain test specification files
304
+
305
+ If any artifacts are missing, **stop and inform the user** to run `/conductor-feature-prepare`
306
+ first. Do NOT attempt to generate artifacts — that is the responsibility of the prepare skill.
307
+
308
+ ## Version Gate
309
+
310
+ Before starting any work, check `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`):
311
+
312
+ 1. If `<app_folder>/CHANGELOG.md` does not exist, skip this check (first-ever execution for this application).
313
+ 2. If `<app_folder>/CHANGELOG.md` exists, scan all `## vX.Y.Z` headings and determine the **highest version** using semantic versioning comparison.
314
+ 3. Apply the gate based on the version argument form:
315
+ - **Single version**: If requested version **<** highest version → **STOP immediately**. Print: `"Version {requested} is lower than the current application version {highest} recorded in <app_folder>/CHANGELOG.md. Execution rejected."`
316
+ - **Comma-separated list**: Check the **lowest** version in the list. If lowest **<** highest version → **STOP immediately**. Print: `"Version {lowest} in the provided list is lower than the current application version {highest} recorded in <app_folder>/CHANGELOG.md. Execution rejected."`
317
+ - **`version:all` or omitted**: Skip this check — when processing all discovered versions, historical versions are expected.
318
+
319
+ ### Redo/Redevelop Guard
320
+
321
+ This guard prevents accidental re-execution of already-completed work while allowing
322
+ incremental processing of new versions. It uses a **partition and filter** approach.
323
+
324
+ 1. Resolve the version list (see Version Resolution).
325
+ 2. **Partition** the resolved versions into two groups:
326
+ - `completed_versions` — versions that have a matching `conductor-feature-develop` entry
327
+ in `<app_folder>/CHANGELOG.md`
328
+ - `new_versions` — versions with NO matching entry
329
+ 3. **Decision**:
330
+
331
+ | `new_versions` | `completed_versions` | Artifacts/code exist? | Action |
332
+ |---------------|---------------------|----------------------|--------|
333
+ | Not empty | Any (including empty) | Yes (expected — prior versions built them) | **Proceed with `new_versions` only** — filter out completed versions. Existing code is the base for version increment. |
334
+ | Not empty | Any | No | **Proceed with all resolved versions** — no prior code, start from scratch. |
335
+ | Empty | Not empty | Yes | **STOP**. Print: `"All requested versions ({list}) for {application} were already developed (recorded in <app_folder>/CHANGELOG.md) and artifacts/code still exist. To redo, first delete the existing IMPLEMENTATION_MASTER.md and source code, then re-run this skill."` |
336
+ | Empty | Not empty | No | **Proceed with all resolved versions** — code was cleaned up, this is a legitimate redo. |
337
+
338
+ **Artifacts/code exist check**: `<app_folder>/context/develop/IMPLEMENTATION_MASTER.md`
339
+ exists, OR source code files exist in `<app_folder>/` (e.g., `pom.xml`, `composer.json`,
340
+ `package.json`, or `src/` directory).
341
+
342
+ 4. **Update the resolved version list** to contain only the versions that will be processed
343
+ (either `new_versions` or all versions for redo). This filtered list is what the Version
344
+ Processing Order table and the sequential version loop will use.
345
+
346
+ ## Workflow
347
+
348
+ ### Phase 0: Resume Check (Runs Every Ralph Loop Iteration)
349
+
350
+ This phase runs at the START of every iteration, including the first. In a Ralph Loop,
351
+ each iteration begins fresh with the same prompt, so the agent MUST read the tracking
352
+ files to understand what has already been completed.
353
+
354
+ 0. **Auto-Start Ralph Loop** — Check if `.claude/ralph-loop.local.md` exists. If it does NOT
355
+ exist, Ralph Loop is not yet active. Invoke it NOW using the Skill tool:
356
+ ```
357
+ Skill(skill: "ralph-loop:ralph-loop", args: "<the full /conductor-feature-develop invocation with args> --completion-promise \"ALL MODULES IMPLEMENTED\" --max-iterations 100")
358
+ ```
359
+ If `.claude/ralph-loop.local.md` already exists, Ralph Loop is active — skip this step.
360
+
361
+ 1. **Use project information from CLAUDE.md (already in context)** — extract JDK path, Maven path, database credentials,
362
+ message queue credentials, Keycloak config, and all infrastructure details. These values
363
+ are required for every subsequent tool command in this session.
364
+ 2. **Verify context artifacts exist** — Check that model/, mockup/, specification/, and test/
365
+ folders contain the required files. If missing, stop and inform user to run
366
+ `/conductor-feature-prepare` first.
367
+ 3. Check if `<app_folder>/context/develop/IMPLEMENTATION_MASTER.md` exists
368
+ 4. If it exists, read it and determine the current state:
369
+ - Scan the Module Implementation Status table for the FIRST module with status != COMPLETED
370
+ - If ALL modules are COMPLETED:
371
+ - **Sequential version loop check**: Resolve the version list (see Version Resolution).
372
+ Read the **Version Processing Order** table in IMPLEMENTATION_MASTER.md (if it exists)
373
+ to determine which versions have been completed.
374
+ - Find the FIRST version in the resolved list that is NOT yet tracked or NOT `COMPLETED`
375
+ in the Version Processing Order table.
376
+ - If such a version exists, this is the **next version to process** — perform the
377
+ version increment steps below and proceed to Phase 3.
378
+ - If ALL versions in the resolved list are `COMPLETED`, proceed to the README check below.
379
+ - **Version increment** — For each new version to process:
380
+ 1. Update IMPLEMENTATION_MASTER.md: add the new version to the Version Processing Order
381
+ table, reset affected modules to PENDING status.
382
+ 2. **Update the application version** in the project manifest and configuration:
383
+ - **Spring Boot**: Update `<version>` in `pom.xml` and `APP_VERSION` in `.env`
384
+ - **Laravel**: Update `version` in `composer.json` and `APP_VERSION` in `.env`
385
+ - **React / Node.js**: Update `version` in `package.json` and `VITE_APP_VERSION`
386
+ in `.env.development` (or `APP_VERSION` in `.env` for Node.js backends)
387
+ - **application.yml / config files**: If `app.version` has a hardcoded default in
388
+ `application.yml` (e.g., `${APP_VERSION:1.0.0}`), update the default to the new
389
+ version (e.g., `${APP_VERSION:1.0.4}`)
390
+ - **config/app.php** (Laravel): Update the default in `env('APP_VERSION', '1.0.0')`
391
+ to the new version
392
+ The version displayed in the application footer (or API info endpoint) MUST reflect
393
+ the new version after this update.
394
+ 3. Proceed to Phase 3 (Implementation) for the affected modules.
395
+ - **README check**: If the top-level `**Status**:` in IMPLEMENTATION_MASTER.md is NOT
396
+ yet `COMPLETED`, proceed to Phase 5 (Generate README.md) — all modules are done but
397
+ README hasn't been generated and tracking hasn't been finalized yet.
398
+ - If ALL versions are completed AND top-level status is already
399
+ `COMPLETED` → output `<promise>ALL MODULES IMPLEMENTED</promise>` and stop
400
+ - Otherwise, read its `IMPLEMENTATION_MODULE.md` for detailed progress
401
+ - Resume from the last incomplete step in the checklist
402
+ 5. If it does not exist, proceed to Phase 1 (Planning — fresh start)
403
+
404
+ ### Phase 1: Planning
405
+
406
+ 1. **Use project information from CLAUDE.md (already in context)** — extract all paths, credentials,
407
+ and infrastructure configuration. This is the single source of truth for JDK, Maven, database,
408
+ message queue, Keycloak, and all other tool configurations.
409
+ 2. Read `<app_folder>/context/test/TEST_PLAN.md`
410
+ 3. Extract the **Execution Order** (Section 5) and **Layer Classification** (Section 4)
411
+ 4. The execution order defines the module sequence — use it as-is
412
+ 5. Read `<app_folder>/context/specification/SPECIFICATION.md` for shared infrastructure context
413
+
414
+ Create `<app_folder>/context/develop/IMPLEMENTATION_MASTER.md` with this structure:
415
+
416
+ ```markdown
417
+ # Implementation Master - <Application Name>
418
+
419
+ **Started**: <date>
420
+ **Source Code**: <source-code-path>
421
+ **Context**: <app_folder>/context
422
+ **Resolved Versions**: <comma-separated sorted version list, e.g., "v1.0.0, v1.0.1, v1.0.2">
423
+ **Status**: IN PROGRESS
424
+
425
+ ---
426
+
427
+ ## Version Processing Order
428
+
429
+ | # | Version | Module Count | Status | Started | Completed |
430
+ |---|---------|-------------|--------|---------|-----------|
431
+ | 1 | v1.0.0 | 12 | NEW | - | - |
432
+ | 2 | v1.0.1 | 3 | NEW | - | - |
433
+ | 3 | v1.0.2 | 1 | NEW | - | - |
434
+
435
+ > **Processing Rule**: All modules for version N must reach COMPLETED before version N+1 begins.
436
+ > **First version**: full scaffolding + all modules. **Subsequent versions**: version increment — only modules with changes.
437
+
438
+ ---
439
+
440
+ ## Execution Order
441
+
442
+ <Copy the execution order tree from TEST_PLAN.md>
443
+
444
+ ---
445
+
446
+ ## Module Implementation Status
447
+
448
+ | # | Module | Layer | Version | Status | Started | Completed | Notes |
449
+ |---|--------|-------|---------|--------|---------|-----------|-------|
450
+ | 1 | User | L1 | v1.0.0 | PENDING | - | - | |
451
+ | 2 | Location Information | L2 | v1.0.0 | PENDING | - | - | |
452
+ ...
453
+
454
+ > The **Version** column tracks which version is currently being implemented for that module.
455
+ > When a version increment occurs, affected modules are reset to PENDING with the new version.
456
+
457
+ ---
458
+
459
+ ## Module Details
460
+
461
+ ### 1. User
462
+
463
+ **Resources**:
464
+ - User Story: <list relevant story IDs>
465
+ - Model: `model/user/model.md`
466
+ - Specification: `specification/user/SPEC.md`
467
+ - Test Spec: `test/user/TEST_SPEC.md`
468
+ - Mockup: `mockup/<role>/content/<screen>.html`
469
+
470
+ **Dependencies**: None
471
+
472
+ ---
473
+
474
+ ### 2. Location Information
475
+ ...
476
+ ```
477
+
478
+ **IMPORTANT — Single version shortcut**: When only a single version is resolved, the Version
479
+ Processing Order table has a single row. The behavior is identical to the original single-version
480
+ flow — no extra complexity.
481
+
482
+ **IMPORTANT — Module Count per version**: For the FIRST version, Module Count = total modules
483
+ (full implementation). For subsequent versions, Module Count = only modules that have new/changed
484
+ user stories for that version.
485
+
486
+ ### Phase 2: Pre-Implementation (Scaffolding)
487
+
488
+ Read the SPECIFICATION.md shared infrastructure sections and scaffold the project.
489
+
490
+ **CRITICAL — Source Code Placement Rule:**
491
+ All source code MUST be placed directly in `<source-code-path>/` (which defaults to `<app_folder>/`).
492
+ The `context/` folder already exists there and must be preserved. When using project creation tools
493
+ like `composer create-project` or `mvn archetype:generate`, ensure you do NOT create a nested
494
+ subdirectory. Instead:
495
+ - For Laravel: Create the project in a temporary directory (e.g., `<source-code-path>/_temp_scaffold`),
496
+ then move ALL files (including dotfiles) from that temp directory up to `<source-code-path>/`,
497
+ then remove the empty temp directory. This avoids overwriting the existing `context/` folder.
498
+ - For Spring Boot: Same approach — scaffold into a temp dir, then move files up.
499
+ - NEVER use the project slug/name as the target directory if it would create a nested folder.
500
+
501
+ **Scaffolding Checklist** (adapt to the technology stack from SPECIFICATION.md):
502
+
503
+ 1. **Project structure**: Create the project skeleton directly in `<source-code-path>/`
504
+ 2. **Build & dependency configuration**: composer.json / pom.xml / build.gradle with all dependencies
505
+ 3. **Application version**: Set the application version in the project manifest using the
506
+ FIRST version in the resolved version list (the version currently being implemented).
507
+ If no version argument was provided (all versions), use the first discovered version.
508
+ If no versions exist at all, use `1.0.0`.
509
+ - **Spring Boot**: Set `<version>` in `pom.xml` (e.g., `<version>1.0.0</version>`) and
510
+ `APP_VERSION` in `.env`
511
+ - **Laravel**: Set `version` in `composer.json` and `APP_VERSION` in `.env`
512
+ - **React / Node.js**: Set `version` in `package.json` and `VITE_APP_VERSION` in
513
+ `.env.development` (or `APP_VERSION` in `.env` for Node.js backends)
514
+ - The version in the manifest MUST match the version in the environment variable
515
+ - For multi-version processing, this version will be updated during each version increment
516
+ in the Phase 0 resume check
517
+ 4. **Application configuration**: .env, config files, or application.yml as appropriate
518
+ 4. **Security configuration**: Keycloak/OAuth2 or other auth provider setup
519
+ 5. **Shared layouts**: Blade / JTE / other template layout files (header, footer, sidebar)
520
+ 6. **Shared components**: UI components (Tailwind), JS structure, CSS
521
+ 7. **Data access layer**: Base repository / model configuration
522
+ 8. **Error handling**: Global exception handlers
523
+ 9. **Theming**: Theme configuration from spec
524
+ 10. **Pagination**: Shared pagination support
525
+ 11. **Messaging**: Message queue configuration if applicable
526
+ 12. **Scheduling**: Scheduled task configuration if applicable
527
+ 13. **Playwright test project**: Initialize Playwright in `<source-code-path>/e2e/` with:
528
+ - `package.json` with Playwright and `dotenv` dependencies
529
+ - `playwright.config.ts` with base URL read from `process.env.TEST_APP_BASE_URL`
530
+ (loaded via `dotenv` at the top of the config)
531
+ - `.env.example` — committed to git, contains all `TEST_*` environment variable names
532
+ with placeholder descriptions (from TEST_PLAN.md Section 2a). No real credentials.
533
+ - `.env` — contains actual values from CLAUDE.md for the current developer's machine.
534
+ Pre-populate with values from CLAUDE.md. This file MUST NOT be committed to git.
535
+ - **`.gitignore` update (MANDATORY)** — Add the following entries to the project's
536
+ `.gitignore` file (or create it if it does not exist):
537
+ - `e2e/.env` — prevents credentials and machine-specific paths from being committed
538
+ - `e2e/node_modules/` — prevents Playwright and dotenv dependencies from being committed
539
+ Verify both entries exist before proceeding with any other scaffolding step.
540
+ - `helpers/config.ts` — **single source of truth** for all infrastructure config.
541
+ Loads `dotenv/config` and exports named constants for every `TEST_*` env var
542
+ (DB, MQ, SSO, app URL). All other helpers and spec files import from this file
543
+ instead of reading `process.env` directly or hardcoding values.
544
+ - Helper utilities for login, navigation, data seeding — all helpers MUST import
545
+ infrastructure values from `helpers/config.ts`. **NEVER hardcode** machine-specific
546
+ paths, CLI tool locations, database credentials, or SSO admin passwords in any
547
+ TypeScript source file (helpers OR spec files).
548
+ 14. **Mockup baseline screenshots**: Capture baseline screenshots from HTML mockups for visual consistency testing:
549
+ - Start the shared Mockup Hub (`npm start` in `<root>/mockup/` — zero dependencies, no
550
+ npm install needed; port from `PORT` env or `mockup.config.json`, default 3000)
551
+ - Screens are served at `http://localhost:<hub_port>/<app_slug>/<role>/<page>`
552
+ (shadcn mockups must be built first: `npm run build` in the app's mockup folder)
553
+ - For each role/screen in the mockup, capture a screenshot to `<source-code-path>/e2e/visual-baselines/`
554
+ - Stop the Mockup Hub after capture
555
+ - These baselines will be compared against the application output during module testing
556
+
557
+ After scaffolding, verify the application compiles/starts. **Use the exact paths, CLIs, and
558
+ credentials from `CLAUDE.md`** — do NOT use generic commands or assume default paths:
559
+ ```bash
560
+ # Examples (actual paths come from CLAUDE.md):
561
+
562
+ # Laravel:
563
+ <php-path-from-CLAUDE.md>/php.exe artisan --version
564
+ <php-path-from-CLAUDE.md>/php.exe artisan serve
565
+
566
+ # Spring Boot:
567
+ JAVA_HOME="<jdk-path>" <maven-path>/mvn -f <source-code-path>/pom.xml clean compile
568
+ ```
569
+
570
+ Update IMPLEMENTATION_MASTER.md: mark scaffolding as COMPLETED.
571
+
572
+ ### Phase 3: Implementation (Per Module)
573
+
574
+ For each module in execution order:
575
+
576
+ #### Step 3.1: Initialize Module Tracking
577
+
578
+ Create `<app_folder>/context/develop/<module-slug>/IMPLEMENTATION_MODULE.md`:
579
+
580
+ ```markdown
581
+ # Implementation - <Module Name>
582
+
583
+ **Module**: <Module Name>
584
+ **Layer**: <Layer>
585
+ **Status**: IN PROGRESS
586
+ **Started**: <date>
587
+
588
+ ---
589
+
590
+ ## Resources
591
+
592
+ | Resource | Path |
593
+ |----------|------|
594
+ | User Stories | <IDs from PRD.md> |
595
+ | Bug Fixes | <IDs from PRD.md `### Bug` section, if any> |
596
+ | Model | `model/<module-slug>/model.md` |
597
+ | Specification | `specification/<module-slug>/SPEC.md` |
598
+ | Test Spec | `test/<module-slug>/TEST_SPEC.md` |
599
+ | Mockup | `mockup/<role>/content/<screen>.html` |
600
+
601
+ ---
602
+
603
+ ## Implementation Checklist
604
+
605
+ ### UI Layer
606
+
607
+ - [ ] 1. Read and analyze module resources
608
+ - [ ] 2. Implement module model (entities/documents)
609
+ - [ ] 3. Implement repository layer
610
+ - [ ] 4. Implement service layer
611
+ - [ ] 5. Implement controller layer
612
+ - [ ] 6. Implement view templates (list, detail, form pages)
613
+ - [ ] 7. Write Playwright E2E tests (UI scenarios)
614
+ - [ ] 8. Run E2E tests and verify
615
+
616
+ ### User Stories
617
+
618
+ <For each user story ID from the module's SPEC.md traceability section, add a checklist item:>
619
+ - [ ] USxxxx: <description>
620
+
621
+ ### Non-Functional Requirements
622
+
623
+ <For each NFR ID from the module's SPEC.md traceability section, add a checklist item:>
624
+ - [ ] NFRxxxx: <description>
625
+
626
+ ### Messaging Pipeline (if applicable — include only if module has messaging NFRs)
627
+
628
+ - [ ] Implement message consumer
629
+ - [ ] Implement message validator
630
+ - [ ] Implement ACK publisher
631
+ - [ ] Implement forward publisher
632
+ - [ ] Implement queue configuration
633
+ - [ ] Implement module events
634
+ - [ ] Write E2E tests for message processing flow
635
+
636
+ ### Scheduled Jobs (if applicable — include only if module has scheduling NFRs)
637
+
638
+ - [ ] Implement scheduled job
639
+ - [ ] Write E2E tests for scheduled job
640
+
641
+ ### Visual Consistency
642
+
643
+ - [ ] Visual consistency testing (mockup vs application)
644
+ - [ ] Fix visual deviations (if any)
645
+
646
+ ---
647
+
648
+ ## Implementation Log
649
+
650
+ ### Step 1: Analyze Module Resources
651
+ <timestamp> - Started
652
+ - Read model.md, SPEC.md, TEST_SPEC.md, mockup HTML
653
+ - Key findings: ...
654
+ ```
655
+
656
+ #### Step 3.2: Analyze Module Resources
657
+
658
+ Read ALL module-specific resources:
659
+ - `model/<module-slug>/model.md` — document structure, collections, fields
660
+ - `model/<module-slug>/schemas.json` — JSON schema examples
661
+ - `specification/<module-slug>/SPEC.md` — full technical specification
662
+ - `test/<module-slug>/TEST_SPEC.md` — test scenarios, seeding scripts, assertions
663
+ - `mockup/<role>/content/<module_screen>.html` — UI mockup for visual reference
664
+ - Relevant entries from `PRD.md` — user stories for this module
665
+ - `### Bug` section from `PRD.md` for this module (if present) — previously fixed bugs
666
+ - Relevant message files from `reference/message/` if applicable
667
+
668
+ **Bug Regression Awareness (Redo/Redevelop Scenario):**
669
+ If the module has a `### Bug` section in PRD.md, this means the application was previously
670
+ developed and users reported bugs that were fixed. During redevelopment, these bug fixes MUST
671
+ be incorporated into the implementation to prevent the same bugs from reappearing:
672
+ - Read each bug entry (e.g., `[BUG-024] Fixed Message ID link...`) to understand what was broken and how it was fixed
673
+ - Treat each bug fix as an implicit requirement — the implementation must produce behavior consistent with the fix description
674
+ - If a bug fix contradicts or supplements a user story or NFR, the bug fix takes precedence (it reflects the latest validated behavior)
675
+
676
+ Update IMPLEMENTATION_MODULE.md: mark step 1 complete with findings summary.
677
+
678
+ #### Step 3.3: Implement Module Code
679
+
680
+ Follow the module SPEC.md to implement, in order:
681
+ 1. **Entity/Document classes** — from model.md + schemas.json
682
+ 2. **Repository interfaces** — from SPEC.md data access section
683
+ 3. **Service classes** — business logic from SPEC.md
684
+ 4. **Mappers** — if specified in SPEC.md
685
+ 5. **Controller classes** — routes, request handling from SPEC.md
686
+ 6. **View templates** — from SPEC.md view section + mockup HTML
687
+ 7. **Message listeners** — from SPEC.md messaging section (if applicable)
688
+ 8. **Scheduled jobs** — from SPEC.md scheduling section (if applicable)
689
+
690
+ **Traceability comment (MANDATORY)** — Every newly created source file (entity, repository,
691
+ service, mapper, controller, view template, listener, scheduled job, configuration class)
692
+ MUST begin with a top-of-file comment listing the requirement codes it implements.
693
+ Extract the codes verbatim from the module's `SPEC.md` traceability section. Use the
694
+ 9-character codes emitted by `util-ustagger` — DO NOT invent or reformat the codes:
695
+
696
+ | Category | Pattern | Example (`HM` initials) |
697
+ |---|---|---|
698
+ | User Story | `US<II><5-digit#>` | `USHM00003` |
699
+ | Non-Functional Requirement | `NFR<II><4-digit#>` | `NFRHM0003` |
700
+ | Constraint | `CONS<II><3-digit#>` | `CONSHM003` |
701
+ | Reference | `REF<II><4-digit#>` | `REFHM0003` |
702
+
703
+ Where `<II>` is the application's 2-letter initials (e.g., `HM` for Hub Middleware).
704
+ The actual codes in any given file come from the module's `SPEC.md` traceability section,
705
+ NOT from this template — never invent codes that do not appear in PRD.md.
706
+
707
+ Use the language's native doc-comment style — Javadoc / PHPDoc / JSDoc (`/** ... */`)
708
+ for code files, `{{-- ... --}}` for Blade, `@* ... *@` for JTE, `<!-- ... -->` for HTML,
709
+ `# ...` for YAML / `.env` / `.properties`.
710
+
711
+ Example (Java service for the Employer module of an app with initials `HM`):
712
+ ```java
713
+ /**
714
+ * Implements: USHM00003, USHM00006
715
+ * NFR: NFRHM0003 (audit logging), NFRHM0006 (pagination)
716
+ * Constraints: CONSHM003
717
+ */
718
+ public class EmployerService { ... }
719
+ ```
720
+
721
+ This makes `git blame`, IDE symbol search, and downstream audits trace every line back to
722
+ PRD.md directly — IMPLEMENTATION_MODULE.md is a transient tracking file and is not the
723
+ system of record for traceability.
724
+
725
+ After each major component, update IMPLEMENTATION_MODULE.md checklist.
726
+
727
+ #### Step 3.4: Implement Playwright E2E Tests
728
+
729
+ From the module's TEST_SPEC.md:
730
+
731
+ 1. **Create test file**: `<source-code-path>/e2e/tests/<module-slug>.spec.ts`
732
+ 2. **Implement data seeding**: Use the seeding scripts from TEST_SPEC.md Section 4.
733
+ All seeding helper functions MUST read paths, credentials, and connection strings
734
+ from `process.env.*` (loaded via `dotenv` from `<source-code-path>/e2e/.env`).
735
+ **NEVER hardcode** machine-specific values (file paths, CLI tool locations, database
736
+ hosts/passwords, SSO admin credentials) in TypeScript source code.
737
+ 3. **Implement test scenarios**: Convert each scenario from TEST_SPEC.md Section 5 into Playwright tests
738
+ 4. **DO NOT implement cleanup scripts** — test data must persist for downstream modules
739
+
740
+ Pattern for shared config helper (`e2e/helpers/config.ts`) — **single source of truth**
741
+ for all infrastructure configuration. Every other helper and spec file imports from here
742
+ instead of reading `process.env` directly or hardcoding values:
743
+ ```typescript
744
+ import 'dotenv/config'; // loads .env from e2e/ directory
745
+
746
+ // Application
747
+ export const APP_BASE_URL = process.env.TEST_APP_BASE_URL!;
748
+
749
+ // Database (include only what exists in CLAUDE.md)
750
+ export const DB_URI = process.env.TEST_DB_URI!; // MongoDB
751
+ // OR for MySQL/PostgreSQL:
752
+ // export const DB_HOST = process.env.TEST_DB_HOST!;
753
+ // export const DB_PORT = process.env.TEST_DB_PORT!;
754
+ // export const DB_USER = process.env.TEST_DB_USER!;
755
+ // export const DB_PASSWORD = process.env.TEST_DB_PASSWORD!;
756
+ // export const DB_NAME = process.env.TEST_DB_NAME!;
757
+
758
+ // Message Queue (include only if MQ exists in CLAUDE.md)
759
+ export const MQ_HOST = process.env.TEST_MQ_HOST!;
760
+ export const MQ_PORT = process.env.TEST_MQ_PORT!;
761
+ export const MQ_USER = process.env.TEST_MQ_USER!;
762
+ export const MQ_PASSWORD = process.env.TEST_MQ_PASSWORD!;
763
+ export const MQ_VHOST = process.env.TEST_MQ_VHOST!;
764
+ export const MQ_URL = process.env.TEST_MQ_URL!;
765
+
766
+ // SSO / Auth (include only if SSO exists in CLAUDE.md)
767
+ export const SSO_HOST = process.env.TEST_SSO_HOST!;
768
+ export const SSO_ADMIN_USER = process.env.TEST_SSO_ADMIN_USER!;
769
+ export const SSO_ADMIN_PASSWORD = process.env.TEST_SSO_ADMIN_PASSWORD!;
770
+ export const SSO_CLI_PATH = process.env.TEST_SSO_CLI_PATH!;
771
+ export const SSO_REALM = process.env.TEST_SSO_REALM!;
772
+ ```
773
+
774
+ Pattern for domain-specific helper (e.g., `e2e/helpers/keycloak.ts`) — imports config
775
+ from `config.ts`, never reads `process.env` directly:
776
+ ```typescript
777
+ import { execSync } from 'child_process';
778
+ import { SSO_CLI_PATH, SSO_HOST, SSO_ADMIN_USER, SSO_ADMIN_PASSWORD, SSO_REALM } from './config';
779
+
780
+ function runKcadm(command: string): string {
781
+ try {
782
+ return execSync(`"${SSO_CLI_PATH}" ${command}`, { encoding: 'utf-8', timeout: 30000 });
783
+ } catch (error: any) {
784
+ return error.stdout || error.stderr || error.message || '';
785
+ }
786
+ }
787
+
788
+ export function kcadmConfig(): void {
789
+ runKcadm(`config credentials --server ${SSO_HOST} --realm master --user ${SSO_ADMIN_USER} --password ${SSO_ADMIN_PASSWORD}`);
790
+ }
791
+ // ... remaining helper functions use the config imports above
792
+ ```
793
+
794
+ **No hardcoded config in spec files**: If a spec file needs infrastructure values (e.g.,
795
+ database connection for direct seeding, MQ host for publishing, mail server URL), it MUST
796
+ import them from `helpers/config.ts` — never hardcode them inline in the spec. This applies
797
+ to ALL spec files, not just those with dedicated helper modules.
798
+
799
+ **Test naming convention (MANDATORY)** — Every test name MUST be prefixed with the
800
+ **scenario ID from TEST_SPEC.md Section 4** so test output (CI logs, reports) is traceable
801
+ to TEST_SPEC.md without consulting IMPLEMENTATION_MODULE.md. The scenario IDs are emitted
802
+ by `testgen-functional` and follow the pattern `<TYPE>-<MODULE-PREFIX>-<NNN>`, where
803
+ `<TYPE>` is one of `NAV`, `SRCH`, `VIEW`, `CRUD`, `VAL`, `MAP`, `TOG`, `HIST`, `RAW`,
804
+ `PAGE`, `REG`, or `TSTI`, and `<MODULE-PREFIX>` is the 3-letter module prefix from the
805
+ module model (e.g., `LIN` for Location Information, `EMP` for Employer, `QUO` for Quota).
806
+
807
+ Format: `'<scenario-id>: <scenario-name>'` — copied verbatim from TEST_SPEC.md Section 4.
808
+ Do NOT invent IDs; do NOT collapse or reformat them.
809
+
810
+ Each test MUST also carry a JSDoc traceability comment listing the source codes from
811
+ the scenario's **Source** field in TEST_SPEC.md — these are the same `USHM#####`,
812
+ `NFRHM####`, `CONSHM###`, `TSTHM####`, and `[BUG-XXX]` codes that link the scenario back
813
+ to PRD.md. Copy them verbatim.
814
+
815
+ Pattern for test file:
816
+ ```typescript
817
+ import { test, expect } from '@playwright/test';
818
+ import { DB_URI, MQ_URL } from '../helpers/config'; // import what this spec needs
819
+
820
+ /**
821
+ * Module: <Module Name>
822
+ * Implements scenarios: NAV-LIN-001, SRCH-LIN-001, CRUD-LIN-001, CRUD-LIN-002
823
+ * (copied verbatim from TEST_SPEC.md Section 4)
824
+ */
825
+ test.describe('<Module Name>', () => {
826
+ // Data seeding (runs once before all tests in this module)
827
+ test.beforeAll(async () => {
828
+ // Execute seeding script from TEST_SPEC.md Section 4
829
+ // All infrastructure values come from helpers/config.ts — never hardcode
830
+ });
831
+
832
+ // DO NOT add afterAll cleanup — data persists for dependent modules
833
+
834
+ /**
835
+ * Covers: USHM00003, USHM00006
836
+ * NFR: NFRHM0003
837
+ * Bug regression: [BUG-024] // include only if scenario covers a previously-fixed bug
838
+ */
839
+ test('NAV-LIN-001: Navigate to Location Information screen', async ({ page }) => {
840
+ // Steps from the matching TEST_SPEC.md Section 4 scenario
841
+ });
842
+ });
843
+ ```
844
+
845
+ #### Step 3.5: Run E2E Tests
846
+
847
+ ```bash
848
+ cd <source-code-path>/e2e && npx playwright test tests/<module-slug>.spec.ts
849
+ ```
850
+
851
+ - If tests pass: proceed to visual consistency testing (Step 3.6)
852
+ - If tests fail: analyze failures, fix code, re-run (do NOT clean test data unless re-seeding is required for retest)
853
+
854
+ #### Step 3.6: Visual Consistency Testing (Mockup vs Application)
855
+
856
+ After functional E2E tests pass, compare the UI output of the application against the approved HTML mockup screens. The goal is to verify **aesthetic consistency** — colors, alignment, padding, margins, font sizes, layout structure — NOT content (data values will differ).
857
+
858
+ **Process:**
859
+
860
+ 1. **Identify mockup screens** for this module from `<app_folder>/context/mockup/<role>/content/` that correspond to the implemented views.
861
+
862
+ 2. **Capture mockup baselines** (if not already captured during scaffolding):
863
+ - Start the shared Mockup Hub: `cd <root>/mockup && npm start` (no npm install needed)
864
+ - Navigate to each screen for the module at
865
+ `http://localhost:<hub_port>/<app_slug>/<role>/<page>` and capture a screenshot
866
+ - Save to `<source-code-path>/e2e/visual-baselines/<module-slug>/<screen-name>.png`
867
+ - Stop the Mockup Hub
868
+
869
+ 3. **Create visual comparison test**: `<source-code-path>/e2e/tests/<module-slug>.visual.spec.ts`
870
+ - For each screen in the module, navigate to the corresponding application page
871
+ - Capture a screenshot of the application output
872
+ - Use Playwright's `toHaveScreenshot()` with a **threshold** to allow content differences while catching layout/styling deviations
873
+ - Compare against the mockup baseline
874
+
875
+ 4. **Visual test pattern**:
876
+ ```typescript
877
+ import { test, expect } from '@playwright/test';
878
+ import { loginAs } from '../helpers/auth';
879
+ import path from 'path';
880
+
881
+ test.describe('<Module Name> - Visual Consistency', () => {
882
+ test('<screen-name> matches mockup layout', async ({ page }) => {
883
+ await loginAs(page, '<role>');
884
+ await page.goto('<app-route-for-screen>');
885
+ await page.waitForLoadState('networkidle');
886
+
887
+ // Compare against mockup baseline — threshold allows content differences
888
+ // but catches color, alignment, padding, margin, and layout deviations
889
+ await expect(page).toHaveScreenshot('<module-slug>-<screen-name>.png', {
890
+ maxDiffPixelRatio: 0.15, // Allow up to 15% pixel difference (content varies)
891
+ threshold: 0.3, // Per-pixel color threshold (0-1, higher = more lenient)
892
+ animations: 'disabled',
893
+ });
894
+ });
895
+ });
896
+ ```
897
+
898
+ 5. **On first run**, Playwright generates actual screenshots. Manually review them:
899
+ - If the layout aesthetics match the mockup (colors, spacing, alignment), approve by updating the snapshots
900
+ - If deviations are found, fix the templates / CSS and re-run
901
+
902
+ 6. **What to check** (aesthetic consistency):
903
+ - Color scheme matches (backgrounds, borders, text colors, button colors)
904
+ - Spacing and alignment (padding, margins, gaps between elements)
905
+ - Layout structure (grid/flex arrangement, sidebar/header/content proportions)
906
+ - Typography (font sizes, weights, line heights — relative, not exact)
907
+ - Component styling (buttons, tables, forms, cards, badges)
908
+ - Responsive breakpoints if applicable
909
+
910
+ 7. **What to ignore** (content differences are expected):
911
+ - Actual text content / data values
912
+ - Number of rows in tables
913
+ - Dynamic timestamps, IDs, or generated values
914
+
915
+ Update IMPLEMENTATION_MODULE.md: mark visual consistency testing step complete with findings.
916
+
917
+ - If visual tests pass: update IMPLEMENTATION_MODULE.md status to COMPLETED
918
+ - If visual tests reveal layout issues: fix templates/CSS, re-run both functional and visual tests
919
+
920
+ ### Phase 4: Post-Implementation (Per Module)
921
+
922
+ After each module completes:
923
+
924
+ 1. Update `<app_folder>/context/develop/<module-slug>/IMPLEMENTATION_MODULE.md`:
925
+ - Set Status to COMPLETED
926
+ - Record completion date
927
+ - Record test results summary
928
+
929
+ 2. Update `<app_folder>/context/develop/IMPLEMENTATION_MASTER.md`:
930
+ - Update module row: Status = COMPLETED, Completed = date
931
+ - Add notes about any issues encountered
932
+
933
+ 3. **Check module and version completion**:
934
+ - Scan the Module Implementation Status table in IMPLEMENTATION_MASTER.md
935
+ - If there are still PENDING modules for the **current version**:
936
+ - **IMMEDIATELY proceed to the next module** in execution order — do NOT stop
937
+ - Continue implementing until context limits force a natural stop
938
+ - The Ralph Loop will re-feed the prompt, and the next iteration will resume via Phase 0
939
+ - If ALL modules for the **current version** are COMPLETED:
940
+ - Update the Version Processing Order table: mark current version as `COMPLETED`, record date
941
+ - Check if there are MORE versions in the resolved version list:
942
+ - If YES → perform a **version increment** (update app version in manifest, reset affected
943
+ modules to PENDING with the new version) and **IMMEDIATELY proceed to Phase 3** for the
944
+ next version's modules. Do NOT stop between versions.
945
+ - If NO (this was the last version) → **Proceed to Phase 5 (Generate README.md)**
946
+ before outputting the completion promise
947
+
948
+ ### Phase 5: Generate README.md
949
+
950
+ After ALL modules are COMPLETED, generate a `README.md` file in the application root folder
951
+ (`<source-code-path>/README.md`). This file serves as the primary documentation for developers
952
+ to understand the application architecture, navigate the codebase, and run the application.
953
+
954
+ **If `<source-code-path>/README.md` already exists, OVERWRITE it completely.** The existing
955
+ README may have been auto-generated by the project scaffolding tool (e.g., Laravel, Spring
956
+ Initializr) and does not reflect the actual implemented application. Phase 5 always produces
957
+ a fresh README based on the specification and the final implementation state.
958
+
959
+ **CRITICAL**: The README content MUST be derived from `SPECIFICATION.md` — the technical
960
+ specification generated by the chosen `specgen-*` skill. Do NOT invent or assume technology
961
+ details. Extract all architecture, stack, configuration, and run instructions directly from
962
+ the specification document.
963
+
964
+ #### Step 5.1: Read SPECIFICATION.md
965
+
966
+ Read `<app_folder>/context/specification/SPECIFICATION.md` and extract:
967
+ - **Technology stack** — framework, language, template engine, CSS framework, JS libraries, database, auth provider, messaging, scheduling
968
+ - **Application architecture** — packaging structure (e.g., Spring Modulith, Laravel Modules), layer conventions (controller, service, repository, view), shared infrastructure components
969
+ - **Configuration** — environment variables, config files, database connection, auth provider setup, message queue setup
970
+ - **Build and run commands** — how to install dependencies, compile, run the application, run tests
971
+
972
+ #### Step 5.2: Generate README.md
973
+
974
+ Create `<source-code-path>/README.md` with the following structure:
975
+
976
+ ```markdown
977
+ # <Application Name>
978
+
979
+ <One-paragraph description from SPECIFICATION.md project overview>
980
+
981
+ ## Technology Stack
982
+
983
+ <Table of technologies, versions, and purposes — extracted from SPECIFICATION.md technology stack section>
984
+
985
+ | Technology | Version | Purpose |
986
+ |-----------|---------|---------|
987
+ | ... | ... | ... |
988
+
989
+ ## Architecture
990
+
991
+ <Description of the application architecture from SPECIFICATION.md — packaging approach,
992
+ layer conventions, module organization. Include a text-based or Mermaid diagram if the
993
+ specification describes the architecture visually.>
994
+
995
+ ## Folder Structure
996
+
997
+ <Tree representation of the actual source code folder structure as implemented. Use the
998
+ real directory layout from `<source-code-path>/`, excluding `context/`, `node_modules/`,
999
+ `.git/`, and other non-essential directories. Annotate key directories with their purpose.>
1000
+
1001
+ ```
1002
+ <source-code-path>/
1003
+ app/ # (Laravel) Application core
1004
+ Modules/ # (Laravel) Feature modules
1005
+ resources/ # (Laravel) Views, CSS, JS
1006
+ src/ # (Spring) Java source
1007
+ e2e/ # Playwright E2E tests
1008
+ ...
1009
+ ```
1010
+
1011
+ ## Prerequisites
1012
+
1013
+ <List of software prerequisites needed to run the application — JDK, PHP, Composer, Maven,
1014
+ Node.js, database, message queue, auth provider, etc. Extracted from SPECIFICATION.md.>
1015
+
1016
+ ## Getting Started
1017
+
1018
+ ### Installation
1019
+
1020
+ <Step-by-step instructions to install dependencies — e.g., `composer install`, `mvn clean install`,
1021
+ `npm install`. Derived from SPECIFICATION.md build configuration section.>
1022
+
1023
+ ### Configuration
1024
+
1025
+ <Instructions for setting up configuration — .env file, application.yml, database setup,
1026
+ auth provider configuration. Reference the specific config files and environment variables
1027
+ from SPECIFICATION.md.>
1028
+
1029
+ ### Running the Application
1030
+
1031
+ <Commands to start the application — e.g., `php artisan serve`, `mvn spring-boot:run`.
1032
+ Include the default URL where the application will be accessible.>
1033
+
1034
+ ### Running Tests
1035
+
1036
+ <Commands to run the Playwright E2E test suite:>
1037
+
1038
+ ```bash
1039
+ cd e2e && npx playwright test
1040
+ ```
1041
+
1042
+ <Any additional test commands — unit tests, integration tests — if applicable from the spec.>
1043
+
1044
+ ## Modules
1045
+
1046
+ <Table listing all implemented modules, their layer classification, and a brief description.
1047
+ Extracted from IMPLEMENTATION_MASTER.md execution order and module details.>
1048
+
1049
+ | Module | Layer | Description |
1050
+ |--------|-------|-------------|
1051
+ | ... | ... | ... |
1052
+
1053
+ ```
1054
+
1055
+ **Adapt the template above** to match the actual technology stack from SPECIFICATION.md:
1056
+ - For **Spring Boot** apps: use Maven/Gradle commands, `src/main/java` paths, `application.yml` config
1057
+ - For **Laravel** apps: use Composer/Artisan commands, `app/` paths, `.env` config
1058
+ - For **REST API** apps: omit view/template sections, focus on API endpoints and Swagger/OpenAPI docs
1059
+ - Include only sections that are relevant to the actual specification — do NOT add sections for
1060
+ features that are not part of the spec (e.g., skip messaging section if no messaging is configured)
1061
+
1062
+ #### Step 5.3: Generate Traceability Matrix
1063
+
1064
+ After the README is generated and BEFORE finalizing tracking, regenerate the requirement-to-code
1065
+ traceability matrix so every PRD requirement ID is linked to the source code that now implements it
1066
+ (the per-file `Implements:` / `NFR:` / `Constraints:` comments written in Step 3.3 are the source
1067
+ of the links).
1068
+
1069
+ 1. Invoke the traceability generator (pass the resolved app folder and the version just completed):
1070
+ ```
1071
+ Skill(skill: "co2-skills:tracegen-matrix", args: "<app_folder> version:<current-version>")
1072
+ ```
1073
+ - If a `module` filter was active for this run, pass it through: append ` module:<module>`.
1074
+ - When processing multiple versions, invoke once after the LAST version (the matrix reflects the
1075
+ full current code state); a per-version invocation is also acceptable.
1076
+ 2. Wait for it to complete. It writes/updates `<app_folder>/context/TRACEABILITY.md` and appends its
1077
+ own `CHANGELOG.md` row.
1078
+ 3. This step does **not** require the codebase-memory MCP — `tracegen-matrix` resolves links from
1079
+ the in-source traceability comments, falling back to name-based source scanning, and only uses
1080
+ codebase-memory for extra precision when it happens to be installed.
1081
+
1082
+ #### Step 5.4: Update Tracking and Complete
1083
+
1084
+ 1. Update IMPLEMENTATION_MASTER.md:
1085
+ - Set top-level `**Status**:` to `COMPLETED`
1086
+ - Add a note: `README.md generated at <source-code-path>/README.md`
1087
+ 2. Append entries to `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`) — **one entry per version processed**:
1088
+ - Read `<app_folder>/CHANGELOG.md`. If it does not exist, create it with context header.
1089
+ - For EACH version in the resolved version list (ascending order):
1090
+ - Search for a `## {version}` heading matching this version.
1091
+ - If the section **exists**: append a new row to its table.
1092
+ - If the section **does not exist**: insert a new section after the `---` below the context header and before any existing `## vX.Y.Z` section (newest-first ordering), with a new table header and the first row.
1093
+ - Row format: `| {YYYY-MM-DD} | {application_name} | conductor-feature-develop | {module or "All"} | Implemented modules for {version} — {count} modules |`
1094
+ - **Never modify or delete existing rows.**
1095
+ 3. Output the Ralph Loop completion promise: `<promise>ALL MODULES IMPLEMENTED</promise>`
1096
+ 4. This signals the Ralph Loop to exit
1097
+
1098
+ ## Mockup Interpretation Guide (CRITICAL)
1099
+
1100
+ The HTML mockups in `<app_folder>/context/mockup/` are organized into **role-based subfolders**
1101
+ (e.g., `hub_administrator/content/`, `hub_operation_support/content/`). This folder structure
1102
+ represents which screens each role can access — it does **NOT** dictate URL patterns or imply
1103
+ that URLs should contain role names.
1104
+
1105
+ ### Rule: Module-Based URLs, NOT Role-Based URLs
1106
+
1107
+ **WRONG** (role in URL — NEVER do this):
1108
+ ```
1109
+ /hub-administrator/employer
1110
+ /hub-operation-support/quota
1111
+ /hub-administrator/industrial-classification/create
1112
+ ```
1113
+
1114
+ **CORRECT** (module-based URL):
1115
+ ```
1116
+ /employer
1117
+ /quota
1118
+ /industrial-classification/create
1119
+ ```
1120
+
1121
+ Controllers MUST use module-based `@RequestMapping` paths. Role enforcement is handled via
1122
+ `@PreAuthorize` annotations on the controller class or method level — NOT through URL segregation.
1123
+
1124
+ ### Template Strategy for Role-Based UI Differences
1125
+
1126
+ When a module's mockup exists under multiple role folders, the screens may differ. Follow this
1127
+ decision framework to determine the template strategy:
1128
+
1129
+ #### Step 1: Classify Each Screen
1130
+
1131
+ For each screen in the module, compare the mockup versions across roles and classify:
1132
+
1133
+ | Classification | Description | Example |
1134
+ |---------------|-------------|---------|
1135
+ | **Role-Exclusive** | Screen exists under only ONE role folder | `audit_trail.html` (admin only), `job_demand.html` (ops only) |
1136
+ | **Shared — Minor Differences** | Same layout and structure, but some elements are shown/hidden per role (e.g., action buttons, edit toggles, "Add" button) | `document_classification.html` — admin has toggles + edit; ops has read-only badges |
1137
+ | **Shared — Major Differences** | Fundamentally different layout, columns, or purpose despite same module name | `occupation_classification.html` — admin sees CRUD list; ops sees corridor mapping view |
1138
+
1139
+ #### Step 2: Apply the Appropriate Strategy
1140
+
1141
+ **A. Role-Exclusive Screens → Single template, single controller method**
1142
+
1143
+ One template, one route. Only the authorized role can access it. No conditional logic needed.
1144
+
1145
+ **B. Shared — Minor Differences → Single template with role-based conditionals**
1146
+
1147
+ Use **one template** with conditional blocks to show/hide elements based on the user's role.
1148
+ This is the preferred approach when the page layout is structurally the same but some UI
1149
+ elements (buttons, action columns, edit controls, banners) differ.
1150
+
1151
+ The controller method is accessible to both roles with appropriate authorization annotations.
1152
+
1153
+ **C. Shared — Major Differences → Separate templates, controller selects at runtime**
1154
+
1155
+ When the two role versions have **fundamentally different layouts, columns, or purposes**
1156
+ (not just show/hide of a few elements), create separate templates and let the controller
1157
+ choose which to render based on the authenticated user's role.
1158
+
1159
+ #### Step 3: Document the Decision
1160
+
1161
+ In `IMPLEMENTATION_MODULE.md`, under the analysis step, record the template strategy chosen
1162
+ for each screen and why:
1163
+
1164
+ ```markdown
1165
+ ### Template Strategy
1166
+
1167
+ | Screen | Roles | Classification | Strategy |
1168
+ |--------|-------|---------------|----------|
1169
+ | employer list | ops-only | Role-Exclusive | Single template |
1170
+ | document_classification | both | Minor Differences | Single template + conditional |
1171
+ | occupation_classification | both | Major Differences | Separate templates |
1172
+ ```
1173
+
1174
+ ### How to Read Mockups During Implementation
1175
+
1176
+ When implementing a module (Step 3.2 — Analyze Module Resources):
1177
+
1178
+ 1. **List all mockup files** for this module across ALL role folders:
1179
+ ```
1180
+ mockup/<role1>/content/<module>*.html
1181
+ mockup/<role2>/content/<module>*.html
1182
+ ```
1183
+
1184
+ 2. **Read each version** and compare structure, columns, buttons, and layout
1185
+
1186
+ 3. **Classify** each screen using the framework above
1187
+
1188
+ 4. **Extract visual design** (colors, spacing, components) from the mockup but
1189
+ **ignore the URL paths** embedded in the mockup HTML (e.g., `href="/hub_administrator/..."`)
1190
+ — these are mockup navigation links, NOT the actual application routes
1191
+
1192
+ 5. **Map mockup URLs to module URLs**:
1193
+ - Mockup: `/hub_administrator/employer` → App: `/employer`
1194
+ - Mockup: `/hub_operation_support/quota_allocation` → App: `/quota-allocation`
1195
+
1196
+ ## Critical Rules
1197
+
1198
+ 1. **CLAUDE.md is the source of truth for all tool commands** — CLAUDE.md is automatically
1199
+ loaded into context. Use the exact JDK path, Maven path, database credentials,
1200
+ message queue credentials, Keycloak CLI path, and all other infrastructure details from
1201
+ CLAUDE.md. NEVER hardcode, guess, or use generic paths like `./mvnw` or `java`.
1202
+
1203
+ 2. **No test data cleanup** — DO NOT clean up test data after module tests pass. Test data
1204
+ from earlier modules is required as seed data for downstream modules. Only clean up if
1205
+ you need to re-seed for a retest.
1206
+
1207
+ 3. **Context window awareness (Ralph Loop handles recovery)** — If approaching context limits,
1208
+ save progress gracefully:
1209
+ - Update IMPLEMENTATION_MODULE.md with current progress (mark completed steps, log findings)
1210
+ - Update IMPLEMENTATION_MASTER.md with current status
1211
+ - The Ralph Loop will automatically re-feed the prompt, and the next iteration will resume
1212
+ from exactly where you left off via Phase 0 resume check
1213
+ - Do NOT worry about "losing work" — the tracking files ARE your persistence mechanism
1214
+
1215
+ 4. **Usage limit handling** — If you hit API usage limits, wait and resume. The tracking
1216
+ files ensure no work is lost. Ralph Loop will re-feed the prompt on next iteration.
1217
+
1218
+ 5. **Module order is strict, version order is strict** — Follow the execution order from
1219
+ TEST_PLAN.md exactly within each version. When processing multiple versions, ALL modules
1220
+ for version N must be COMPLETED before ANY module from version N+1 begins. Dependencies
1221
+ mean earlier modules must complete before later ones can start within the same version.
1222
+
1223
+ 6. **Track everything** — Every action should be logged in IMPLEMENTATION_MODULE.md so
1224
+ that any future session (or Ralph Loop iteration) can understand what was done and what
1225
+ remains. This is CRITICAL for Ralph Loop — without accurate tracking, iterations will
1226
+ repeat already-completed work.
1227
+
1228
+ 7. **Test-driven** — Implementation is guided by TEST_SPEC.md. The test spec defines
1229
+ what the code must do. The SPEC.md defines how to build it.
1230
+
1231
+ 8. **Mockup fidelity** — View templates MUST match the approved HTML mockup screens aesthetically.
1232
+ Use the mockup as the visual reference for layout, components, and styling. After functional
1233
+ E2E tests pass, run visual consistency tests comparing app screenshots against mockup
1234
+ baselines to verify colors, alignment, padding, margins, and layout structure match. Content
1235
+ differences (data values, row counts) are expected and acceptable — only aesthetic deviations
1236
+ should be flagged and fixed.
1237
+
1238
+ 9. **Specification compliance** — Follow the SPECIFICATION.md shared infrastructure sections
1239
+ for all cross-cutting concerns (security, theming, pagination, error handling, etc.).
1240
+
1241
+ 10. **Module-based URLs only** — NEVER use role names in URL paths. Mockup folder structure
1242
+ is for organizing mockups by role visibility, NOT for defining URL routes. All controllers
1243
+ use module-based paths. Role enforcement is via authorization annotations. See the
1244
+ "Mockup Interpretation Guide" section above for the full template strategy framework.
1245
+
1246
+ 11. **Ralph Loop discipline — NEVER stop prematurely** — After completing a module, IMMEDIATELY
1247
+ check for the next pending module and start it. After completing all modules for a version,
1248
+ IMMEDIATELY perform the version increment and start the next version's modules. Do NOT
1249
+ output the completion promise (`<promise>ALL MODULES IMPLEMENTED</promise>`) until EVERY
1250
+ module for EVERY version is COMPLETED. Do NOT stop "to let the user review" — Ralph Loop
1251
+ handles multi-iteration execution automatically. The only valid reasons to stop within an
1252
+ iteration are: (a) context window approaching limit, (b) all modules for all versions
1253
+ completed (output promise), or (c) an unrecoverable error requiring user input.
1254
+
1255
+ 12. **Complete implementation per module** — Each module must have ALL of these before marking
1256
+ COMPLETED: (a) all source files (entities, repositories, services, controllers, mappers),
1257
+ (b) all view templates (page + fragments), (c) E2E test file with all scenarios from TEST_SPEC,
1258
+ (d) all E2E tests passing, (e) ALL user stories checked off in IMPLEMENTATION_MODULE.md,
1259
+ (f) ALL NFRs checked off in IMPLEMENTATION_MODULE.md. Do NOT mark a module COMPLETED with
1260
+ partial implementation or failing tests — this would cause the next Ralph Loop iteration to
1261
+ skip it. If a module has messaging/async NFRs that cannot be implemented yet (e.g., upstream
1262
+ adapter not available), mark the module as **PARTIALLY COMPLETED** and leave the unchecked
1263
+ NFR items visible in the checklist. Only mark COMPLETED when every user story AND every NFR
1264
+ is implemented and tested.
1265
+
1266
+ 13. **Auto-start Ralph Loop** — When this skill is triggered, the FIRST action (Phase 0, Step 0)
1267
+ MUST be to check if Ralph Loop is active (`.claude/ralph-loop.local.md` exists). If not active,
1268
+ invoke `Skill(skill: "ralph-loop:ralph-loop", args: "...")` with the full orchestrator prompt
1269
+ and `--completion-promise "ALL MODULES IMPLEMENTED" --max-iterations 100`. Do NOT proceed
1270
+ with any implementation work until Ralph Loop is confirmed active.
1271
+
1272
+ 14. **NO creative alternatives for 3rd party applications (CRITICAL)** — You MUST use the EXACT
1273
+ methods, connection strings, CLIs, and credentials described in `CLAUDE.md` for
1274
+ accessing all external infrastructure. This includes but is not limited to:
1275
+
1276
+ **NEVER do any of the following:**
1277
+ - Connect to databases via Docker (`docker exec`, `docker run`, CLI inside a container)
1278
+ - Start or restart services with alternative databases
1279
+ - Spin up services via Docker Compose or Docker run
1280
+ - Use `docker exec` to access any service that is described as running natively in CLAUDE.md
1281
+ - Install or use alternative CLI tools when CLAUDE.md specifies a different access method
1282
+ - Assume services run in Docker when CLAUDE.md says they run natively (or vice versa)
1283
+ - Use embedded/in-memory databases as substitutes for the actual configured database
1284
+ - Guess connection strings, ports, or credentials — ALWAYS read them from CLAUDE.md
1285
+
1286
+ **ALWAYS do the following:**
1287
+ - Use database connection strings EXACTLY as specified in CLAUDE.md
1288
+ - Use service instances EXACTLY as configured in CLAUDE.md
1289
+ - Use CLIs at the EXACT paths specified in CLAUDE.md
1290
+ - For E2E test data seeding, connect to the database using the EXACT connection details from
1291
+ CLAUDE.md
1292
+ - For E2E test helper classes and seeding utilities, store ALL machine-specific values
1293
+ (CLI paths, connection strings, credentials) in `<source-code-path>/e2e/.env` and read
1294
+ them via `process.env.*` using `dotenv`. Populate `.env` with values from CLAUDE.md
1295
+ for the current machine, but NEVER hardcode these values in TypeScript source files.
1296
+ Commit `.env.example` (with placeholder descriptions) and ensure `e2e/.env` is in
1297
+ `.gitignore` so that credentials and machine-specific paths are never committed.
1298
+
1299
+ **WHY**: Creative alternatives (Docker containers, alternative databases, alternative CLIs) connect to
1300
+ DIFFERENT data stores or service instances than the ones the application is configured to use.
1301
+ This produces wrong test results, missing data, and phantom failures. Hardcoding CLAUDE.md values
1302
+ directly in TypeScript source code makes tests non-portable — other developers with different
1303
+ machine setups cannot run the tests without modifying source files. Using `.env` files allows
1304
+ each developer to configure their own paths and credentials once without touching committed code.
1305
+
1306
+ 15. **Source code goes directly in `<source-code-path>/` — NO nested subdirectories (CRITICAL)** —
1307
+ The `<source-code-path>` (which defaults to `<app_folder>`) already contains a `context/` folder
1308
+ with all generated artifacts. Source code files MUST be placed directly alongside `context/` in the same
1309
+ directory — NOT inside a nested project subfolder. When using project scaffolding tools,
1310
+ these tools create a new subdirectory by default. You MUST work around this by:
1311
+ - Creating the project in a temporary subdirectory (e.g., `<source-code-path>/_temp_scaffold`)
1312
+ - Moving ALL files (including dotfiles) up to `<source-code-path>/`
1313
+ - Removing the empty temporary directory
1314
+ - Verifying the `context/` folder was NOT overwritten or deleted
1315
+
1316
+ **WHY**: The folder structure convention is that `<app_folder>` contains both `context/` (artifacts)
1317
+ and source code at the same level. A nested subdirectory breaks all relative paths, makes the
1318
+ project structure confusing, and separates context from code unnecessarily.
1319
+
1320
+ 16. **Context artifacts must pre-exist** — This skill does NOT generate context artifacts. If
1321
+ module models, mockups, specifications, or test specs are missing, stop and instruct the
1322
+ user to run `/conductor-feature-prepare` first. Do NOT attempt to generate artifacts inline.
1323
+
1324
+ 17. **README.md is mandatory before completion** — After ALL modules are COMPLETED,
1325
+ Phase 5 (Generate README.md) MUST run before outputting the completion promise.
1326
+ Phase 5 generates the README with content derived from SPECIFICATION.md — do NOT
1327
+ invent stack details, run commands, or architecture descriptions. Deployment
1328
+ artifacts (Dockerfile, Kubernetes manifests) are NOT generated by this skill —
1329
+ run `/depgen-k8s` independently after development is complete.
1330
+
1331
+ 18. **Spring Boot `app:` namespace for application-specific configuration (CRITICAL)** —
1332
+ When the application stack is Spring Boot, ALL application-owned configuration in
1333
+ `application.yml` MUST be placed under the top-level `app:` key. NEVER place
1334
+ application-specific keys at the YAML root (e.g., top-level `notification:`,
1335
+ `batch-job:`, `audit-trail:`) and NEVER place them under Spring framework namespaces
1336
+ (`spring.*`, `server.*`, `management.*`, `logging.*`, `springdoc.*`).
1337
+
1338
+ **Grouping:**
1339
+ - Cross-cutting values (version, CORS, shared security, shared messaging, shared
1340
+ object-storage) sit directly under `app.*` with no module prefix.
1341
+ - Per-module values MUST be grouped under `app.<module-kebab-case>.*`, one block
1342
+ per module. A single config value per module still gets its own block.
1343
+
1344
+ **Binding:** every `app.*` subtree MUST be bound once via a `@ConfigurationProperties`
1345
+ record in the owning module's `config` subpackage (or in the application-level
1346
+ `config` subpackage for cross-cutting values). NEVER inject individual values via
1347
+ `@Value("${app....}")` scattered across beans. Use kebab-case in YAML; Spring Boot's
1348
+ relaxed binding maps to camelCase Java fields automatically. See SPECIFICATION.md
1349
+ section "Application-Specific Configuration (`app:` namespace)" for the authoritative
1350
+ rules and examples.
1351
+
1352
+ 19. **Code-level traceability is MANDATORY** — Every newly created source file (entity,
1353
+ repository, service, mapper, controller, view template, listener, scheduled job,
1354
+ configuration class, test file) MUST carry a top-of-file comment listing the
1355
+ requirement codes it implements. The codes follow the formats emitted by
1356
+ `util-ustagger` and `testgen-functional` — extract them verbatim from the module's
1357
+ `SPEC.md` and `TEST_SPEC.md` traceability sections, never invent or reformat:
1358
+
1359
+ | Source | Code Pattern | Example |
1360
+ |---|---|---|
1361
+ | PRD.md → User Story | `US<II><5-digit#>` | `USHM00003` |
1362
+ | PRD.md → NFR | `NFR<II><4-digit#>` | `NFRHM0003` |
1363
+ | PRD.md → Constraint | `CONS<II><3-digit#>` | `CONSHM003` |
1364
+ | PRD.md → Reference | `REF<II><4-digit#>` | `REFHM0003` |
1365
+ | PRD.md → Test instruction | `TST<II><4-digit#>` | `TSTHM0003` |
1366
+ | TEST_SPEC.md → Scenario | `<TYPE>-<MODULE-PREFIX>-<NNN>` | `NAV-LIN-001`, `CRUD-EMP-002`, `REG-QUO-001` |
1367
+
1368
+ `<II>` is the application's 2-letter initials. `<TYPE>` is one of `NAV`, `SRCH`,
1369
+ `VIEW`, `CRUD`, `VAL`, `MAP`, `TOG`, `HIST`, `RAW`, `PAGE`, `REG`, `TSTI`.
1370
+ `<MODULE-PREFIX>` is the 3-letter module prefix from the module model.
1371
+
1372
+ Use the language's native doc-comment style (Javadoc / PHPDoc / JSDoc / `{{-- --}}` /
1373
+ `@* *@` / `<!-- -->` / `#`). Test names MUST be prefixed with the scenario ID copied
1374
+ verbatim from TEST_SPEC.md Section 4 (e.g., `'NAV-LIN-001: Navigate to Location
1375
+ Information screen'`) so test output is traceable to TEST_SPEC.md without consulting
1376
+ IMPLEMENTATION_MODULE.md.
1377
+
1378
+ **Why**: `git blame`, IDE symbol search, and downstream audits must trace every line
1379
+ of code back to a PRD.md requirement or a TEST_SPEC.md scenario directly.
1380
+ IMPLEMENTATION_MODULE.md is a transient tracking file and is not the system of record
1381
+ for traceability — the source code itself must be self-describing. This rule applies
1382
+ to fresh creation; bug fixes layer additional `[BUG-XXX]` markers as defined by
1383
+ `conductor-defect`.