@rashidee/co2 1.3.25 → 1.3.28

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 (70) hide show
  1. package/dist/.co2-dat/app.db +0 -0
  2. package/dist/.co2-dat/app.db-shm +0 -0
  3. package/dist/.co2-dat/app.db-wal +0 -0
  4. package/dist/index.js +179 -36
  5. package/package.json +2 -2
  6. package/plugin/.claude-plugin/plugin.json +22 -22
  7. package/plugin/skills/conductor-defect/SKILL.md +924 -905
  8. package/static/assets/{abnfDiagram-VRR7QNED-r3_rpvFo.js → abnfDiagram-VRR7QNED-DGTYgRnP.js} +1 -1
  9. package/static/assets/{arc-DbiqzTs-.js → arc-7174fU_E.js} +1 -1
  10. package/static/assets/{architectureDiagram-ZJ3FMSHR-BJ-dcYpi.js → architectureDiagram-ZJ3FMSHR-iMcDhvoF.js} +1 -1
  11. package/static/assets/{blockDiagram-677ZJIJ3-BmHNspIR.js → blockDiagram-677ZJIJ3-kM7BtLQy.js} +1 -1
  12. package/static/assets/{c4Diagram-LMCZKHZV-CfgVJ9gr.js → c4Diagram-LMCZKHZV-CIYw9y0n.js} +1 -1
  13. package/static/assets/channel-CZ6M3VBW.js +1 -0
  14. package/static/assets/{chunk-2Q5K7J3B-PNfiudSM.js → chunk-2Q5K7J3B-CwNDUll4.js} +1 -1
  15. package/static/assets/{chunk-32BRIVSS-DdD3xMjB.js → chunk-32BRIVSS-xUXN4448.js} +1 -1
  16. package/static/assets/{chunk-5VM5RSS4-DS1ulZwP.js → chunk-5VM5RSS4-DSuopQRa.js} +1 -1
  17. package/static/assets/{chunk-EX3LRPZG-CzVStkKt.js → chunk-EX3LRPZG-DaP1AUXn.js} +1 -1
  18. package/static/assets/{chunk-JWPE2WC7-De7uOmha.js → chunk-JWPE2WC7-BbcXokVM.js} +1 -1
  19. package/static/assets/{chunk-MOJQB5TN-qyl8h8E8.js → chunk-MOJQB5TN-BEvtZ0cJ.js} +1 -1
  20. package/static/assets/{chunk-RYQCIY6F-DQEjm1TG.js → chunk-RYQCIY6F-Cf9iaXLG.js} +1 -1
  21. package/static/assets/{chunk-V7JOEXUC-CHii2kCZ.js → chunk-V7JOEXUC-VoptRUQS.js} +1 -1
  22. package/static/assets/{chunk-VR4S4FIN-Y8HV5BKK.js → chunk-VR4S4FIN-D8MhSl2b.js} +1 -1
  23. package/static/assets/{chunk-XXDRQBXY-s_-4DXsy.js → chunk-XXDRQBXY-ChGrQH2-.js} +1 -1
  24. package/static/assets/classDiagram-OUVF2IWQ-BNo52yZj.js +1 -0
  25. package/static/assets/classDiagram-v2-EOCWNBFH-BNo52yZj.js +1 -0
  26. package/static/assets/{cose-bilkent-JH36ORCC-BeDdmDpD.js → cose-bilkent-JH36ORCC-_7_J1ueO.js} +1 -1
  27. package/static/assets/{cynefin-VYW2F7L2-COUQslLO.js → cynefin-VYW2F7L2-D7ojj48a.js} +1 -1
  28. package/static/assets/{cynefinDiagram-TSTJHNR4-BuPYyXEY.js → cynefinDiagram-TSTJHNR4-CzZCuws6.js} +1 -1
  29. package/static/assets/{dagre-VKFMJZFB-vqTchcyP.js → dagre-VKFMJZFB-DrShlPqK.js} +1 -1
  30. package/static/assets/{diagram-FQU43EPY-K_M0RuV-.js → diagram-FQU43EPY-Ba6vyx0R.js} +1 -1
  31. package/static/assets/{diagram-G47NLZAW-DZQ1eHWp.js → diagram-G47NLZAW-g1iqjkWC.js} +1 -1
  32. package/static/assets/{diagram-NH7WQ7WH-ayYySNnw.js → diagram-NH7WQ7WH-Yn0iGo61.js} +1 -1
  33. package/static/assets/{diagram-OA4YK3LP-D62rbwWX.js → diagram-OA4YK3LP-BqNMfzEH.js} +1 -1
  34. package/static/assets/{diagram-WEI45ONY-BgBuxQAR.js → diagram-WEI45ONY-Jv0HskWN.js} +1 -1
  35. package/static/assets/{ebnfDiagram-CCIWWBDH-koE_7EDL.js → ebnfDiagram-CCIWWBDH-EVPmY5ND.js} +1 -1
  36. package/static/assets/{erDiagram-Q63AITRT-AjFwiuV7.js → erDiagram-Q63AITRT-BrFEQzOf.js} +1 -1
  37. package/static/assets/{flowDiagram-23GEKE2U-C0R1nVvy.js → flowDiagram-23GEKE2U-CKQmfCK8.js} +1 -1
  38. package/static/assets/{ganttDiagram-NO4QXBWP-CY-FcEEG.js → ganttDiagram-NO4QXBWP-DOQ3sYfu.js} +1 -1
  39. package/static/assets/{gitGraphDiagram-IHSO6WYX-DyJl7oIu.js → gitGraphDiagram-IHSO6WYX-DamxyOBX.js} +1 -1
  40. package/static/assets/{index-DFOlKDT-.css → index-BRho3Z-u.css} +1 -1
  41. package/static/assets/index-DKK3AwQd.js +496 -0
  42. package/static/assets/{infoDiagram-FWYZ7A6U-DHmQrTFz.js → infoDiagram-FWYZ7A6U-BvfLUhKQ.js} +1 -1
  43. package/static/assets/{ishikawaDiagram-FXEZZL3T-Rrb_rX1Z.js → ishikawaDiagram-FXEZZL3T-Bjcn3YwT.js} +1 -1
  44. package/static/assets/{journeyDiagram-5HDEW3XC-C1X2-E8O.js → journeyDiagram-5HDEW3XC-C7zgXG_P.js} +1 -1
  45. package/static/assets/{kanban-definition-HUTT4EX6-6taKamuj.js → kanban-definition-HUTT4EX6-DkQNMRHb.js} +1 -1
  46. package/static/assets/{linear-BgfvUII2.js → linear-DUJurxs_.js} +1 -1
  47. package/static/assets/{mindmap-definition-LN4V7U3C-CMIdnZlB.js → mindmap-definition-LN4V7U3C-Ca8Rx7ow.js} +1 -1
  48. package/static/assets/{pegDiagram-2B236MQR-Ds5tsqTv.js → pegDiagram-2B236MQR-DM2f6zFq.js} +1 -1
  49. package/static/assets/{pieDiagram-ENE6RG2P-2nFB-KUn.js → pieDiagram-ENE6RG2P-DZQJ9aJe.js} +1 -1
  50. package/static/assets/{quadrantDiagram-ABIIQ3AL-CXYP7EpA.js → quadrantDiagram-ABIIQ3AL-dN5N3iXz.js} +1 -1
  51. package/static/assets/{railroadDiagram-RFXS5EU6-ZWvggJi6.js → railroadDiagram-RFXS5EU6-CxVvDIJC.js} +1 -1
  52. package/static/assets/{requirementDiagram-TGXJPOKE-B9pmz1Lq.js → requirementDiagram-TGXJPOKE-D8gSZdJO.js} +1 -1
  53. package/static/assets/{sankeyDiagram-HTMAVEWB-p05V4NVU.js → sankeyDiagram-HTMAVEWB-CKqKdt9n.js} +1 -1
  54. package/static/assets/{sequenceDiagram-DBY2YBRQ-L1U6b6XO.js → sequenceDiagram-DBY2YBRQ-BUTyVZbB.js} +1 -1
  55. package/static/assets/{sizeCapture-X5ZJPWSS-DaxMca0_.js → sizeCapture-X5ZJPWSS-BfeUsrrc.js} +1 -1
  56. package/static/assets/{stateDiagram-2N3HPSRC-Cn9Oa3AO.js → stateDiagram-2N3HPSRC-CccstMMZ.js} +1 -1
  57. package/static/assets/stateDiagram-v2-6OUMAXLB-BYik3bHQ.js +1 -0
  58. package/static/assets/{swimlanes-5IMT3BWC-CB2axDli.js → swimlanes-5IMT3BWC-WuBhb5Nm.js} +2 -2
  59. package/static/assets/swimlanesDiagram-G3AALYLV-pwhS7TR2.js +8 -0
  60. package/static/assets/{timeline-definition-FHXFAJF6-CBjRTzLu.js → timeline-definition-FHXFAJF6-DE4hFXfn.js} +1 -1
  61. package/static/assets/{vennDiagram-L72KCM5P-CU3sHFkZ.js → vennDiagram-L72KCM5P-lV9K4hR0.js} +1 -1
  62. package/static/assets/{wardleyDiagram-EHGQE667-BUEYUFnX.js → wardleyDiagram-EHGQE667-Dbkoleze.js} +1 -1
  63. package/static/assets/{xychartDiagram-FW5EYKEG-CsQatKqg.js → xychartDiagram-FW5EYKEG-BHYUnMjh.js} +1 -1
  64. package/static/index.html +2 -2
  65. package/static/assets/channel-oJjZid9v.js +0 -1
  66. package/static/assets/classDiagram-OUVF2IWQ-BBGkNxZZ.js +0 -1
  67. package/static/assets/classDiagram-v2-EOCWNBFH-BBGkNxZZ.js +0 -1
  68. package/static/assets/index-B6KU4H2y.js +0 -496
  69. package/static/assets/stateDiagram-v2-6OUMAXLB-Cd04vp8B.js +0 -1
  70. package/static/assets/swimlanesDiagram-G3AALYLV-GtoFqFbp.js +0 -8
@@ -1,905 +1,924 @@
1
- ---
2
- name: conductor-defect
3
- model: claude-opus-4-8
4
- effort: high
5
- description: >
6
- Fix bugs reported by humans from a BUG.md file. Takes an application name (mandatory),
7
- version (optional — supports single version, comma-separated list, "all", or omit for all),
8
- and module (optional), resolves the context folder automatically from root-level application
9
- folders. When multiple versions are provided (or "all"/omitted), versions are processed
10
- SEQUENTIALLY in ascending semver order — all bugs from version N are fully resolved before
11
- version N+1 begins. Tags untagged bugs, creates a BUG_MASTER.md tracking checklist, then
12
- fixes each bug one at a time: reproduce with Playwright, write a test spec, plan the fix,
13
- apply the fix, verify, and update related artifacts (mockups, specifications, module models,
14
- user stories). Integrates with Ralph Loop to ensure all bugs are fully fixed across sessions.
15
- Use this skill when the user asks to "fix bugs", "fix bug", "start bug fixing", "resolve bugs
16
- from BUG.md", "bug fix session", or any request to systematically fix bugs from a BUG.md file.
17
- Also trigger when user says "resume bug fixing" to continue from where a previous session left
18
- off using BUG_MASTER.md progress file.
19
- ---
20
-
21
- # Bug Fixer
22
-
23
- Fix bugs reported by humans one at a time, tracked via BUG_MASTER.md and per-bug BUG_FIX_PLAN.md.
24
-
25
- ## Ralph Loop Integration (INTERNAL — FULLY AUTOMATIC)
26
-
27
- This skill internally manages Ralph Loop. The user does NOT need to invoke `/ralph-loop` or know
28
- about Ralph Loop at all. The skill handles starting, iterating, and completing the loop transparently.
29
-
30
- ### Internal Auto-Start Mechanism
31
-
32
- When this skill is invoked (e.g., `/conductor-defect hub_middleware version:v1.0.4`), the
33
- **very first action** — before reading any files, before Phase 0, before ANYTHING — is to
34
- silently start Ralph Loop by invoking the Skill tool internally:
35
-
36
- ```
37
- Skill(skill: "ralph-loop:ralph-loop", args: "<original-user-invocation-with-all-args> --completion-promise \"ALL BUGS RESOLVED\" --max-iterations 50")
38
- ```
39
-
40
- **Construction rule**: Take the EXACT text the user typed (e.g., `/conductor-defect hub_middleware
41
- version:v1.0.4 module:location-information`) and pass it as the `args` value, appending the
42
- `--completion-promise` and `--max-iterations` flags.
43
-
44
- | User types | Ralph Loop args |
45
- |------------|----------------|
46
- | `/conductor-defect hub_middleware` | `/conductor-defect hub_middleware --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
47
- | `/conductor-defect hub_middleware version:v1.0.4` | `/conductor-defect hub_middleware version:v1.0.4 --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
48
- | `/conductor-defect hub_middleware version:v1.0.3,v1.0.4` | `/conductor-defect hub_middleware version:v1.0.3,v1.0.4 --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
49
- | `/conductor-defect hub_middleware version:all` | `/conductor-defect hub_middleware version:all --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
50
- | `/conductor-defect hub_middleware version:v1.0.4 module:location-information` | `/conductor-defect hub_middleware version:v1.0.4 module:location-information --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
51
-
52
- **Skip if already active**: If `.claude/ralph-loop.local.md` already exists, Ralph Loop is
53
- already running (this is a resumed iteration). Do NOT re-invoke — proceed directly to Phase 0.
54
-
55
- **BLOCKING**: Do NOT proceed with ANY work until Ralph Loop is confirmed active (either freshly
56
- started or already running from a previous iteration).
57
-
58
- ### How It Works (Transparent to User)
59
-
60
- 1. User invokes `/conductor-defect` with their arguments — they never see or interact with Ralph Loop
61
- 2. This skill silently starts Ralph Loop with the conductor-defect prompt as the loop body
62
- 3. On each iteration, the agent reads BUG_MASTER.md to find the next unresolved bug
63
- 4. The agent fixes one or more bugs until context runs out or all bugs are resolved
64
- 5. When the agent tries to exit, Ralph Loop re-feeds the same prompt automatically
65
- 6. The next iteration resumes from where the last one left off (tracked in BUG_MASTER.md)
66
- 7. When ALL bugs are resolved, the agent outputs the completion promise to exit the loop
67
- 8. The user only sees bug-fixing progress — Ralph Loop is an invisible persistence layer
68
-
69
- ### Completion Promise
70
-
71
- When ALL bugs in BUG_MASTER.md have a terminal status (`FIXED`, `CANNOT_REPRODUCE`, or
72
- `HIGH_IMPACT`), output the following promise tag to signal Ralph Loop that bug fixing is done:
73
-
74
- ```
75
- <promise>ALL BUGS RESOLVED</promise>
76
- ```
77
-
78
- **CRITICAL**: Only output this promise when EVERY bug in BUG_MASTER.md has a terminal status.
79
- Do NOT output the promise prematurely. Do NOT output it to escape the loop.
80
-
81
- ### Iteration Awareness (Internal)
82
-
83
- At the START of every iteration (including the first), the agent MUST:
84
- 1. Check if Ralph Loop is already active (if `.claude/ralph-loop.local.md` exists, skip re-invoking)
85
- 2. If NOT active, silently invoke Ralph Loop as described above
86
- 3. Read BUG_MASTER.md to determine what is already resolved
87
- 4. Find the FIRST bug with status `NEW` or `IN_PROGRESS`
88
- 5. If that bug has a BUG_FIX_PLAN.md, read it to find the last incomplete step
89
- 6. Resume from exactly that point — do NOT re-fix already-resolved bugs
90
- 7. If ALL bugs have terminal status, output the completion promise and stop
91
-
92
- ## Inputs
93
-
94
- The skill expects these arguments:
95
-
96
- ```
97
- /conductor-defect <application> [version:<version>] [module:<module>]
98
- ```
99
-
100
- | Argument | Required | Example | Description |
101
- |----------|----------|---------|-------------|
102
- | `<application>` | Yes | `hub_middleware` | Application name to locate the context folder |
103
- | `version:<version>` | No | `version:v1.0.4` or `version:v1.0.3,v1.0.4` or `version:all` | Filter bugs by version. Supports single version, comma-separated list, `all`, or omit for all versions. Multiple versions are processed sequentially in ascending semver order |
104
- | `module:<module>` | No | `module:location-information` | Filter bugs by module |
105
-
106
- ### Input Resolution
107
-
108
- The application name is matched against root-level application folders:
109
- 1. Strip any leading `<number>_` prefix from folder names
110
- 2. Match case-insensitively
111
- 3. Accept snake_case, kebab-case, or title-case input
112
- 4. If no match found, list available applications and stop
113
-
114
- ### Auto-Resolved Paths
115
-
116
- | File | Resolved Path |
117
- |------|---------------|
118
- | BUG.md | `<app_folder>/context/BUG.md` |
119
- | PRD.md | `<app_folder>/context/PRD.md` |
120
- | Bug Tracking Output | `<app_folder>/context/bug/` |
121
- | Module Models | `<app_folder>/context/model/` |
122
- | HTML Mockups | `<app_folder>/context/mockup/` |
123
- | Specifications | `<app_folder>/context/specification/` |
124
-
125
- ### Argument Combinations
126
-
127
- | Provided | Behavior |
128
- |----------|----------|
129
- | `<application>` only | All versions (sequential, ascending semver), all modules |
130
- | `<application>` + `version:v1.0.4` | Single version, all modules |
131
- | `<application>` + `version:v1.0.3,v1.0.4` | Multiple versions (sequential, ascending semver), all modules |
132
- | `<application>` + `version:all` | All versions (sequential, ascending semver), all modules |
133
- | Any above + `module:<module>` | Same as above, filtered to specific module |
134
-
135
- ### Version Resolution
136
-
137
- The `version:` argument supports four forms:
138
-
139
- | Form | Example | Behavior |
140
- |------|---------|----------|
141
- | Single version | `version:v1.0.3` | Process only v1.0.3 |
142
- | Comma-separated list | `version:v1.0.1,v1.0.2,v1.0.3` | Process each version sequentially in ascending semver order |
143
- | Explicit all | `version:all` | Discover all versions from BUG.md, process sequentially in ascending semver order |
144
- | Omitted | _(no version arg)_ | Same as `version:all` |
145
-
146
- #### Version Discovery
147
-
148
- When `version:all` or omitted:
149
- 1. Scan BUG.md for all `[vX.Y.Z]` version tags across all module sections
150
- 2. Collect unique versions
151
- 3. Sort in ascending semantic version order (v1.0.0 < v1.0.1 < v1.1.0 < v2.0.0)
152
- 4. This becomes the ordered version list for sequential processing
153
-
154
- #### Sequential Version Processing Rule
155
-
156
- **Versions are ALWAYS processed one at a time, in ascending semver order.** All bugs from
157
- version N must be fully resolved (terminal status: `FIXED`, `CANNOT_REPRODUCE`, or `HIGH_IMPACT`)
158
- before ANY bug from version N+1 is started. This ensures:
159
- - Bug fixes from earlier versions are in place before later version bugs are addressed
160
- - The codebase is progressively stabilized version by version
161
- - Each version's fixes build on a stable foundation from prior versions
162
-
163
- ### Context Folder Structure (Expected)
164
-
165
- ```
166
- <app_folder>/context/
167
- BUG.md # Bug reports grouped by module, optionally versioned
168
- PRD.md # User stories (for recording bug fixes)
169
- bug/ # Bug tracking folder (BUG_MASTER.md + per-module subfolders)
170
- BUG_MASTER.md # Master checklist (created by this skill)
171
- <module-slug>/ # Per-module folder
172
- <BUG-XXX>/ # Per-bug folder (named by bug tag)
173
- screenshot_*.png # Reproduction screenshots
174
- BUG_TEST_SPEC.md # Test spec for verification
175
- BUG_FIX_PLAN.md # Fix plan with checklist
176
- model/ # Module models (updated if fix involves model changes)
177
- mockup/ # HTML mockups (updated if fix involves UI changes)
178
- specification/ # Technical specifications (updated if fix involves logic changes)
179
- ```
180
-
181
- ## Pre-Requisite: Project Information from CLAUDE.md (MANDATORY)
182
-
183
- **CLAUDE.md is automatically loaded into context** at the start of every session. It contains
184
- project details, infrastructure paths, credentials, and configuration. You do NOT need to read
185
- it manually — the information is already available in your context.
186
-
187
- **Before executing ANY tool command** (Maven build, Spring Boot run, database CLI, Keycloak CLI,
188
- Playwright test, npm start, etc.), use the following from CLAUDE.md (already in context):
189
-
190
- - **JDK path** — Use the exact `JAVA_HOME` path specified in CLAUDE.md
191
- - **Maven path** — Use the exact Maven binary path specified in CLAUDE.md
192
- - **Database credentials** — Host, port, username, password
193
- - **Keycloak configuration** — Host, admin credentials, CLI path
194
- - **Any other infrastructure details** — Ports, URLs, connection strings
195
-
196
- **WHY**: CLAUDE.md contains the actual system paths, credentials, and configuration for the
197
- developer's machine. Every shell command MUST use the values from CLAUDE.md.
198
-
199
- ## BUG.md Format
200
-
201
- The BUG.md file follows a hierarchical structure mirroring the module structure in CLAUDE.md:
202
-
203
- - **Top-level groups** are H1 headers: `# Common`, `# System Module`, `# Business Module`
204
- - **Modules** are H2 headers under their respective group (e.g., `## UI/UX Standards` under `# Common`,
205
- `## User` under `# System Module`, `## Employer` under `# Business Module`)
206
- - Under each module, bugs are listed as top-level bullet items. Each bug may optionally have a version
207
- tag (e.g., `[v1.0.4]`) on the line immediately before the bug items for that version.
208
-
209
- ```markdown
210
- # Common
211
-
212
- ## UI/UX Standards
213
- [v1.0.4]
214
- - Bug description here
215
- - Priority: High
216
- - Steps to Reproduce:
217
- 1. Step 1
218
- 2. Step 2
219
- - Expected Result: ...
220
-
221
- [v1.0.5]
222
- - Another bug for a different version
223
-
224
- ---
225
-
226
- # System Module
227
-
228
- ## User
229
- [v1.0.5]
230
- - Bug description here
231
-
232
- ---
233
-
234
- ## Notification
235
-
236
- ---
237
-
238
- ## Activities
239
-
240
- ---
241
-
242
- ## Audit Trail
243
-
244
- ---
245
-
246
- ## Document Management
247
-
248
- ---
249
-
250
- # Business Module
251
-
252
- ## Location Information
253
-
254
- ---
255
-
256
- ## Corridor
257
-
258
- ---
259
-
260
- ## Recruitment Step
261
-
262
- ---
263
-
264
- ## Employer
265
-
266
- ---
267
-
268
- ## Recruitment Agent
269
-
270
- ---
271
-
272
- ## Industrial Classification
273
-
274
- ---
275
-
276
- ## Occupation Classification
277
-
278
- ---
279
-
280
- ## Job Demand
281
- [v1.0.6]
282
- - Bug description here
283
-
284
- ---
285
-
286
- ## Candidate Registration
287
- ```
288
-
289
- ### Version Filtering Logic
290
-
291
- - Version tags appear as `[vX.Y.Z]` on their own line within a module section
292
- - When a single `version:` filter is provided, only include bugs that appear AFTER the matching
293
- version tag and BEFORE the next version tag or module header
294
- - When a comma-separated list is provided (e.g., `version:v1.0.3,v1.0.4`), include bugs from
295
- each listed version. Bugs are grouped by version for sequential processing
296
- - When `version:all` or version is omitted, discover ALL `[vX.Y.Z]` tags in BUG.md, collect
297
- bugs from every version, and group them by version for sequential processing
298
- - **Sequential processing**: Regardless of how versions are specified (list, all, omitted),
299
- when multiple versions are resolved, bugs are processed version-by-version in ascending
300
- semver order. All bugs from version N must reach terminal status before version N+1 begins
301
-
302
- ### Module Filtering Logic
303
-
304
- - Module headers are H2 (`## Module Name`) under their parent group (H1) in BUG.md
305
- - The parent groups (`# Common`, `# System Module`, `# Business Module`) are NOT modules themselves
306
- — they are organizational headers
307
- - When `module:` filter is provided, only include bugs under the matching H2 module section
308
- - Module matching: convert filter value to title case for matching (e.g., `location-information`
309
- matches `## Location Information`, `ui-ux-standards` matches `## UI/UX Standards`)
310
- - When no `module:` filter is provided, include ALL modules across all groups
311
-
312
- ## Bug Tagging Convention
313
-
314
- Bug tags follow the format: `BUG-XXX` where `XXX` is a zero-padded running number with interval
315
- of 1, starting from `001`.
316
-
317
- - Tag format: `BUG-001`, `BUG-002`, `BUG-003`, ...
318
- - Tags are inserted as `[BUG-XXX]` at the start of the bug description (after the `- `)
319
- - Only tag bugs that do NOT already have a `[BUG-XXX]` tag
320
- - Scan the entire BUG.md to find the highest existing tag number before assigning new ones
321
- - Continue numbering from the highest existing number + 1
322
-
323
- Example before tagging:
324
- ```markdown
325
- - Table formatting in document management is not consistent...
326
- ```
327
-
328
- Example after tagging:
329
- ```markdown
330
- - [BUG-001] Table formatting in document management is not consistent...
331
- ```
332
-
333
- ## Version Gate
334
-
335
- Before starting any work, check `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`):
336
-
337
- 1. If `<app_folder>/CHANGELOG.md` does not exist, skip this check (first-ever execution for this application).
338
- 2. If `<app_folder>/CHANGELOG.md` exists, scan all `## vX.Y.Z` headings and determine the **highest version** using semantic versioning comparison.
339
- 3. Apply the gate based on the version argument form:
340
- - **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."`
341
- - **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."`
342
- - **`version:all` or omitted**: Skip this check — when processing all discovered versions, historical versions are expected to be present in the source file.
343
-
344
- ## PRD.md Extended Sections
345
-
346
- When fixing bugs, check PRD.md for the following extended sections and use them as diagnostic context:
347
-
348
- ### Design System
349
-
350
- If PRD.md contains a `# Design System` section referencing a `DESIGN_SYSTEM.md` file:
351
- - When fixing UI bugs (wrong color, incorrect styling, layout issues), consult the design system to determine the **correct** appearance before applying a fix
352
- - The design system is the authoritative source for visual expectations
353
-
354
- ### Architecture Principle
355
-
356
- If PRD.md contains an `# Architecture Principle` section:
357
- - Use architectural patterns for root cause analysis context
358
- - If a bug reports "data inconsistency between modules" and architecture declares "event-driven", focus on fixing event handling (retry, idempotency) rather than adding direct cross-module DB queries
359
- - If architecture declares "stateless" and a bug relates to session state, the fix should ensure no server-side session storage
360
-
361
- ### High Level Process Flow
362
-
363
- If PRD.md contains a `# High Level Process Flow` section:
364
- - **Trace the bug against the process flow** to identify which step is failing
365
- - This provides systematic root cause analysis: Was the message received? Validated? Stored? Was the ACK step reached? Which step failed?
366
- - The process flow serves as a step-by-step debugging guide for message-driven bugs
367
-
368
- ---
369
-
370
- ## Workflow
371
-
372
- ### Phase 0: Resume Check (Runs Every Ralph Loop Iteration)
373
-
374
- This phase runs at the START of every iteration, including the first.
375
-
376
- 0. **Ensure Ralph Loop is active (INTERNAL — silent)** — Check if `.claude/ralph-loop.local.md`
377
- exists. If it does NOT exist, silently invoke Ralph Loop using the Skill tool as described
378
- in the "Internal Auto-Start Mechanism" section above. The user should NOT be informed about
379
- this step — it is an internal implementation detail. If the file already exists, skip this step.
380
-
381
- 1. **Use project information from CLAUDE.md (already in context)** — extract JDK path, Maven path, database credentials,
382
- and all infrastructure details. These values are required for every subsequent tool command.
383
-
384
- 2. Check if `<app_folder>/context/bug/BUG_MASTER.md` exists
385
-
386
- 3. If it exists, read it and determine the current state:
387
- - **Resolve the version list** using the Version Resolution rules (same as Phase 1)
388
- - Read the **Version Processing Order** table from BUG_MASTER.md
389
- - **New version detection**: Compare the resolved version list against the versions tracked
390
- in the Version Processing Order table. If BUG.md contains versions that are NOT yet in
391
- the Version Processing Order table (and those versions have bugs matching the module filter):
392
- - These are **new versions added since the last run**
393
- - Add them to the Version Processing Order table with status `NEW`
394
- - Tag any untagged bugs for these new versions (same as Step 1.2)
395
- - Add new version sections with their bug tables to BUG_MASTER.md
396
- - Update the Summary table counts
397
- - Resume processing from the first new version
398
- - Scan the Version Processing Order table for the FIRST version with status != `COMPLETED`
399
- - If ALL versions are `COMPLETED` (and therefore all bugs have terminal status) →
400
- output `<promise>ALL BUGS RESOLVED</promise>` and stop
401
- - Otherwise, within the active version section, find the FIRST bug with status `NEW` or
402
- `IN_PROGRESS`
403
- - Read its `BUG_FIX_PLAN.md` (if exists) for detailed progress
404
- - Resume from the last incomplete step within that version
405
-
406
- 4. If it does not exist, proceed to Phase 1 (fresh start)
407
-
408
- ### Phase 1: Pre-Implementation — Analyze, Tag, and Create Master Checklist
409
-
410
- #### Step 1.1: Read, Resolve Versions, and Filter BUG.md
411
-
412
- 1. Read `<app_folder>/context/BUG.md`
413
- 2. **Resolve the version list** using the Version Resolution rules:
414
- - Single version → `[v1.0.4]`
415
- - Comma-separated → parse and sort ascending by semver → `[v1.0.3, v1.0.4]`
416
- - `all` or omitted → scan BUG.md for ALL `[vX.Y.Z]` tags, deduplicate, sort ascending → `[v1.0.1, v1.0.2, v1.0.3, ...]`
417
- 3. Apply module filter if provided
418
- 4. For each resolved version, identify all bugs that match the filter criteria
419
- 5. Count the total bugs per version and overall
420
-
421
- #### Step 1.2: Tag Untagged Bugs
422
-
423
- 1. Scan the ENTIRE BUG.md for existing `[BUG-XXX]` tags to find the highest number
424
- 2. For each untagged bug (matching the filter), assign the next `[BUG-XXX]` tag
425
- 3. Write the updated BUG.md with new tags applied
426
- 4. **IMPORTANT**: Only tag bugs that do NOT already have a tag. Never modify existing tags.
427
-
428
- #### Step 1.3: Create BUG_MASTER.md
429
-
430
- Create `<app_folder>/context/bug/BUG_MASTER.md` with this structure:
431
-
432
- ```markdown
433
- # Bug Master — <Application Name>
434
-
435
- **Started**: <date>
436
- **Context**: <app_folder>/context
437
- **Resolved Versions**: <comma-separated sorted version list, e.g., "v1.0.3, v1.0.4, v1.0.5">
438
- **Module Filter**: <module or "All">
439
- **Status**: IN PROGRESS
440
-
441
- ---
442
-
443
- ## Version Processing Order
444
-
445
- | # | Version | Bug Count | Status | Started | Completed |
446
- |---|---------|-----------|--------|---------|-----------|
447
- | 1 | v1.0.3 | 3 | NEW | - | - |
448
- | 2 | v1.0.4 | 5 | NEW | - | - |
449
- | 3 | v1.0.5 | 2 | NEW | - | - |
450
-
451
- > **Processing Rule**: All bugs from version N must reach terminal status before version N+1 begins.
452
-
453
- ---
454
-
455
- ## v1.0.3
456
-
457
- ### <Module Name>
458
-
459
- | Code | Description | Status | Remark |
460
- |------|-------------|--------|--------|
461
- | BUG-001 | Short description of the bug | NEW | |
462
- | BUG-002 | Short description of the bug | NEW | |
463
-
464
- ---
465
-
466
- ### <Another Module>
467
-
468
- | Code | Description | Status | Remark |
469
- |------|-------------|--------|--------|
470
- | BUG-003 | Short description of the bug | NEW | |
471
-
472
- ---
473
-
474
- ## v1.0.4
475
-
476
- ### <Module Name>
477
-
478
- | Code | Description | Status | Remark |
479
- |------|-------------|--------|--------|
480
- | BUG-004 | Short description of the bug | NEW | |
481
-
482
- ---
483
-
484
- ## Summary
485
-
486
- | Status | Count |
487
- |--------|-------|
488
- | NEW | X |
489
- | IN_PROGRESS | 0 |
490
- | FIXED | 0 |
491
- | CANNOT_REPRODUCE | 0 |
492
- | HIGH_IMPACT | 0 |
493
- | **Total** | **X** |
494
- ```
495
-
496
- **IMPORTANT — Single version shortcut**: When only a single version is resolved (either
497
- explicitly provided or only one version exists in BUG.md), the BUG_MASTER.md still uses
498
- the same structure above but with only one version section. The Version Processing Order
499
- table will have a single row.
500
-
501
- **IMPORTANT — Version-first organization**: Bugs are grouped by version (H2), then by
502
- module (H3) within each version. This ensures the version-sequential processing order
503
- is visually clear and easy to track.
504
-
505
- **Status Values:**
506
- - `NEW` — Bug has been tagged but not yet worked on
507
- - `IN_PROGRESS` — Bug is currently being investigated/fixed
508
- - `FIXED` — Bug has been fixed and verified
509
- - `CANNOT_REPRODUCE` — Bug could not be reproduced via Playwright
510
- - `HIGH_IMPACT` — Fix would potentially break other working functionalities; deferred
511
-
512
- ### Phase 2: Implementation — Fix Each Bug (Version by Version, One at a Time)
513
-
514
- Process bugs **version by version** in the order defined in the Version Processing Order table:
515
-
516
- 1. Find the FIRST version in the Version Processing Order table with status != `COMPLETED`
517
- 2. Update that version's status to `IN_PROGRESS` and record the start date
518
- 3. Within that version section, find the FIRST bug with status `NEW` or `IN_PROGRESS`
519
- 4. Fix that bug using Steps 2.1–2.8 below
520
- 5. After fixing, check if ALL bugs in the current version have terminal status:
521
- - If YES → mark the version as `COMPLETED` in the Version Processing Order table, record
522
- completion date, and move to the NEXT version (step 1). **If this was the LAST version
523
- (no remaining row with status != `COMPLETED`), IMMEDIATELY also set the top-level
524
- `**Status**:` field to `COMPLETED` in the same edit** — do NOT defer it to Phase 3. The
525
- top-level `**Status**:` line is the ONLY completion signal Compound Context Studio reads; a
526
- BUG_MASTER whose version rows are all `COMPLETED` but whose top-level `**Status**:` still says
527
- `IN PROGRESS` leaves the run stuck "in progress" in the studio.
528
- - If NO → find the next `NEW` bug in the same version and continue
529
- 6. Repeat until ALL versions are `COMPLETED` (at which point the top-level `**Status**:` is already
530
- `COMPLETED` per step 5)
531
-
532
- For each bug with status `NEW` in BUG_MASTER.md (within the current version), in order:
533
-
534
- #### Step 2.1: Initialize Bug Folder
535
-
536
- 1. Update BUG_MASTER.md: set the current bug's status to `IN_PROGRESS`
537
- 2. Create folder: `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/`
538
- 3. This folder will contain all artifacts for this specific bug
539
-
540
- #### Step 2.2: Reproduce the Bug with Playwright
541
-
542
- 1. Read the bug description from BUG.md (including reproduction steps and expected result)
543
- 2. Write a Playwright script to reproduce the bug — save the script file in the bug folder:
544
- `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/reproduce.spec.ts`
545
- 3. In the Playwright script, use **explicit screenshot paths** pointing to the bug folder.
546
- Do NOT rely on Playwright's default screenshot location. Use `page.screenshot()` with an
547
- absolute or project-relative path:
548
- ```typescript
549
- await page.screenshot({
550
- path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_reproduce.png',
551
- fullPage: true
552
- });
553
- ```
554
- 4. Run the Playwright script: `npx playwright test <path-to-script> --config=<playwright-config>`
555
-
556
- **CRITICAL**: Screenshots MUST be saved to `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/`.
557
- Do NOT save screenshots in the application source folder, test output folder, or Playwright's
558
- default results directory. The bug folder in the application's `context/` folder is the single source of truth for all
559
- bug artifacts.
560
-
561
- **IF able to reproduce:**
562
- - Update BUG_MASTER.md remark: "Reproduced successfully"
563
- - Proceed to Step 2.3
564
-
565
- **IF NOT able to reproduce:**
566
- - Update BUG_MASTER.md: set status to `CANNOT_REPRODUCE`, add remark with details
567
- - Save the screenshot showing the current (non-buggy) state to the bug folder
568
- - Move to the next bug
569
-
570
- #### Step 2.3: Write Test Spec
571
-
572
- Create `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/BUG_TEST_SPEC.md`:
573
-
574
- ```markdown
575
- # Test Spec — <BUG-XXX>
576
-
577
- **Bug**: <Short description>
578
- **Module**: <Module Name>
579
- **Reproduced**: Yes
580
-
581
- ---
582
-
583
- ## Pre-Conditions
584
-
585
- - <List any required state, data, or login credentials>
586
-
587
- ## Steps to Verify Fix
588
-
589
- 1. <Step-by-step instructions to verify the bug is fixed>
590
- 2. <Navigate to...>
591
- 3. <Assert that...>
592
-
593
- ## Expected Result After Fix
594
-
595
- - <What the user should see when the bug is fixed>
596
-
597
- ## Playwright Verification Script
598
-
599
- ```typescript
600
- // Playwright test to verify the fix
601
- test('<BUG-XXX>: <description>', async ({ page }) => {
602
- // Steps to verify...
603
-
604
- // IMPORTANT: Save screenshots to the bug folder, NOT the source folder
605
- await page.screenshot({
606
- path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_fixed.png',
607
- fullPage: true
608
- });
609
- });
610
- ```
611
- ```
612
-
613
- #### Step 2.4: Analyze and Plan the Fix
614
-
615
- 1. Analyze the bug in detail — read relevant source code, templates, configurations
616
- 2. Determine the root cause
617
- 3. Plan how to fix it
618
- 4. Assess impact on other functionalities
619
-
620
- Create `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/BUG_FIX_PLAN.md`:
621
-
622
- ```markdown
623
- # Fix Plan — <BUG-XXX>
624
-
625
- **Bug**: <Short description>
626
- **Module**: <Module Name>
627
- **Root Cause**: <What is causing the bug>
628
- **Impact Assessment**: <Low/Medium/High — does fixing this affect other features?>
629
-
630
- ---
631
-
632
- ## Fix Checklist
633
-
634
- - [ ] 1. <First change to make>
635
- - [ ] 2. <Second change to make>
636
- - [ ] 3. Verify fix with BUG_TEST_SPEC.md
637
- - [ ] 4. Update artifacts (mockups/specs/models/user stories)
638
-
639
- ---
640
-
641
- ## Files to Modify
642
-
643
- | File | Change Description |
644
- |------|-------------------|
645
- | `path/to/file.jte` | Fix table styling |
646
- | `path/to/file.java` | Update method logic |
647
-
648
- ---
649
-
650
- ## Fix Log
651
-
652
- ### Step 1: <description>
653
- <timestamp> - Started
654
- - Changes made: ...
655
- - Result: ...
656
- ```
657
-
658
- **IF the fix potentially affects other working functionalities (HIGH_IMPACT):**
659
- - Update BUG_MASTER.md: set status to `HIGH_IMPACT`, add remark explaining the risk
660
- - Record the analysis in BUG_FIX_PLAN.md
661
- - Do NOT apply the fix
662
- - Move to the next bug
663
-
664
- **IF safe to fix:**
665
- - Proceed to Step 2.5
666
-
667
- #### Step 2.5: Apply the Fix
668
-
669
- 1. Make the code changes as planned in BUG_FIX_PLAN.md
670
- 2. **Annotate the fix in source (MANDATORY)** — On EACH method, block, or template region
671
- modified by the fix, leave a `[BUG-XXX]` marker comment using the language's native
672
- comment style:
673
- - Java method: prepend a Javadoc line `* [BUG-XXX] <one-line description>` (or extend
674
- the existing Javadoc if the method already has one)
675
- - PHP / TypeScript / JavaScript: same pattern with PHPDoc / JSDoc
676
- - Blade template: `{{-- [BUG-XXX] <description> --}}` immediately above the changed block
677
- - JTE template: `@* [BUG-XXX] <description> *@` immediately above the changed block
678
- - HTML / SQL: `<!-- [BUG-XXX] <description> -->` / `-- [BUG-XXX] <description>`
679
- - YAML / `.env` / `.properties`: `# [BUG-XXX] <description>` above the changed key
680
-
681
- Example (Java service method):
682
- ```java
683
- /**
684
- * [BUG-024] Trim leading whitespace from corridor code before lookup.
685
- */
686
- public Corridor findByCode(String code) { ... }
687
- ```
688
-
689
- The marker enables `git blame` and IDE search to trace any modified line back to
690
- BUG.md without consulting BUG_FIX_PLAN.md.
691
- 3. **Append to top-of-file traceability comment (if present)** — If the modified file
692
- already carries a top-of-file traceability comment (from `conductor-feature-develop`'s
693
- code-level traceability rule), append the `[BUG-XXX]` code to its `Bug fixes:` line,
694
- creating the line if it does not yet exist. Use the `USHM#####` / `NFRHM####` /
695
- `CONSHM###` / `REFHM####` codes already present in the file — do NOT change them:
696
- ```java
697
- /**
698
- * Implements: USHM00003, USHM00006
699
- * NFR: NFRHM0003
700
- * Bug fixes: [BUG-024]
701
- */
702
- public class CorridorService { ... }
703
- ```
704
- 4. Update BUG_FIX_PLAN.md: check off completed items, log changes in the Fix Log section
705
-
706
- #### Step 2.6: Verify the Fix
707
-
708
- 1. Run the verification from BUG_TEST_SPEC.md (Playwright test)
709
- 2. Capture post-fix screenshot using an explicit path in the Playwright script:
710
- ```typescript
711
- await page.screenshot({
712
- path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_fixed.png',
713
- fullPage: true
714
- });
715
- ```
716
- Do NOT save screenshots in the application source folder — always use the bug folder under `<app_folder>/context/`.
717
-
718
- **IF verified (test passes):**
719
- - Update BUG_MASTER.md: set status to `FIXED`
720
- - Update BUG_FIX_PLAN.md: mark all checklist items as completed
721
- - Proceed to Step 2.7
722
-
723
- **IF NOT verified (test fails):**
724
- - Log the failure in BUG_FIX_PLAN.md
725
- - Go back to Step 2.4 to re-analyze and re-plan
726
- - Apply a different fix approach
727
-
728
- #### Step 2.7: Update Related Artifacts
729
-
730
- Analyze the fix to determine which artifacts need updating:
731
-
732
- **A. UI Fix → Update Mockups**
733
-
734
- If the fix changed the visual appearance (HTML/CSS/layout changes in JTE templates):
735
- 1. Navigate to `<app_folder>/context/mockup/` and find the relevant module screens
736
- 2. Update the HTML mockup files to reflect the fix
737
- 3. Log the mockup changes in BUG_FIX_PLAN.md
738
-
739
- **B. Code Logic Fix → Update Specifications**
740
-
741
- If the fix involved code logic changes (service layer, controller logic, validation):
742
- 1. Navigate to `<app_folder>/context/specification/<module-slug>/`
743
- 2. Update the SPEC.md to reflect the changed behavior
744
- 3. Log the specification changes in BUG_FIX_PLAN.md
745
-
746
- **C. Module Model Fix → Update Models**
747
-
748
- If the fix involved module model changes (new/removed fields, collection changes):
749
- 1. Navigate to `<app_folder>/context/model/<module-slug>/`
750
- 2. Update `model.md`, `schemas.json`, and `document-model.mermaid` as needed
751
- 3. Log the model changes in BUG_FIX_PLAN.md
752
-
753
- **D. Record in PRD.md**
754
-
755
- If the bug fix is NOT already documented in PRD.md:
756
- 1. Open `<app_folder>/context/PRD.md`
757
- 2. Find the specific module section
758
- 3. Look for a `### Bug` section (positioned AFTER the `### Reference` section)
759
- 4. If the `### Bug` section does NOT exist, create one after `### Reference`
760
- 5. Add the version tag on the line immediately after the `### Bug` header, using the bug's
761
- version from BUG.md (e.g., `[v1.0.3]`). This follows the same format as all other sections
762
- in PRD.md (User Story, Non Functional Requirement, Constraint, Reference) where the
763
- version tag `[vX.Y.Z]` appears on its own line directly after the `###` header.
764
- 6. Add a new bullet point with the bug tag and fix description after the version tag:
765
- ```markdown
766
- ### Bug
767
- [v1.0.3]
768
- - [BUG-001] Fixed table formatting inconsistency between document management and location information screens
769
- ```
770
- 7. If the `### Bug` section already exists:
771
- - Check if the bug's version tag already appears in the section
772
- - If the version tag already exists, append the new bug fix bullet point under that version
773
- - If the version tag does NOT exist, add the new version tag and bullet point after the
774
- last existing entry (following the same multi-version pattern used in other sections):
775
- ```markdown
776
- ### Bug
777
- [v1.0.3]
778
- - [BUG-001] Fixed table formatting inconsistency
779
- [v1.0.4]
780
- - [BUG-003] Fixed another issue
781
- ```
782
-
783
- #### Step 2.8: Record Summary in BUG_MASTER.md
784
-
785
- 1. Update the bug's `Remark` column with a brief summary of what was fixed
786
- 2. Include chain effects (what other artifacts were updated)
787
- 3. Update the Summary table counts
788
- 4. Move to the next bug with status `NEW`
789
-
790
- ### Phase 3: Completion
791
-
792
- After all bugs have been processed (every bug has a terminal status):
793
-
794
- 1. Update BUG_MASTER.md:
795
- - Ensure the top-level `**Status**:` field reads `COMPLETED` (Phase 2 step 5 already sets it when
796
- the last version completes confirm it here as a backstop; the studio reads ONLY this line)
797
- - Update all Summary table counts
798
- 2. **Regenerate the traceability matrix** so the new `[BUG-XXX]` source markers (Step 2.5) and any
799
- code changes are reflected in the requirement-to-code links:
800
- ```
801
- Skill(skill: "co2-skills:tracegen-matrix", args: "<app_folder> version:<highest-version-processed>")
802
- ```
803
- - If a `module` filter was active for this run, pass it through: append ` module:<module>`.
804
- - It updates `<app_folder>/context/TRACEABILITY.md` and appends its own `CHANGELOG.md` row.
805
- - This does **not** require the codebase-memory MCP — `tracegen-matrix` resolves links from the
806
- in-source traceability / `[BUG-XXX]` comments, with a name-based source-scan fallback.
807
- 3. Append entries to `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`) — **one entry per version processed**:
808
- - Read `<app_folder>/CHANGELOG.md`. If it does not exist, create it with context header.
809
- - For EACH version in the resolved version list (ascending order):
810
- - Search for a `## {version}` heading matching this version.
811
- - If the section **exists**: append a new row to its table.
812
- - 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.
813
- - Row format: `| {YYYY-MM-DD} | {application_name} | conductor-defect | {module or "All"} | Fixed {count} bugs ({list of BUG codes for this version}) |`
814
- - **Never modify or delete existing rows.**
815
- 4. Output the Ralph Loop completion promise: `<promise>ALL BUGS RESOLVED</promise>`
816
-
817
- ## Critical Rules
818
-
819
- 1. **CLAUDE.md is the source of truth for all tool commands** — CLAUDE.md is automatically
820
- loaded into context. Use the exact JDK path, Maven path, database credentials,
821
- and all other infrastructure details from CLAUDE.md. NEVER hardcode or guess paths.
822
-
823
- 2. **One bug at a time** — Fix bugs sequentially. Complete all steps for one bug before moving
824
- to the next. Never work on multiple bugs simultaneously.
825
-
826
- 3. **BUG_MASTER.md is the master checkpoint** — Ralph Loop uses BUG_MASTER.md to determine
827
- which bugs have been fixed and which are pending. Always keep it up to date. For detailed
828
- status of each bug, refer to the BUG_FIX_PLAN.md in each bug's folder.
829
-
830
- 4. **Never skip reproduction** — Always attempt to reproduce the bug with Playwright first.
831
- If it can't be reproduced, mark it as `CANNOT_REPRODUCE` and move on.
832
-
833
- 5. **HIGH_IMPACT defers, not blocks** — If a fix would break other features, mark it as
834
- `HIGH_IMPACT` and move to the next bug. Do not attempt risky fixes.
835
-
836
- 6. **Track everything** — Every action should be logged in BUG_FIX_PLAN.md so that any
837
- future session (or Ralph Loop iteration) can understand what was done and what remains.
838
-
839
- 7. **Preserve existing tags** — Never modify or remove existing `[BUG-XXX]` tags in BUG.md.
840
- Only add new tags to untagged bugs.
841
-
842
- 8. **Update artifacts faithfully** — When a fix changes UI, logic, or models, update the
843
- corresponding mockups, specifications, and module models. Keep all artifacts in sync.
844
-
845
- 9. **Context window awareness** — If approaching context limits, save progress to
846
- BUG_MASTER.md and BUG_FIX_PLAN.md. Ralph Loop will resume from where you left off.
847
-
848
- 10. **Ralph Loop discipline — NEVER stop prematurely** — After fixing one bug, IMMEDIATELY
849
- check for the next `NEW` bug and start it. Do NOT stop "to let the user review". The only
850
- valid reasons to stop within an iteration are: (a) context window approaching limit,
851
- (b) all bugs resolved (output promise), or (c) an unrecoverable error requiring user input.
852
-
853
- 11. **Auto-start Ralph Loop (INTERNAL)** — The FIRST action MUST be to silently check if Ralph
854
- Loop is active (`.claude/ralph-loop.local.md` exists). If not, silently invoke it using the
855
- Skill tool. The user should NEVER be asked to start Ralph Loop manually — this is an internal
856
- implementation detail handled entirely by the skill. Do NOT mention Ralph Loop to the user.
857
-
858
- 12. **NO creative alternatives for 3rd party applications (CRITICAL)** — Use the EXACT methods,
859
- connection strings, CLIs, and credentials described in `CLAUDE.md`. NEVER use Docker
860
- containers, alternative databases, or different CLIs than what CLAUDE.md specifies.
861
-
862
- 13. **Screenshots MUST be saved in the bug folder (CRITICAL)** — All Playwright screenshots
863
- (reproduction, verification, fixed) MUST be saved to
864
- `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/` using explicit `page.screenshot({ path: ... })`
865
- calls. NEVER save screenshots in the application source folder, Playwright's default test-results
866
- directory, or any other location. The Playwright script files themselves should also be saved in
867
- the bug folder, not in the source tree.
868
-
869
- 14. **Spring Boot `app:` namespace for new configuration (CRITICAL)** — When a bug fix
870
- introduces a new configuration value in a Spring Boot application, that value MUST be
871
- added under the top-level `app:` key in `application.yml`. NEVER place new
872
- application-specific keys at the YAML root (e.g., top-level `notification:`,
873
- `batch-job:`, `audit-trail:`) and NEVER place them under Spring framework namespaces
874
- (`spring.*`, `server.*`, `management.*`, `logging.*`, `springdoc.*`).
875
-
876
- **Grouping:**
877
- - Cross-cutting values (version, CORS, shared security, shared messaging, shared
878
- object-storage) sit directly under `app.*` with no module prefix.
879
- - Per-module values MUST be grouped under `app.<module-kebab-case>.*`, one block
880
- per module. If the module does not yet have an `app.<module>` block, create one.
881
-
882
- **Binding:** bind every new `app.*` value via a `@ConfigurationProperties` record in
883
- the owning module's `config` subpackage. If a record already exists for that module,
884
- extend it rather than creating a second one. NEVER introduce `@Value("${app....}")`
885
- injections as a shortcut. Use kebab-case in YAML.
886
-
887
- **If the bug fix touches code that currently reads configuration from a root-level
888
- YAML key or a framework namespace, relocate the config under `app:` as part of the
889
- fix** — do not leave the violation in place. Update the `application.yml`, the Java
890
- `@ConfigurationProperties` prefix, any `@Value` references, and any tests that use
891
- `@TestPropertySource` or `@SpringBootTest(properties = ...)`. See SPECIFICATION.md
892
- section "Application-Specific Configuration (`app:` namespace)" for the rules.
893
-
894
- 15. **Code-level bug traceability is MANDATORY** — Every method, block, or template region
895
- modified by a bug fix MUST carry a `[BUG-XXX]` marker comment using the language's
896
- native comment style (Javadoc / PHPDoc / JSDoc / `{{-- --}}` / `@* *@` / `<!-- -->` /
897
- `#`). When a modified file already carries a top-of-file traceability comment from
898
- `conductor-feature-develop`, append the `[BUG-XXX]` code to its `Bug fixes:` line
899
- (creating the line if it does not yet exist). See Step 2.5 for the exact comment
900
- formats per language.
901
-
902
- **Why**: `git blame` and IDE search must surface the originating bug for any fix line
903
- directly, without consulting BUG_FIX_PLAN.md (which is a transient tracking file).
904
- PRD.md's `### Bug` section captures **what** was fixed; the in-source `[BUG-XXX]`
905
- marker captures **where** — both are required for end-to-end traceability.
1
+ ---
2
+ name: conductor-defect
3
+ model: claude-opus-4-8
4
+ effort: high
5
+ description: >
6
+ Fix bugs reported by humans from a BUG.md file. Takes an application name (mandatory),
7
+ version (optional — supports single version, comma-separated list, "all", or omit for all),
8
+ and module (optional), resolves the context folder automatically from root-level application
9
+ folders. When multiple versions are provided (or "all"/omitted), versions are processed
10
+ SEQUENTIALLY in ascending semver order — all bugs from version N are fully resolved before
11
+ version N+1 begins. Tags untagged bugs, creates a BUG_MASTER.md tracking checklist, then
12
+ fixes each bug one at a time: reproduce with Playwright, write a test spec, plan the fix,
13
+ apply the fix, verify, and update related artifacts (mockups, specifications, module models,
14
+ user stories). Integrates with Ralph Loop to ensure all bugs are fully fixed across sessions.
15
+ Use this skill when the user asks to "fix bugs", "fix bug", "start bug fixing", "resolve bugs
16
+ from BUG.md", "bug fix session", or any request to systematically fix bugs from a BUG.md file.
17
+ Also trigger when user says "resume bug fixing" to continue from where a previous session left
18
+ off using BUG_MASTER.md progress file.
19
+ ---
20
+
21
+ # Bug Fixer
22
+
23
+ Fix bugs reported by humans one at a time, tracked via BUG_MASTER.md and per-bug BUG_FIX_PLAN.md.
24
+
25
+ ## Ralph Loop Integration (INTERNAL — FULLY AUTOMATIC)
26
+
27
+ This skill internally manages Ralph Loop. The user does NOT need to invoke `/ralph-loop` or know
28
+ about Ralph Loop at all. The skill handles starting, iterating, and completing the loop transparently.
29
+
30
+ ### Internal Auto-Start Mechanism
31
+
32
+ When this skill is invoked (e.g., `/conductor-defect hub_middleware version:v1.0.4`), the
33
+ **very first action** — before reading any files, before Phase 0, before ANYTHING — is to
34
+ silently start Ralph Loop by invoking the Skill tool internally:
35
+
36
+ ```
37
+ Skill(skill: "ralph-loop:ralph-loop", args: "<original-user-invocation-with-all-args> --completion-promise \"ALL BUGS RESOLVED\" --max-iterations 50")
38
+ ```
39
+
40
+ **Construction rule**: Take the EXACT text the user typed (e.g., `/conductor-defect hub_middleware
41
+ version:v1.0.4 module:location-information`) and pass it as the `args` value, appending the
42
+ `--completion-promise` and `--max-iterations` flags.
43
+
44
+ | User types | Ralph Loop args |
45
+ |------------|----------------|
46
+ | `/conductor-defect hub_middleware` | `/conductor-defect hub_middleware --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
47
+ | `/conductor-defect hub_middleware version:v1.0.4` | `/conductor-defect hub_middleware version:v1.0.4 --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
48
+ | `/conductor-defect hub_middleware version:v1.0.3,v1.0.4` | `/conductor-defect hub_middleware version:v1.0.3,v1.0.4 --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
49
+ | `/conductor-defect hub_middleware version:all` | `/conductor-defect hub_middleware version:all --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
50
+ | `/conductor-defect hub_middleware version:v1.0.4 module:location-information` | `/conductor-defect hub_middleware version:v1.0.4 module:location-information --completion-promise "ALL BUGS RESOLVED" --max-iterations 50` |
51
+
52
+ **Skip if already active**: If `.claude/ralph-loop.local.md` already exists, Ralph Loop is
53
+ already running (this is a resumed iteration). Do NOT re-invoke — proceed directly to Phase 0.
54
+
55
+ **BLOCKING**: Do NOT proceed with ANY work until Ralph Loop is confirmed active (either freshly
56
+ started or already running from a previous iteration).
57
+
58
+ ### How It Works (Transparent to User)
59
+
60
+ 1. User invokes `/conductor-defect` with their arguments — they never see or interact with Ralph Loop
61
+ 2. This skill silently starts Ralph Loop with the conductor-defect prompt as the loop body
62
+ 3. On each iteration, the agent reads BUG_MASTER.md to find the next unresolved bug
63
+ 4. The agent fixes one or more bugs until context runs out or all bugs are resolved
64
+ 5. When the agent tries to exit, Ralph Loop re-feeds the same prompt automatically
65
+ 6. The next iteration resumes from where the last one left off (tracked in BUG_MASTER.md)
66
+ 7. When ALL bugs are resolved, the agent outputs the completion promise to exit the loop
67
+ 8. The user only sees bug-fixing progress — Ralph Loop is an invisible persistence layer
68
+
69
+ ### Completion Promise
70
+
71
+ When ALL bugs in BUG_MASTER.md have a terminal status (`FIXED`, `CANNOT_REPRODUCE`, or
72
+ `HIGH_IMPACT`), output the following promise tag to signal Ralph Loop that bug fixing is done:
73
+
74
+ ```
75
+ <promise>ALL BUGS RESOLVED</promise>
76
+ ```
77
+
78
+ **CRITICAL**: Only output this promise when EVERY bug in BUG_MASTER.md has a terminal status.
79
+ Do NOT output the promise prematurely. Do NOT output it to escape the loop.
80
+
81
+ ### Iteration Awareness (Internal)
82
+
83
+ At the START of every iteration (including the first), the agent MUST:
84
+ 1. Check if Ralph Loop is already active (if `.claude/ralph-loop.local.md` exists, skip re-invoking)
85
+ 2. If NOT active, silently invoke Ralph Loop as described above
86
+ 3. Read BUG_MASTER.md to determine what is already resolved
87
+ 4. Find the FIRST bug with status `NEW` or `IN_PROGRESS`
88
+ 5. If that bug has a BUG_FIX_PLAN.md, read it to find the last incomplete step
89
+ 6. Resume from exactly that point — do NOT re-fix already-resolved bugs
90
+ 7. If ALL bugs have terminal status, output the completion promise and stop
91
+
92
+ ## Inputs
93
+
94
+ The skill expects these arguments:
95
+
96
+ ```
97
+ /conductor-defect <application> [version:<version>] [module:<module>]
98
+ ```
99
+
100
+ | Argument | Required | Example | Description |
101
+ |----------|----------|---------|-------------|
102
+ | `<application>` | Yes | `hub_middleware` | Application name to locate the context folder |
103
+ | `version:<version>` | No | `version:v1.0.4` or `version:v1.0.3,v1.0.4` or `version:all` | Filter bugs by version. Supports single version, comma-separated list, `all`, or omit for all versions. Multiple versions are processed sequentially in ascending semver order |
104
+ | `module:<module>` | No | `module:location-information` | Filter bugs by module |
105
+
106
+ ### Input Resolution
107
+
108
+ The application name is matched against root-level application folders:
109
+ 1. Strip any leading `<number>_` prefix from folder names
110
+ 2. Match case-insensitively
111
+ 3. Accept snake_case, kebab-case, or title-case input
112
+ 4. If no match found, list available applications and stop
113
+
114
+ ### Auto-Resolved Paths
115
+
116
+ | File | Resolved Path |
117
+ |------|---------------|
118
+ | BUG.md | `<app_folder>/context/BUG.md` |
119
+ | PRD.md | `<app_folder>/context/PRD.md` |
120
+ | Bug Tracking Output | `<app_folder>/context/bug/` |
121
+ | Module Models | `<app_folder>/context/model/` |
122
+ | HTML Mockups | `<app_folder>/context/mockup/` |
123
+ | Specifications | `<app_folder>/context/specification/` |
124
+
125
+ ### Argument Combinations
126
+
127
+ | Provided | Behavior |
128
+ |----------|----------|
129
+ | `<application>` only | All versions (sequential, ascending semver), all modules |
130
+ | `<application>` + `version:v1.0.4` | Single version, all modules |
131
+ | `<application>` + `version:v1.0.3,v1.0.4` | Multiple versions (sequential, ascending semver), all modules |
132
+ | `<application>` + `version:all` | All versions (sequential, ascending semver), all modules |
133
+ | Any above + `module:<module>` | Same as above, filtered to specific module |
134
+
135
+ ### Version Resolution
136
+
137
+ The `version:` argument supports four forms:
138
+
139
+ | Form | Example | Behavior |
140
+ |------|---------|----------|
141
+ | Single version | `version:v1.0.3` | Process only v1.0.3 |
142
+ | Comma-separated list | `version:v1.0.1,v1.0.2,v1.0.3` | Process each version sequentially in ascending semver order |
143
+ | Explicit all | `version:all` | Discover all versions from BUG.md, process sequentially in ascending semver order |
144
+ | Omitted | _(no version arg)_ | Same as `version:all` |
145
+
146
+ #### Version Discovery
147
+
148
+ When `version:all` or omitted:
149
+ 1. Scan BUG.md for all `[vX.Y.Z]` version tags across all module sections
150
+ 2. Collect unique versions
151
+ 3. Sort in ascending semantic version order (v1.0.0 < v1.0.1 < v1.1.0 < v2.0.0)
152
+ 4. This becomes the ordered version list for sequential processing
153
+
154
+ #### Sequential Version Processing Rule
155
+
156
+ **Versions are ALWAYS processed one at a time, in ascending semver order.** All bugs from
157
+ version N must be fully resolved (terminal status: `FIXED`, `CANNOT_REPRODUCE`, or `HIGH_IMPACT`)
158
+ before ANY bug from version N+1 is started. This ensures:
159
+ - Bug fixes from earlier versions are in place before later version bugs are addressed
160
+ - The codebase is progressively stabilized version by version
161
+ - Each version's fixes build on a stable foundation from prior versions
162
+
163
+ ### Context Folder Structure (Expected)
164
+
165
+ ```
166
+ <app_folder>/context/
167
+ BUG.md # Bug reports grouped by module, optionally versioned
168
+ PRD.md # User stories (for recording bug fixes)
169
+ bug/ # Bug tracking folder (BUG_MASTER.md + per-module subfolders)
170
+ BUG_MASTER.md # Master checklist (created by this skill)
171
+ <module-slug>/ # Per-module folder
172
+ <BUG-XXX>/ # Per-bug folder (named by bug tag)
173
+ screenshot_*.png # Reproduction screenshots
174
+ BUG_TEST_SPEC.md # Test spec for verification
175
+ BUG_FIX_PLAN.md # Fix plan with checklist
176
+ model/ # Module models (updated if fix involves model changes)
177
+ mockup/ # HTML mockups (updated if fix involves UI changes)
178
+ specification/ # Technical specifications (updated if fix involves logic changes)
179
+ ```
180
+
181
+ ## Pre-Requisite: Project Information from CLAUDE.md (MANDATORY)
182
+
183
+ **CLAUDE.md is automatically loaded into context** at the start of every session. It contains
184
+ project details, infrastructure paths, credentials, and configuration. You do NOT need to read
185
+ it manually — the information is already available in your context.
186
+
187
+ **Before executing ANY tool command** (Maven build, Spring Boot run, database CLI, Keycloak CLI,
188
+ Playwright test, npm start, etc.), use the following from CLAUDE.md (already in context):
189
+
190
+ - **JDK path** — Use the exact `JAVA_HOME` path specified in CLAUDE.md
191
+ - **Maven path** — Use the exact Maven binary path specified in CLAUDE.md
192
+ - **Database credentials** — Host, port, username, password
193
+ - **Keycloak configuration** — Host, admin credentials, CLI path
194
+ - **Any other infrastructure details** — Ports, URLs, connection strings
195
+
196
+ **WHY**: CLAUDE.md contains the actual system paths, credentials, and configuration for the
197
+ developer's machine. Every shell command MUST use the values from CLAUDE.md.
198
+
199
+ ## BUG.md Format
200
+
201
+ The BUG.md file follows a hierarchical structure mirroring the module structure in CLAUDE.md:
202
+
203
+ - **Top-level groups** are H1 headers: `# Common`, `# System Module`, `# Business Module`
204
+ - **Modules** are H2 headers under their respective group (e.g., `## UI/UX Standards` under `# Common`,
205
+ `## User` under `# System Module`, `## Employer` under `# Business Module`)
206
+ - Under each module, bugs are listed as top-level bullet items. Each bug may optionally have a version
207
+ tag (e.g., `[v1.0.4]`) on the line immediately before the bug items for that version.
208
+
209
+ ```markdown
210
+ # Common
211
+
212
+ ## UI/UX Standards
213
+ [v1.0.4]
214
+ - Bug description here
215
+ - Priority: High
216
+ - Steps to Reproduce:
217
+ 1. Step 1
218
+ 2. Step 2
219
+ - Expected Result: ...
220
+
221
+ [v1.0.5]
222
+ - Another bug for a different version
223
+
224
+ ---
225
+
226
+ # System Module
227
+
228
+ ## User
229
+ [v1.0.5]
230
+ - Bug description here
231
+
232
+ ---
233
+
234
+ ## Notification
235
+
236
+ ---
237
+
238
+ ## Activities
239
+
240
+ ---
241
+
242
+ ## Audit Trail
243
+
244
+ ---
245
+
246
+ ## Document Management
247
+
248
+ ---
249
+
250
+ # Business Module
251
+
252
+ ## Location Information
253
+
254
+ ---
255
+
256
+ ## Corridor
257
+
258
+ ---
259
+
260
+ ## Recruitment Step
261
+
262
+ ---
263
+
264
+ ## Employer
265
+
266
+ ---
267
+
268
+ ## Recruitment Agent
269
+
270
+ ---
271
+
272
+ ## Industrial Classification
273
+
274
+ ---
275
+
276
+ ## Occupation Classification
277
+
278
+ ---
279
+
280
+ ## Job Demand
281
+ [v1.0.6]
282
+ - Bug description here
283
+
284
+ ---
285
+
286
+ ## Candidate Registration
287
+ ```
288
+
289
+ ### Version Filtering Logic
290
+
291
+ - Version tags appear as `[vX.Y.Z]` on their own line within a module section
292
+ - When a single `version:` filter is provided, only include bugs that appear AFTER the matching
293
+ version tag and BEFORE the next version tag or module header
294
+ - When a comma-separated list is provided (e.g., `version:v1.0.3,v1.0.4`), include bugs from
295
+ each listed version. Bugs are grouped by version for sequential processing
296
+ - When `version:all` or version is omitted, discover ALL `[vX.Y.Z]` tags in BUG.md, collect
297
+ bugs from every version, and group them by version for sequential processing
298
+ - **Sequential processing**: Regardless of how versions are specified (list, all, omitted),
299
+ when multiple versions are resolved, bugs are processed version-by-version in ascending
300
+ semver order. All bugs from version N must reach terminal status before version N+1 begins
301
+
302
+ ### Module Filtering Logic
303
+
304
+ - Module headers are H2 (`## Module Name`) under their parent group (H1) in BUG.md
305
+ - The parent groups (`# Common`, `# System Module`, `# Business Module`) are NOT modules themselves
306
+ — they are organizational headers
307
+ - When `module:` filter is provided, only include bugs under the matching H2 module section
308
+ - Module matching: convert filter value to title case for matching (e.g., `location-information`
309
+ matches `## Location Information`, `ui-ux-standards` matches `## UI/UX Standards`)
310
+ - When no `module:` filter is provided, include ALL modules across all groups
311
+
312
+ ## Bug Tagging Convention
313
+
314
+ Bug tags follow the format: `BUG-XXX` where `XXX` is a zero-padded running number with interval
315
+ of 1, starting from `001`.
316
+
317
+ - Tag format: `BUG-001`, `BUG-002`, `BUG-003`, ...
318
+ - Tags are inserted as `[BUG-XXX]` at the start of the bug description (after the `- `)
319
+ - Only tag bugs that do NOT already have a `[BUG-XXX]` tag
320
+ - Scan the entire BUG.md to find the highest existing tag number before assigning new ones
321
+ - Continue numbering from the highest existing number + 1
322
+
323
+ Example before tagging:
324
+ ```markdown
325
+ - Table formatting in document management is not consistent...
326
+ ```
327
+
328
+ Example after tagging:
329
+ ```markdown
330
+ - [BUG-001] Table formatting in document management is not consistent...
331
+ ```
332
+
333
+ ## Version Gate
334
+
335
+ Before starting any work, check `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`):
336
+
337
+ 1. If `<app_folder>/CHANGELOG.md` does not exist, skip this check (first-ever execution for this application).
338
+ 2. If `<app_folder>/CHANGELOG.md` exists, scan all `## vX.Y.Z` headings and determine the **highest version** using semantic versioning comparison.
339
+ 3. Apply the gate based on the version argument form:
340
+ - **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."`
341
+ - **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."`
342
+ - **`version:all` or omitted**: Skip this check — when processing all discovered versions, historical versions are expected to be present in the source file.
343
+
344
+ ## PRD.md Extended Sections
345
+
346
+ When fixing bugs, check PRD.md for the following extended sections and use them as diagnostic context:
347
+
348
+ ### Design System
349
+
350
+ If PRD.md contains a `# Design System` section referencing a `DESIGN_SYSTEM.md` file:
351
+ - When fixing UI bugs (wrong color, incorrect styling, layout issues), consult the design system to determine the **correct** appearance before applying a fix
352
+ - The design system is the authoritative source for visual expectations
353
+
354
+ ### Architecture Principle
355
+
356
+ If PRD.md contains an `# Architecture Principle` section:
357
+ - Use architectural patterns for root cause analysis context
358
+ - If a bug reports "data inconsistency between modules" and architecture declares "event-driven", focus on fixing event handling (retry, idempotency) rather than adding direct cross-module DB queries
359
+ - If architecture declares "stateless" and a bug relates to session state, the fix should ensure no server-side session storage
360
+
361
+ ### High Level Process Flow
362
+
363
+ If PRD.md contains a `# High Level Process Flow` section:
364
+ - **Trace the bug against the process flow** to identify which step is failing
365
+ - This provides systematic root cause analysis: Was the message received? Validated? Stored? Was the ACK step reached? Which step failed?
366
+ - The process flow serves as a step-by-step debugging guide for message-driven bugs
367
+
368
+ ---
369
+
370
+ ## Workflow
371
+
372
+ ### Phase 0: Resume Check (Runs Every Ralph Loop Iteration)
373
+
374
+ This phase runs at the START of every iteration, including the first.
375
+
376
+ 0. **Ensure Ralph Loop is active (INTERNAL — silent)** — Check if `.claude/ralph-loop.local.md`
377
+ exists. If it does NOT exist, silently invoke Ralph Loop using the Skill tool as described
378
+ in the "Internal Auto-Start Mechanism" section above. The user should NOT be informed about
379
+ this step — it is an internal implementation detail. If the file already exists, skip this step.
380
+
381
+ 1. **Use project information from CLAUDE.md (already in context)** — extract JDK path, Maven path, database credentials,
382
+ and all infrastructure details. These values are required for every subsequent tool command.
383
+
384
+ 2. Check if `<app_folder>/context/bug/BUG_MASTER.md` exists
385
+
386
+ 3. If it exists, read it and determine the current state:
387
+ - **Resolve the version list** using the Version Resolution rules (same as Phase 1)
388
+ - Read the **Version Processing Order** table from BUG_MASTER.md
389
+ - **New version detection**: Compare the resolved version list against the versions tracked
390
+ in the Version Processing Order table. If BUG.md contains versions that are NOT yet in
391
+ the Version Processing Order table (and those versions have bugs matching the module filter):
392
+ - These are **new versions added since the last run**
393
+ - Add them to the Version Processing Order table with status `NEW`
394
+ - Tag any untagged bugs for these new versions (same as Step 1.2)
395
+ - Add new version sections with their bug tables to BUG_MASTER.md
396
+ - Update the Summary table counts
397
+ - Resume processing from the first new version
398
+ - Scan the Version Processing Order table for the FIRST version with status != `COMPLETED`
399
+ - If ALL versions are `COMPLETED` (and therefore all bugs have terminal status) →
400
+ output `<promise>ALL BUGS RESOLVED</promise>` and stop
401
+ - Otherwise, within the active version section, find the FIRST bug with status `NEW` or
402
+ `IN_PROGRESS`
403
+ - Read its `BUG_FIX_PLAN.md` (if exists) for detailed progress
404
+ - Resume from the last incomplete step within that version
405
+
406
+ 4. If it does not exist, proceed to Phase 1 (fresh start)
407
+
408
+ ### Phase 1: Pre-Implementation — Analyze, Tag, and Create Master Checklist
409
+
410
+ #### Step 1.1: Read, Resolve Versions, and Filter BUG.md
411
+
412
+ 1. Read `<app_folder>/context/BUG.md`
413
+ 2. **Resolve the version list** using the Version Resolution rules:
414
+ - Single version → `[v1.0.4]`
415
+ - Comma-separated → parse and sort ascending by semver → `[v1.0.3, v1.0.4]`
416
+ - `all` or omitted → scan BUG.md for ALL `[vX.Y.Z]` tags, deduplicate, sort ascending → `[v1.0.1, v1.0.2, v1.0.3, ...]`
417
+ 3. Apply module filter if provided
418
+ 4. For each resolved version, identify all bugs that match the filter criteria
419
+ 5. Count the total bugs per version and overall
420
+
421
+ #### Step 1.2: Tag Untagged Bugs
422
+
423
+ 1. Scan the ENTIRE BUG.md for existing `[BUG-XXX]` tags to find the highest number
424
+ 2. For each untagged bug (matching the filter), assign the next `[BUG-XXX]` tag
425
+ 3. Write the updated BUG.md with new tags applied
426
+ 4. **IMPORTANT**: Only tag bugs that do NOT already have a tag. Never modify existing tags.
427
+
428
+ #### Step 1.3: Create BUG_MASTER.md
429
+
430
+ Create `<app_folder>/context/bug/BUG_MASTER.md` with this structure:
431
+
432
+ ```markdown
433
+ # Bug Master — <Application Name>
434
+
435
+ **Started**: <date>
436
+ **Context**: <app_folder>/context
437
+ **Resolved Versions**: <comma-separated sorted version list, e.g., "v1.0.3, v1.0.4, v1.0.5">
438
+ **Module Filter**: <module or "All">
439
+ **Status**: IN PROGRESS
440
+
441
+ ---
442
+
443
+ ## Version Processing Order
444
+
445
+ | # | Version | Bug Count | Status | Started | Completed |
446
+ |---|---------|-----------|--------|---------|-----------|
447
+ | 1 | v1.0.3 | 3 | NEW | - | - |
448
+ | 2 | v1.0.4 | 5 | NEW | - | - |
449
+ | 3 | v1.0.5 | 2 | NEW | - | - |
450
+
451
+ > **Processing Rule**: All bugs from version N must reach terminal status before version N+1 begins.
452
+
453
+ ---
454
+
455
+ ## v1.0.3
456
+
457
+ ### <Module Name>
458
+
459
+ | Code | Description | Status | Remark |
460
+ |------|-------------|--------|--------|
461
+ | BUG-001 | Short description of the bug | NEW | |
462
+ | BUG-002 | Short description of the bug | NEW | |
463
+
464
+ ---
465
+
466
+ ### <Another Module>
467
+
468
+ | Code | Description | Status | Remark |
469
+ |------|-------------|--------|--------|
470
+ | BUG-003 | Short description of the bug | NEW | |
471
+
472
+ ---
473
+
474
+ ## v1.0.4
475
+
476
+ ### <Module Name>
477
+
478
+ | Code | Description | Status | Remark |
479
+ |------|-------------|--------|--------|
480
+ | BUG-004 | Short description of the bug | NEW | |
481
+
482
+ ---
483
+
484
+ ## Summary
485
+
486
+ | Status | Count |
487
+ |--------|-------|
488
+ | NEW | X |
489
+ | IN_PROGRESS | 0 |
490
+ | FIXED | 0 |
491
+ | CANNOT_REPRODUCE | 0 |
492
+ | HIGH_IMPACT | 0 |
493
+ | **Total** | **X** |
494
+ ```
495
+
496
+ **IMPORTANT — Single version shortcut**: When only a single version is resolved (either
497
+ explicitly provided or only one version exists in BUG.md), the BUG_MASTER.md still uses
498
+ the same structure above but with only one version section. The Version Processing Order
499
+ table will have a single row.
500
+
501
+ **IMPORTANT — Version-first organization**: Bugs are grouped by version (H2), then by
502
+ module (H3) within each version. This ensures the version-sequential processing order
503
+ is visually clear and easy to track.
504
+
505
+ **Status Values:**
506
+ - `NEW` — Bug has been tagged but not yet worked on
507
+ - `IN_PROGRESS` — Bug is currently being investigated/fixed
508
+ - `FIXED` — Bug has been fixed and verified
509
+ - `CANNOT_REPRODUCE` — Bug could not be reproduced via Playwright
510
+ - `HIGH_IMPACT` — Fix would potentially break other working functionalities; deferred
511
+
512
+ ### Phase 2: Implementation — Fix Each Bug (Version by Version, One at a Time)
513
+
514
+ Process bugs **version by version** in the order defined in the Version Processing Order table:
515
+
516
+ 1. Find the FIRST version in the Version Processing Order table with status != `COMPLETED`
517
+ 2. Update that version's status to `IN_PROGRESS` and record the start date
518
+ 3. Within that version section, find the FIRST bug with status `NEW` or `IN_PROGRESS`
519
+ 4. Fix that bug using Steps 2.1–2.8 below
520
+ 5. After fixing, check if ALL bugs in the current version have terminal status:
521
+ - If YES → mark the version as `COMPLETED` in the Version Processing Order table, record
522
+ completion date, and move to the NEXT version (step 1). **If this was the LAST version
523
+ (no remaining row with status != `COMPLETED`), IMMEDIATELY also set the top-level
524
+ `**Status**:` field to `COMPLETED` in the same edit** — do NOT defer it to Phase 3. The
525
+ top-level `**Status**:` line is the ONLY completion signal Compound Context Studio reads; a
526
+ BUG_MASTER whose version rows are all `COMPLETED` but whose top-level `**Status**:` still says
527
+ `IN PROGRESS` leaves the run stuck "in progress" in the studio.
528
+ - If NO → find the next `NEW` bug in the same version and continue
529
+ 6. Repeat until ALL versions are `COMPLETED` (at which point the top-level `**Status**:` is already
530
+ `COMPLETED` per step 5)
531
+
532
+ For each bug with status `NEW` in BUG_MASTER.md (within the current version), in order:
533
+
534
+ #### Step 2.1: Initialize Bug Folder
535
+
536
+ 1. Update BUG_MASTER.md: set the current bug's status to `IN_PROGRESS`
537
+ 2. Create folder: `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/`
538
+ 3. This folder will contain all artifacts for this specific bug
539
+
540
+ #### Step 2.2: Reproduce the Bug with Playwright
541
+
542
+ 1. Read the bug description from BUG.md (including reproduction steps and expected result)
543
+ 2. Write a Playwright script to reproduce the bug — save the script file in the bug folder:
544
+ `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/reproduce.spec.ts`
545
+ 3. In the Playwright script, use **explicit screenshot paths** pointing to the bug folder.
546
+ Do NOT rely on Playwright's default screenshot location. Use `page.screenshot()` with an
547
+ absolute or project-relative path:
548
+ ```typescript
549
+ await page.screenshot({
550
+ path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_reproduce.png',
551
+ fullPage: true
552
+ });
553
+ ```
554
+ 4. Run the Playwright script: `npx playwright test <path-to-script> --config=<playwright-config>`
555
+
556
+ **CRITICAL**: Screenshots MUST be saved to `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/`.
557
+ Do NOT save screenshots in the application source folder, test output folder, or Playwright's
558
+ default results directory. The bug folder in the application's `context/` folder is the single source of truth for all
559
+ bug artifacts.
560
+
561
+ **IF able to reproduce:**
562
+ - Update BUG_MASTER.md remark: "Reproduced successfully"
563
+ - Proceed to Step 2.3
564
+
565
+ **IF NOT able to reproduce:**
566
+ - Update BUG_MASTER.md: set status to `CANNOT_REPRODUCE`, add remark with details
567
+ - Save the screenshot showing the current (non-buggy) state to the bug folder
568
+ - Move to the next bug
569
+
570
+ #### Step 2.3: Write Test Spec
571
+
572
+ Create `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/BUG_TEST_SPEC.md`:
573
+
574
+ ```markdown
575
+ # Test Spec — <BUG-XXX>
576
+
577
+ **Bug**: <Short description>
578
+ **Module**: <Module Name>
579
+ **Reproduced**: Yes
580
+
581
+ ---
582
+
583
+ ## Pre-Conditions
584
+
585
+ - <List any required state, data, or login credentials>
586
+
587
+ ## Steps to Verify Fix
588
+
589
+ 1. <Step-by-step instructions to verify the bug is fixed>
590
+ 2. <Navigate to...>
591
+ 3. <Assert that...>
592
+
593
+ ## Expected Result After Fix
594
+
595
+ - <What the user should see when the bug is fixed>
596
+
597
+ ## Playwright Verification Script
598
+
599
+ ```typescript
600
+ // Playwright test to verify the fix
601
+ test('<BUG-XXX>: <description>', async ({ page }) => {
602
+ // Steps to verify...
603
+
604
+ // IMPORTANT: Save screenshots to the bug folder, NOT the source folder
605
+ await page.screenshot({
606
+ path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_fixed.png',
607
+ fullPage: true
608
+ });
609
+ });
610
+ ```
611
+ ```
612
+
613
+ #### Step 2.4: Analyze and Plan the Fix
614
+
615
+ 1. Analyze the bug in detail — read relevant source code, templates, configurations
616
+ 2. Determine the root cause
617
+ 3. Plan how to fix it
618
+ 4. Assess impact on other functionalities
619
+
620
+ Create `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/BUG_FIX_PLAN.md`:
621
+
622
+ ```markdown
623
+ # Fix Plan — <BUG-XXX>
624
+
625
+ **Bug**: <Short description>
626
+ **Module**: <Module Name>
627
+ **Root Cause**: <What is causing the bug>
628
+ **Impact Assessment**: <Low/Medium/High — does fixing this affect other features?>
629
+
630
+ ---
631
+
632
+ ## Fix Checklist
633
+
634
+ - [ ] 1. <First change to make>
635
+ - [ ] 2. <Second change to make>
636
+ - [ ] 3. Verify fix with BUG_TEST_SPEC.md
637
+ - [ ] 4. Update artifacts (mockups/specs/models/user stories)
638
+
639
+ ---
640
+
641
+ ## Files to Modify
642
+
643
+ | File | Change Description |
644
+ |------|-------------------|
645
+ | `path/to/file.jte` | Fix table styling |
646
+ | `path/to/file.java` | Update method logic |
647
+
648
+ ---
649
+
650
+ ## Fix Log
651
+
652
+ ### Step 1: <description>
653
+ <timestamp> - Started
654
+ - Changes made: ...
655
+ - Result: ...
656
+ ```
657
+
658
+ **IF the fix potentially affects other working functionalities (HIGH_IMPACT):**
659
+ - Update BUG_MASTER.md: set status to `HIGH_IMPACT`, add remark explaining the risk
660
+ - Record the analysis in BUG_FIX_PLAN.md
661
+ - Do NOT apply the fix
662
+ - Move to the next bug
663
+
664
+ **IF safe to fix:**
665
+ - Proceed to Step 2.5
666
+
667
+ #### Step 2.5: Apply the Fix
668
+
669
+ 1. Make the code changes as planned in BUG_FIX_PLAN.md
670
+ 2. **Annotate the fix in source (MANDATORY)** — On EACH method, block, or template region
671
+ modified by the fix, leave a `[BUG-XXX]` marker comment using the language's native
672
+ comment style:
673
+ - Java method: prepend a Javadoc line `* [BUG-XXX] <one-line description>` (or extend
674
+ the existing Javadoc if the method already has one)
675
+ - PHP / TypeScript / JavaScript: same pattern with PHPDoc / JSDoc
676
+ - Blade template: `{{-- [BUG-XXX] <description> --}}` immediately above the changed block
677
+ - JTE template: `@* [BUG-XXX] <description> *@` immediately above the changed block
678
+ - HTML / SQL: `<!-- [BUG-XXX] <description> -->` / `-- [BUG-XXX] <description>`
679
+ - YAML / `.env` / `.properties`: `# [BUG-XXX] <description>` above the changed key
680
+
681
+ Example (Java service method):
682
+ ```java
683
+ /**
684
+ * [BUG-024] Trim leading whitespace from corridor code before lookup.
685
+ */
686
+ public Corridor findByCode(String code) { ... }
687
+ ```
688
+
689
+ The marker enables `git blame` and IDE search to trace any modified line back to
690
+ BUG.md without consulting BUG_FIX_PLAN.md.
691
+ 3. **Append to top-of-file traceability comment (if present)** — If the modified file
692
+ already carries a top-of-file traceability comment (from `conductor-feature-develop`'s
693
+ code-level traceability rule), append the `[BUG-XXX]` code to its `Bug fixes:` line,
694
+ creating the line if it does not yet exist. Use the `USHM#####` / `NFRHM####` /
695
+ `CONSHM###` / `REFHM####` codes already present in the file — do NOT change them:
696
+ ```java
697
+ /**
698
+ * Implements: USHM00003, USHM00006
699
+ * NFR: NFRHM0003
700
+ * Bug fixes: [BUG-024]
701
+ */
702
+ public class CorridorService { ... }
703
+ ```
704
+ 4. Update BUG_FIX_PLAN.md: check off completed items, log changes in the Fix Log section
705
+
706
+ #### Step 2.6: Verify the Fix
707
+
708
+ 1. Run the verification from BUG_TEST_SPEC.md (Playwright test)
709
+ 2. Capture post-fix screenshot using an explicit path in the Playwright script:
710
+ ```typescript
711
+ await page.screenshot({
712
+ path: '<app_folder>/context/bug/<module-slug>/<BUG-XXX>/screenshot_fixed.png',
713
+ fullPage: true
714
+ });
715
+ ```
716
+ Do NOT save screenshots in the application source folder — always use the bug folder under `<app_folder>/context/`.
717
+
718
+ **IF verified (test passes):**
719
+ - Update BUG_MASTER.md: set status to `FIXED`
720
+ - Update BUG_FIX_PLAN.md: mark all checklist items as completed
721
+ - Proceed to Step 2.7
722
+
723
+ **IF NOT verified (test fails):**
724
+ - Log the failure in BUG_FIX_PLAN.md
725
+ - Go back to Step 2.4 to re-analyze and re-plan
726
+ - Apply a different fix approach
727
+
728
+ #### Step 2.7: Update Related Artifacts
729
+
730
+ Analyze the fix to determine which artifacts need updating:
731
+
732
+ **A. UI Fix → Update Mockups**
733
+
734
+ If the fix changed the visual appearance (HTML/CSS/layout changes in JTE templates):
735
+ 1. Navigate to `<app_folder>/context/mockup/` and find the relevant module screens
736
+ 2. Update the HTML mockup files to reflect the fix
737
+ 3. Log the mockup changes in BUG_FIX_PLAN.md
738
+
739
+ **B. Code Logic Fix → Update Specifications**
740
+
741
+ If the fix involved code logic changes (service layer, controller logic, validation):
742
+ 1. Navigate to `<app_folder>/context/specification/<module-slug>/`
743
+ 2. Update the SPEC.md to reflect the changed behavior
744
+ 3. Log the specification changes in BUG_FIX_PLAN.md
745
+
746
+ **C. Module Model Fix → Update Models**
747
+
748
+ If the fix involved module model changes (new/removed fields, collection changes):
749
+ 1. Navigate to `<app_folder>/context/model/<module-slug>/`
750
+ 2. Update `model.md`, `schemas.json`, and `document-model.mermaid` as needed
751
+ 3. Log the model changes in BUG_FIX_PLAN.md
752
+
753
+ **D. Record in PRD.md**
754
+
755
+ If the bug fix is NOT already documented in PRD.md:
756
+ 1. Open `<app_folder>/context/PRD.md`
757
+ 2. Find the specific module section
758
+ 3. Look for a `### Bug` section (positioned AFTER the `### Reference` section)
759
+ 4. If the `### Bug` section does NOT exist, create one after `### Reference`
760
+ 5. Add the version tag on the line immediately after the `### Bug` header, using the bug's
761
+ version from BUG.md (e.g., `[v1.0.3]`). This follows the same format as all other sections
762
+ in PRD.md (User Story, Non Functional Requirement, Constraint, Reference) where the
763
+ version tag `[vX.Y.Z]` appears on its own line directly after the `###` header.
764
+ 6. Add a new bullet point with the bug tag and fix description after the version tag:
765
+ ```markdown
766
+ ### Bug
767
+ [v1.0.3]
768
+ - [BUG-001] Fixed table formatting inconsistency between document management and location information screens
769
+ ```
770
+ 7. If the `### Bug` section already exists:
771
+ - Check if the bug's version tag already appears in the section
772
+ - If the version tag already exists, append the new bug fix bullet point under that version
773
+ - If the version tag does NOT exist, add the new version tag and bullet point after the
774
+ last existing entry (following the same multi-version pattern used in other sections):
775
+ ```markdown
776
+ ### Bug
777
+ [v1.0.3]
778
+ - [BUG-001] Fixed table formatting inconsistency
779
+ [v1.0.4]
780
+ - [BUG-003] Fixed another issue
781
+ ```
782
+
783
+ **E. Cross-Application (Indirect) Changes → Record Them Explicitly**
784
+
785
+ A fix sometimes requires touching code OUTSIDE the bug's own application e.g., a middleware
786
+ endpoint change to fix a web-app bug. Those indirect changes MUST leave a written trail:
787
+
788
+ 1. List every indirectly changed application (and its changed files) in the bug's
789
+ BUG_FIX_PLAN.md Fix Log.
790
+ 2. Record the indirect applications in the bug's BUG_MASTER.md `Remark` column, e.g.:
791
+ `Fixed in skolafund-web; indirect changes: skolafund-middleware (BugController.java — new /api/refunds endpoint)`.
792
+ 3. Append a CHANGELOG.md row to EACH indirectly changed application's own
793
+ `<other_app_folder>/CHANGELOG.md` under the same version (create the section per the
794
+ Phase 3 CHANGELOG rules):
795
+ `| {YYYY-MM-DD} | {other_application_name} | conductor-defect | {module or "All"} | Indirect changes for [BUG-XXX] reported under {application_name} ({summary}) |`
796
+ 4. Do NOT create or update `BUG_MASTER.md` (or `context/bug/` folders) inside an indirectly
797
+ changed application the bug is tracked ONLY under the application it was reported
798
+ against. A stray BUG_MASTER.md in another application makes Compound Context Studio's
799
+ "Rescan all statuses" invent a phantom quality run for that application.
800
+
801
+ #### Step 2.8: Record Summary in BUG_MASTER.md
802
+
803
+ 1. Update the bug's `Remark` column with a brief summary of what was fixed
804
+ 2. Include chain effects (what other artifacts were updated, and any cross-application
805
+ indirect changes per Step 2.7-E)
806
+ 3. Update the Summary table counts
807
+ 4. Move to the next bug with status `NEW`
808
+
809
+ ### Phase 3: Completion
810
+
811
+ After all bugs have been processed (every bug has a terminal status):
812
+
813
+ 1. Update BUG_MASTER.md:
814
+ - Ensure the top-level `**Status**:` field reads `COMPLETED` (Phase 2 step 5 already sets it when
815
+ the last version completes confirm it here as a backstop; the studio reads ONLY this line)
816
+ - Update all Summary table counts
817
+ 2. **Regenerate the traceability matrix** so the new `[BUG-XXX]` source markers (Step 2.5) and any
818
+ code changes are reflected in the requirement-to-code links:
819
+ ```
820
+ Skill(skill: "co2-skills:tracegen-matrix", args: "<app_folder> version:<highest-version-processed>")
821
+ ```
822
+ - If a `module` filter was active for this run, pass it through: append ` module:<module>`.
823
+ - It updates `<app_folder>/context/TRACEABILITY.md` and appends its own `CHANGELOG.md` row.
824
+ - This does **not** require the codebase-memory MCP `tracegen-matrix` resolves links from the
825
+ in-source traceability / `[BUG-XXX]` comments, with a name-based source-scan fallback.
826
+ 3. Append entries to `CHANGELOG.md` in the application folder (`<app_folder>/CHANGELOG.md`) — **one entry per version processed**:
827
+ - Read `<app_folder>/CHANGELOG.md`. If it does not exist, create it with context header.
828
+ - For EACH version in the resolved version list (ascending order):
829
+ - Search for a `## {version}` heading matching this version.
830
+ - If the section **exists**: append a new row to its table.
831
+ - 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.
832
+ - Row format: `| {YYYY-MM-DD} | {application_name} | conductor-defect | {module or "All"} | Fixed {count} bugs ({list of BUG codes for this version}) |`
833
+ - **Never modify or delete existing rows.**
834
+ 4. Output the Ralph Loop completion promise: `<promise>ALL BUGS RESOLVED</promise>`
835
+
836
+ ## Critical Rules
837
+
838
+ 1. **CLAUDE.md is the source of truth for all tool commands** — CLAUDE.md is automatically
839
+ loaded into context. Use the exact JDK path, Maven path, database credentials,
840
+ and all other infrastructure details from CLAUDE.md. NEVER hardcode or guess paths.
841
+
842
+ 2. **One bug at a time** — Fix bugs sequentially. Complete all steps for one bug before moving
843
+ to the next. Never work on multiple bugs simultaneously.
844
+
845
+ 3. **BUG_MASTER.md is the master checkpoint** — Ralph Loop uses BUG_MASTER.md to determine
846
+ which bugs have been fixed and which are pending. Always keep it up to date. For detailed
847
+ status of each bug, refer to the BUG_FIX_PLAN.md in each bug's folder.
848
+
849
+ 4. **Never skip reproduction** — Always attempt to reproduce the bug with Playwright first.
850
+ If it can't be reproduced, mark it as `CANNOT_REPRODUCE` and move on.
851
+
852
+ 5. **HIGH_IMPACT defers, not blocks** — If a fix would break other features, mark it as
853
+ `HIGH_IMPACT` and move to the next bug. Do not attempt risky fixes.
854
+
855
+ 6. **Track everything** — Every action should be logged in BUG_FIX_PLAN.md so that any
856
+ future session (or Ralph Loop iteration) can understand what was done and what remains.
857
+
858
+ 7. **Preserve existing tags** — Never modify or remove existing `[BUG-XXX]` tags in BUG.md.
859
+ Only add new tags to untagged bugs.
860
+
861
+ 8. **Update artifacts faithfully** — When a fix changes UI, logic, or models, update the
862
+ corresponding mockups, specifications, and module models. Keep all artifacts in sync.
863
+
864
+ 9. **Context window awareness** — If approaching context limits, save progress to
865
+ BUG_MASTER.md and BUG_FIX_PLAN.md. Ralph Loop will resume from where you left off.
866
+
867
+ 10. **Ralph Loop discipline — NEVER stop prematurely** — After fixing one bug, IMMEDIATELY
868
+ check for the next `NEW` bug and start it. Do NOT stop "to let the user review". The only
869
+ valid reasons to stop within an iteration are: (a) context window approaching limit,
870
+ (b) all bugs resolved (output promise), or (c) an unrecoverable error requiring user input.
871
+
872
+ 11. **Auto-start Ralph Loop (INTERNAL)** — The FIRST action MUST be to silently check if Ralph
873
+ Loop is active (`.claude/ralph-loop.local.md` exists). If not, silently invoke it using the
874
+ Skill tool. The user should NEVER be asked to start Ralph Loop manually — this is an internal
875
+ implementation detail handled entirely by the skill. Do NOT mention Ralph Loop to the user.
876
+
877
+ 12. **NO creative alternatives for 3rd party applications (CRITICAL)** — Use the EXACT methods,
878
+ connection strings, CLIs, and credentials described in `CLAUDE.md`. NEVER use Docker
879
+ containers, alternative databases, or different CLIs than what CLAUDE.md specifies.
880
+
881
+ 13. **Screenshots MUST be saved in the bug folder (CRITICAL)** — All Playwright screenshots
882
+ (reproduction, verification, fixed) MUST be saved to
883
+ `<app_folder>/context/bug/<module-slug>/<BUG-XXX>/` using explicit `page.screenshot({ path: ... })`
884
+ calls. NEVER save screenshots in the application source folder, Playwright's default test-results
885
+ directory, or any other location. The Playwright script files themselves should also be saved in
886
+ the bug folder, not in the source tree.
887
+
888
+ 14. **Spring Boot `app:` namespace for new configuration (CRITICAL)** — When a bug fix
889
+ introduces a new configuration value in a Spring Boot application, that value MUST be
890
+ added under the top-level `app:` key in `application.yml`. NEVER place new
891
+ application-specific keys at the YAML root (e.g., top-level `notification:`,
892
+ `batch-job:`, `audit-trail:`) and NEVER place them under Spring framework namespaces
893
+ (`spring.*`, `server.*`, `management.*`, `logging.*`, `springdoc.*`).
894
+
895
+ **Grouping:**
896
+ - Cross-cutting values (version, CORS, shared security, shared messaging, shared
897
+ object-storage) sit directly under `app.*` with no module prefix.
898
+ - Per-module values MUST be grouped under `app.<module-kebab-case>.*`, one block
899
+ per module. If the module does not yet have an `app.<module>` block, create one.
900
+
901
+ **Binding:** bind every new `app.*` value via a `@ConfigurationProperties` record in
902
+ the owning module's `config` subpackage. If a record already exists for that module,
903
+ extend it rather than creating a second one. NEVER introduce `@Value("${app....}")`
904
+ injections as a shortcut. Use kebab-case in YAML.
905
+
906
+ **If the bug fix touches code that currently reads configuration from a root-level
907
+ YAML key or a framework namespace, relocate the config under `app:` as part of the
908
+ fix** — do not leave the violation in place. Update the `application.yml`, the Java
909
+ `@ConfigurationProperties` prefix, any `@Value` references, and any tests that use
910
+ `@TestPropertySource` or `@SpringBootTest(properties = ...)`. See SPECIFICATION.md
911
+ section "Application-Specific Configuration (`app:` namespace)" for the rules.
912
+
913
+ 15. **Code-level bug traceability is MANDATORY** — Every method, block, or template region
914
+ modified by a bug fix MUST carry a `[BUG-XXX]` marker comment using the language's
915
+ native comment style (Javadoc / PHPDoc / JSDoc / `{{-- --}}` / `@* *@` / `<!-- -->` /
916
+ `#`). When a modified file already carries a top-of-file traceability comment from
917
+ `conductor-feature-develop`, append the `[BUG-XXX]` code to its `Bug fixes:` line
918
+ (creating the line if it does not yet exist). See Step 2.5 for the exact comment
919
+ formats per language.
920
+
921
+ **Why**: `git blame` and IDE search must surface the originating bug for any fix line
922
+ directly, without consulting BUG_FIX_PLAN.md (which is a transient tracking file).
923
+ PRD.md's `### Bug` section captures **what** was fixed; the in-source `[BUG-XXX]`
924
+ marker captures **where** — both are required for end-to-end traceability.