@rashidee/co2 1.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/dist/index.js +25449 -0
  2. package/drizzle/0000_remarkable_charles_xavier.sql +210 -0
  3. package/drizzle/0001_wise_wolf_cub.sql +13 -0
  4. package/drizzle/0002_secret_spyke.sql +16 -0
  5. package/drizzle/0003_workspace_config_singleton.sql +16 -0
  6. package/drizzle/0004_terminal_claim_v120.sql +11 -0
  7. package/drizzle/0005_brainstorm_v124.sql +10 -0
  8. package/drizzle/0006_project_v140.sql +6 -0
  9. package/drizzle/0007_prd_wizard_v124.sql +14 -0
  10. package/drizzle/0008_workflow_artifact_v126.sql +24 -0
  11. package/drizzle/0009_project_import_v150.sql +7 -0
  12. package/drizzle/0010_quality_v151.sql +3 -0
  13. package/drizzle/meta/0000_snapshot.json +1335 -0
  14. package/drizzle/meta/0001_snapshot.json +1416 -0
  15. package/drizzle/meta/0002_snapshot.json +1510 -0
  16. package/drizzle/meta/_journal.json +83 -0
  17. package/package.json +41 -0
  18. package/plugin/.claude-plugin/marketplace.json +36 -0
  19. package/plugin/.claude-plugin/plugin.json +22 -0
  20. package/plugin/README.md +625 -0
  21. package/plugin/SKILLS.md +350 -0
  22. package/plugin/co2.svg +5 -0
  23. package/plugin/commands/brainstorm-loop.md +129 -0
  24. package/plugin/skills/conductor-defect/SKILL.md +898 -0
  25. package/plugin/skills/conductor-feature-develop/SKILL.md +1383 -0
  26. package/plugin/skills/conductor-feature-develop/references/implementation-domain-template.md +131 -0
  27. package/plugin/skills/conductor-feature-develop/references/implementation-master-template.md +89 -0
  28. package/plugin/skills/conductor-feature-develop/references/playwright-setup.md +224 -0
  29. package/plugin/skills/conductor-feature-prepare/SKILL.md +604 -0
  30. package/plugin/skills/depgen-k8s/SKILL.md +468 -0
  31. package/plugin/skills/depgen-k8s/references/dockerfile-laravel.md +197 -0
  32. package/plugin/skills/depgen-k8s/references/dockerfile-nodejs.md +163 -0
  33. package/plugin/skills/depgen-k8s/references/dockerfile-spring-boot.md +174 -0
  34. package/plugin/skills/depgen-k8s/references/k8s-patterns.md +869 -0
  35. package/plugin/skills/mockgen-shadcn/SKILL.md +1067 -0
  36. package/plugin/skills/mockgen-shadcn/references/admin-layout-template.md +1467 -0
  37. package/plugin/skills/mockgen-shadcn/references/mockup-hub-template.md +498 -0
  38. package/plugin/skills/mockgen-shadcn/references/mockup-index-template.md +216 -0
  39. package/plugin/skills/mockgen-tailwind/SKILL.md +904 -0
  40. package/plugin/skills/mockgen-tailwind/references/admin-layout-template.md +720 -0
  41. package/plugin/skills/mockgen-tailwind/references/mockup-hub-template.md +498 -0
  42. package/plugin/skills/mockgen-tailwind/references/mockup-index-template.md +190 -0
  43. package/plugin/skills/modelgen-nosql/SKILL.md +617 -0
  44. package/plugin/skills/modelgen-nosql/references/model-extraction-methodology.md +497 -0
  45. package/plugin/skills/modelgen-nosql/references/nosql-design-guide.md +258 -0
  46. package/plugin/skills/modelgen-relational/SKILL.md +707 -0
  47. package/plugin/skills/modelgen-relational/references/model-extraction-methodology.md +499 -0
  48. package/plugin/skills/specgen-flutter-riverpod/SKILL.md +898 -0
  49. package/plugin/skills/specgen-flutter-riverpod/references/component-patterns.md +971 -0
  50. package/plugin/skills/specgen-flutter-riverpod/references/notification-patterns.md +457 -0
  51. package/plugin/skills/specgen-flutter-riverpod/references/routing-patterns.md +362 -0
  52. package/plugin/skills/specgen-flutter-riverpod/references/security-patterns.md +709 -0
  53. package/plugin/skills/specgen-flutter-riverpod/references/spec-template.md +1566 -0
  54. package/plugin/skills/specgen-flutter-riverpod/references/state-patterns.md +518 -0
  55. package/plugin/skills/specgen-flutter-riverpod/references/storage-patterns.md +370 -0
  56. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/SKILL.md +984 -0
  57. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/batch-patterns.md +359 -0
  58. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/messaging-patterns.md +468 -0
  59. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/modulith-patterns.md +461 -0
  60. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/reporting-patterns.md +803 -0
  61. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/security-patterns.md +501 -0
  62. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/spec-template.md +1268 -0
  63. package/plugin/skills/specgen-laravel-eloquent-bladehtmx/references/web-patterns.md +301 -0
  64. package/plugin/skills/specgen-node-cli-web/SKILL.md +561 -0
  65. package/plugin/skills/specgen-node-cli-web/references/auth-patterns.md +293 -0
  66. package/plugin/skills/specgen-node-cli-web/references/cli-packaging-patterns.md +250 -0
  67. package/plugin/skills/specgen-node-cli-web/references/server-patterns.md +247 -0
  68. package/plugin/skills/specgen-node-cli-web/references/spec-template.md +401 -0
  69. package/plugin/skills/specgen-node-cli-web/references/testing-patterns.md +174 -0
  70. package/plugin/skills/specgen-react-mui/SKILL.md +789 -0
  71. package/plugin/skills/specgen-react-mui/references/component-patterns.md +1077 -0
  72. package/plugin/skills/specgen-react-mui/references/reporting-patterns.md +1998 -0
  73. package/plugin/skills/specgen-react-mui/references/routing-patterns.md +461 -0
  74. package/plugin/skills/specgen-react-mui/references/security-patterns.md +599 -0
  75. package/plugin/skills/specgen-react-mui/references/spec-template.md +1030 -0
  76. package/plugin/skills/specgen-react-mui/references/state-patterns.md +327 -0
  77. package/plugin/skills/specgen-react-tailwind/SKILL.md +859 -0
  78. package/plugin/skills/specgen-react-tailwind/references/component-patterns.md +1212 -0
  79. package/plugin/skills/specgen-react-tailwind/references/reporting-patterns.md +1529 -0
  80. package/plugin/skills/specgen-react-tailwind/references/routing-patterns.md +669 -0
  81. package/plugin/skills/specgen-react-tailwind/references/security-patterns.md +656 -0
  82. package/plugin/skills/specgen-react-tailwind/references/spec-template.md +1237 -0
  83. package/plugin/skills/specgen-react-tailwind/references/state-patterns.md +327 -0
  84. package/plugin/skills/specgen-sdk-java/SKILL.md +933 -0
  85. package/plugin/skills/specgen-sdk-java/references/api-extraction-patterns.md +247 -0
  86. package/plugin/skills/specgen-sdk-java/references/http-client-patterns.md +495 -0
  87. package/plugin/skills/specgen-sdk-java/references/packaging-patterns.md +366 -0
  88. package/plugin/skills/specgen-sdk-java/references/spec-template.md +956 -0
  89. package/plugin/skills/specgen-spring-jpa-jtehtmx/SKILL.md +1284 -0
  90. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/batch-patterns.md +1224 -0
  91. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/jasper-patterns.md +1638 -0
  92. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/messaging-patterns.md +512 -0
  93. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/modulith-patterns.md +354 -0
  94. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/security-patterns.md +551 -0
  95. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/spec-template.md +2502 -0
  96. package/plugin/skills/specgen-spring-jpa-jtehtmx/references/web-patterns.md +503 -0
  97. package/plugin/skills/specgen-spring-jpa-restapi/SKILL.md +990 -0
  98. package/plugin/skills/specgen-spring-jpa-restapi/references/batch-patterns.md +1224 -0
  99. package/plugin/skills/specgen-spring-jpa-restapi/references/messaging-patterns.md +512 -0
  100. package/plugin/skills/specgen-spring-jpa-restapi/references/modulith-patterns.md +279 -0
  101. package/plugin/skills/specgen-spring-jpa-restapi/references/reporting-patterns.md +1536 -0
  102. package/plugin/skills/specgen-spring-jpa-restapi/references/restapi-patterns.md +722 -0
  103. package/plugin/skills/specgen-spring-jpa-restapi/references/security-patterns.md +351 -0
  104. package/plugin/skills/specgen-spring-jpa-restapi/references/spec-template.md +553 -0
  105. package/plugin/skills/specgen-ts-cli/SKILL.md +861 -0
  106. package/plugin/skills/specgen-ts-cli/references/async-patterns.md +1101 -0
  107. package/plugin/skills/specgen-ts-cli/references/command-patterns.md +383 -0
  108. package/plugin/skills/specgen-ts-cli/references/config-patterns.md +430 -0
  109. package/plugin/skills/specgen-ts-cli/references/database-patterns.md +750 -0
  110. package/plugin/skills/specgen-ts-cli/references/packaging-patterns.md +426 -0
  111. package/plugin/skills/specgen-ts-cli/references/spec-template.md +1391 -0
  112. package/plugin/skills/specgen-ts-cli/references/testing-patterns.md +909 -0
  113. package/plugin/skills/testgen-functional/SKILL.md +1381 -0
  114. package/plugin/skills/tracegen-matrix/SKILL.md +243 -0
  115. package/plugin/skills/util-preparek8senv/SKILL.md +422 -0
  116. package/plugin/skills/util-projectinit/SKILL.md +307 -0
  117. package/plugin/skills/util-projectinit/reference/brainstorm-loop.md +129 -0
  118. package/plugin/skills/util-projectinit/reference/brainstorm-protocol.md +144 -0
  119. package/plugin/skills/util-projectinit/reference/brainstorm-setup-guide.md +153 -0
  120. package/plugin/skills/util-projectinit/reference/brainstorm-template-appdev.md +87 -0
  121. package/plugin/skills/util-projectinit/reference/co2-context-generation-guide.md +761 -0
  122. package/plugin/skills/util-projectsync/SKILL.md +501 -0
  123. package/plugin/skills/util-updprd/SKILL.md +324 -0
  124. package/plugin/skills/util-usanalyzer/SKILL.md +307 -0
  125. package/plugin/skills/util-ustagger/SKILL.md +154 -0
  126. package/static/assets/abnfDiagram-VRR7QNED-DvPuwyCV.js +1 -0
  127. package/static/assets/arc-DRKw7sjs.js +1 -0
  128. package/static/assets/architectureDiagram-ZJ3FMSHR-CaNcxUbC.js +36 -0
  129. package/static/assets/blockDiagram-677ZJIJ3-Demd4AOK.js +132 -0
  130. package/static/assets/c4Diagram-LMCZKHZV-PVKUfc2x.js +10 -0
  131. package/static/assets/channel-C2nVbuwv.js +1 -0
  132. package/static/assets/chunk-2Q5K7J3B-CExf8ww_.js +1 -0
  133. package/static/assets/chunk-32BRIVSS-CFPaoONF.js +1 -0
  134. package/static/assets/chunk-5VM5RSS4-DE2esM67.js +15 -0
  135. package/static/assets/chunk-EX3LRPZG-SON_YdDG.js +231 -0
  136. package/static/assets/chunk-JWPE2WC7-Qxah8LNr.js +1 -0
  137. package/static/assets/chunk-MOJQB5TN-BcWGQV3j.js +88 -0
  138. package/static/assets/chunk-RYQCIY6F-DkDj-OR5.js +1 -0
  139. package/static/assets/chunk-V7JOEXUC-BlI1Mrah.js +206 -0
  140. package/static/assets/chunk-VR4S4FIN-Agf__duj.js +1 -0
  141. package/static/assets/chunk-XXDRQBXY-B5CfAh85.js +1 -0
  142. package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +1 -0
  143. package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +1 -0
  144. package/static/assets/cose-bilkent-JH36ORCC-DO0cQkcy.js +1 -0
  145. package/static/assets/cynefin-VYW2F7L2-CfOnsnXc.js +178 -0
  146. package/static/assets/cynefinDiagram-TSTJHNR4-BJ8tULAv.js +62 -0
  147. package/static/assets/cytoscape.esm-DTSO7Bv0.js +331 -0
  148. package/static/assets/dagre-VKFMJZFB-DfjwzHqP.js +4 -0
  149. package/static/assets/defaultLocale-DX6XiGOO.js +1 -0
  150. package/static/assets/diagram-FQU43EPY-CndSOIIM.js +3 -0
  151. package/static/assets/diagram-G47NLZAW-Czf5hN0Z.js +24 -0
  152. package/static/assets/diagram-NH7WQ7WH-COAyojGh.js +24 -0
  153. package/static/assets/diagram-OA4YK3LP-H8PoiN2m.js +30 -0
  154. package/static/assets/diagram-WEI45ONY-DzcaVzjp.js +41 -0
  155. package/static/assets/ebnfDiagram-CCIWWBDH-DPazGYLJ.js +1 -0
  156. package/static/assets/erDiagram-Q63AITRT-Bo-fubgF.js +85 -0
  157. package/static/assets/flowDiagram-23GEKE2U-CSvxUDwh.js +156 -0
  158. package/static/assets/ganttDiagram-NO4QXBWP-DnBveWX6.js +292 -0
  159. package/static/assets/gitGraphDiagram-IHSO6WYX-B3rVL8c-.js +106 -0
  160. package/static/assets/graph-C9eacEi8.js +1 -0
  161. package/static/assets/index-LZSQkLE2.css +41 -0
  162. package/static/assets/index-y7XDSgMG.js +495 -0
  163. package/static/assets/infoDiagram-FWYZ7A6U-CvWV9yy2.js +2 -0
  164. package/static/assets/init-Gi6I4Gst.js +1 -0
  165. package/static/assets/ishikawaDiagram-FXEZZL3T-DF28a1N6.js +70 -0
  166. package/static/assets/journeyDiagram-5HDEW3XC-CB6CugYk.js +139 -0
  167. package/static/assets/kanban-definition-HUTT4EX6-ResSLF6d.js +89 -0
  168. package/static/assets/katex-C5jXJg4s.js +257 -0
  169. package/static/assets/layout-DEXfKzaS.js +1 -0
  170. package/static/assets/linear-CLO--ryk.js +1 -0
  171. package/static/assets/map-Czzmt4hB.js +1 -0
  172. package/static/assets/mindmap-definition-LN4V7U3C-BvW3EbxX.js +96 -0
  173. package/static/assets/ordinal-Cboi1Yqb.js +1 -0
  174. package/static/assets/pegDiagram-2B236MQR-BHCgqrrM.js +1 -0
  175. package/static/assets/pieDiagram-ENE6RG2P-DVmCQ5FA.js +39 -0
  176. package/static/assets/quadrantDiagram-ABIIQ3AL-B3e5KR52.js +7 -0
  177. package/static/assets/railroadDiagram-RFXS5EU6-Csv5ysLc.js +1 -0
  178. package/static/assets/requirementDiagram-TGXJPOKE-DOMVzvnB.js +84 -0
  179. package/static/assets/sankeyDiagram-HTMAVEWB-B1dcTOvy.js +40 -0
  180. package/static/assets/sequenceDiagram-DBY2YBRQ-BY414yeO.js +162 -0
  181. package/static/assets/sizeCapture-X5ZJPWSS-CuJfrfBN.js +1 -0
  182. package/static/assets/stateDiagram-2N3HPSRC-FX4rJkzV.js +1 -0
  183. package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +1 -0
  184. package/static/assets/swimlanes-5IMT3BWC-Sfy58mmv.js +2 -0
  185. package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +8 -0
  186. package/static/assets/timeline-definition-FHXFAJF6-CmV7by8p.js +120 -0
  187. package/static/assets/vennDiagram-L72KCM5P-FqIyFZFt.js +34 -0
  188. package/static/assets/wardleyDiagram-EHGQE667-BZ06O45i.js +78 -0
  189. package/static/assets/xychartDiagram-FW5EYKEG-BOkffR06.js +7 -0
  190. package/static/index.html +24 -0
@@ -0,0 +1,501 @@
1
+ ---
2
+ name: util-projectsync
3
+ model: claude-sonnet-4-6
4
+ effort: medium
5
+ description: >
6
+ Synchronize project folder structure, PRD.md, and BUG.md files based on the canonical application
7
+ and module definitions in CLAUDE.md. Validates dependencies (circular, missing, logical) and
8
+ checks for orphaned services across all applications. Creates missing application folders,
9
+ scaffolds new PRD.md and BUG.md files from templates, adds missing module sections to
10
+ existing files. Inserts [TODO] annotations into CLAUDE.md for validation failures.
11
+ Trigger on keywords: "sync project", "project sync", "sync folders", "sync modules",
12
+ "sync PRD", "sync BUG", "initialize project structure", "scaffold project",
13
+ "create project folders", "sync application structure", "validate dependencies".
14
+ Accepts no arguments — reads all configuration from CLAUDE.md.
15
+ ---
16
+
17
+ # Util Project Sync
18
+
19
+ Synchronize project folder structure, PRD.md, and BUG.md files to match the canonical structure defined in CLAUDE.md. Validates dependencies before syncing.
20
+
21
+ ## Input Resolution
22
+
23
+ This skill requires no arguments. All configuration is read from CLAUDE.md in the project root.
24
+
25
+ ### Required Sections in CLAUDE.md
26
+
27
+ | Section | Purpose |
28
+ |---------|---------|
29
+ | `# Custom Applications` | List of custom applications to create folders for and validate |
30
+ | `# Supporting 3rd Party Applications` | List of 3rd party applications referenced as dependencies |
31
+ | `## External Services` | External services (SMTP, Push Notifications, AI, WAF, etc.) referenced as dependencies |
32
+ | `# Modules` | Module definitions grouped under `## System Module` and `## Business Module` |
33
+
34
+ ### Application Detection
35
+
36
+ 1. Read the `# Custom Applications` section in CLAUDE.md
37
+ 2. Each application is listed as a `## <Application Name>` heading under the section
38
+ 3. If the section contains `**No Custom Applications**` or similar "none" indicator, report that there are no applications to sync and **stop**
39
+
40
+ ### 3rd Party Application Detection
41
+
42
+ 1. Read the `# Supporting 3rd Party Applications` section in CLAUDE.md
43
+ 2. Each 3rd party application is listed as a `## <Application Name>` heading under the section
44
+ 3. If the section contains `**No Supporting 3rd Party Applications**` or similar "none" indicator, treat as having zero 3rd party applications
45
+
46
+ ### External Services Detection
47
+
48
+ 1. Read the `## External Services` sub-section in CLAUDE.md. It may appear under `# Environment`, under `# Supporting 3rd Party Applications`, or as a standalone section — search the whole document.
49
+ 2. Services are listed as heading entries that follow `## External Services` until the next top-level (`#`) heading. They typically appear at `## <Service Name>` level (siblings of `## External Services`), but may also appear at `### <Service Name>` level — accept either.
50
+ 3. Extract the service name from each heading
51
+ 4. If the section does not exist or contains no services, treat as having zero external services
52
+
53
+ ### Module Detection
54
+
55
+ 1. Read the `# Modules` section in CLAUDE.md
56
+ 2. Modules are organized under `## System Module` and `## Business Module` subsections
57
+ 3. **Each module is listed as a `### <Module Name>` heading (three hashes) under its parent `## <tier>` heading.** This is critical: modules in CLAUDE.md are nested one level deeper than in PRD.md/BUG.md because of the extra `# Modules` wrapper. Do not skip modules just because they use `###` — `###` is the correct and expected level.
58
+ 4. Collect **every** `### <Name>` heading that appears between a `## System Module` / `## Business Module` heading and the next `##` or `#` heading. Treat siblings to the tier heading (not just immediate children in an outline sense) as in-scope. A module may be the first, last, or any-position heading in the list.
59
+ 5. If a module section contains `**There is no System Module**` or `**There is no Business Module**` or similar "none" indicator, treat that category as having zero modules.
60
+
61
+ #### Heading-Level Mapping Reference
62
+
63
+ Modules live at **different heading levels in different files**. Match them by name, not heading level:
64
+
65
+ | File | Parent heading | Module heading | Example |
66
+ |------|----------------|----------------|---------|
67
+ | CLAUDE.md | `## System Module` / `## Business Module` (nested under `# Modules`) | `### <Module>` — **three hashes** | `### Support Ticket` |
68
+ | PRD.md | `# System Module` / `# Business Module` (top-level) | `## <Module>` — **two hashes** | `## Support Ticket` |
69
+ | BUG.md | `# System Module` / `# Business Module` (top-level) | `## <Module>` — **two hashes** | `## Support Ticket` |
70
+
71
+ When comparing module names across files, strip heading hashes and whitespace, and compare case-insensitively. A `### Support Ticket` in CLAUDE.md is the same module as `## Support Ticket` in PRD.md/BUG.md.
72
+
73
+ #### Pre-Flight Module Count
74
+
75
+ After parsing CLAUDE.md, print a one-line confirmation of what was detected **before** proceeding to PRD.md/BUG.md sync, so a missed module is caught immediately:
76
+
77
+ ```
78
+ [Module Detection] System Modules: <count> — <comma-separated names>
79
+ [Module Detection] Business Modules: <count> — <comma-separated names>
80
+ ```
81
+
82
+ If a module the user expects to see is missing from this line, stop and investigate CLAUDE.md heading levels before continuing.
83
+
84
+ ## Workflow
85
+
86
+ ### 1. Parse CLAUDE.md
87
+
88
+ Read CLAUDE.md from the project root and extract:
89
+ - **Custom Application list**: names and their full content (description, dependencies) from `## <Name>` headings under `# Custom Applications`
90
+ - **3rd Party Application list**: names and their full content from `## <Name>` headings under `# Supporting 3rd Party Applications`
91
+ - **External Services list**: names from `## <Name>` headings under `## External Services`
92
+ - **All dependency target names**: combined list of custom application names, 3rd party application names, and external service names (used as the valid dependency pool)
93
+ - **System Modules**: names from every `### <Name>` heading (three hashes) appearing between `## System Module` and the next `##` or `#` heading. Do **not** look for `## <Name>` — that level is reserved for the tier heading itself.
94
+ - **Business Modules**: names from every `### <Name>` heading (three hashes) appearing between `## Business Module` and the next `##` or `#` heading.
95
+
96
+ After collecting both lists, emit the pre-flight module count line (see Module Detection → Pre-Flight Module Count). If the count is lower than expected for this project, stop and re-check heading levels before syncing — silently skipping a module that was incorrectly parsed is the primary failure mode this step guards against.
97
+
98
+ ### 2. Validate Dependencies
99
+
100
+ Run all validation checks across `# Custom Applications`, `# Supporting 3rd Party Applications`, and `## External Services`. Collect all issues found. After all checks are complete, insert `[TODO]` annotations into CLAUDE.md for each issue.
101
+
102
+ #### 2a. Dependency Validation
103
+
104
+ For each application (custom and 3rd party) that has a `- Depends on:` section, extract its dependency list. Each dependency is a bullet item under "Depends on:" — the dependency name is the text before any parenthetical qualifier or "for"/"to"/"when" clause.
105
+
106
+ **Check 1: No Circular Dependencies**
107
+
108
+ Build a directed dependency graph from all applications. Detect cycles using depth-first traversal. A circular dependency exists when application A depends on B, and B depends (directly or transitively) on A.
109
+
110
+ Example of a circular dependency:
111
+ - Hub Middleware depends on HC Adapter Message Queue
112
+ - HC Adapter Message Queue depends on Hub Single Sign On
113
+ - Hub Single Sign On depends on Hub Middleware (cycle!)
114
+
115
+ For each cycle found, record the full cycle path (e.g., `Hub Middleware -> HC Adapter Message Queue -> Hub Single Sign On -> Hub Middleware`).
116
+
117
+ **Check 2: All Dependencies Exist**
118
+
119
+ For each dependency listed, verify that a matching entry exists in `# Custom Applications`, `# Supporting 3rd Party Applications`, or `## External Services`. Match by name, case-insensitively. The dependency name may include a database name qualifier in parentheses (e.g., `Hub Support Database (urp_hub_kc)`) — match against the application/service name only (e.g., `Hub Support Database`).
120
+
121
+ **Check 3: Dependencies Are Logical and Consistent**
122
+
123
+ Check for logical issues:
124
+ - **Duplicate dependencies**: The same dependency listed more than once under the same application (e.g., `Hub Cache` listed twice under Hub Middleware)
125
+ - **Self-dependency**: An application listing itself as a dependency
126
+ - **Dependency on application in wrong tier**: A 3rd party application or external service depending on a custom application (3rd party and external services should not depend on custom apps; custom apps depend on 3rd party, external services, or other custom apps)
127
+
128
+ **Check 4: No Orphaned Services or 3rd Party Applications**
129
+
130
+ For each application in `# Supporting 3rd Party Applications` and each service in `## External Services`, check whether at least one custom application (from `# Custom Applications`) lists it in its `- Depends on:` section. Match by name, case-insensitively, stripping parenthetical qualifiers.
131
+
132
+ Flag any 3rd party application or external service that is **not depended on by any custom application**. These are orphaned — they are defined in CLAUDE.md but no custom application uses them, which may indicate a missing dependency declaration or a service that is no longer needed.
133
+
134
+ #### 2b. Insert TODO Annotations into CLAUDE.md
135
+
136
+ For each validation issue found, insert a `[TODO]` annotation line **immediately above** the `## <Application Name>` heading of the affected application in CLAUDE.md.
137
+
138
+ **Format:**
139
+ ```
140
+ - [TODO] <CATEGORY>: <description>
141
+ ## <Application Name>
142
+ ```
143
+
144
+ **Categories:**
145
+ | Category | Code |
146
+ |----------|------|
147
+ | Circular Dependency | `CIRCULAR_DEP` |
148
+ | Missing Dependency | `MISSING_DEP` |
149
+ | Duplicate Dependency | `DUP_DEP` |
150
+ | Self Dependency | `SELF_DEP` |
151
+ | Illogical Dependency | `ILLOGICAL_DEP` |
152
+ | Orphaned Service | `ORPHANED_SVC` |
153
+
154
+ **Examples:**
155
+ ```markdown
156
+ - [TODO] CIRCULAR_DEP: Circular dependency detected: Hub Middleware -> HC Adapter Message Queue -> Hub Single Sign On -> Hub Middleware
157
+ - [TODO] MISSING_DEP: Dependency "Hub Analytics" does not exist in Custom Applications, Supporting 3rd Party Applications, or External Services
158
+ - [TODO] DUP_DEP: Dependency "Hub Cache" is listed more than once
159
+ - [TODO] ORPHANED_SVC: No custom application depends on this service
160
+ ## Hub Middleware
161
+ ```
162
+
163
+ **Note:** If an application has multiple issues, insert multiple `[TODO]` lines above its heading — one per issue.
164
+
165
+ ### 3. Ensure Application Folders Exist
166
+
167
+ For each application in the `# Custom Applications` list:
168
+ 1. Convert the application name to `snake_case` for the folder name (e.g., "Hub Middleware" -> `hub_middleware`)
169
+ 2. Check if a root-level folder exists matching that name (also check for numeric-prefixed variants like `1_hub_middleware`)
170
+ 3. If the folder **does not exist**, create it at the project root using the snake_case name
171
+ 4. If the folder **already exists**, skip creation
172
+
173
+ **Note:** Folders are only created for Custom Applications, not for Supporting 3rd Party Applications.
174
+
175
+ ### 4. Sync PRD.md for Each Application
176
+
177
+ For each custom application folder:
178
+
179
+ #### 4a. PRD.md Does Not Exist
180
+
181
+ Create a new `PRD.md` inside the application folder using the template below:
182
+ - Populate the `# System Module` section with all system modules from CLAUDE.md
183
+ - Populate the `# Business Module` section with all business modules from CLAUDE.md
184
+ - Each module gets the standard subsections: `### User Story`, `### Non Functional Requirement`, `### Constraint`, `### Reference`, `### Test` — all versioned with `[v1.0.0]`
185
+
186
+ #### 4b. PRD.md Already Exists
187
+
188
+ 1. **Check for top-level extended sections.** Verify that the following three top-level sections exist in PRD.md. These sections sit between `# Context` and `# System Module`:
189
+ - `# Design System`
190
+ - `# Architecture Principle`
191
+ - `# High Level Process Flow`
192
+
193
+ For each section that is **missing**, insert it at the correct position (after `# Context` and before `# System Module`, in the order listed above) using the placeholder content from the PRD.md template. Record the addition for the summary output.
194
+
195
+ For each section that **already exists**, do nothing — never modify existing content.
196
+
197
+ 2. Parse the existing PRD.md to find all module headings (`## <Module Name>`) under `# System Module`, `# Business Module`, and (if present) `# Deprecated Modules`. For deprecated headings like `## ~~<Module>~~ [DEPRECATED]`, strip the strikethrough markers and `[DEPRECATED]` tag to obtain the canonical module name for comparison.
198
+ 3. Compare against the module list from CLAUDE.md:
199
+ - **Module exists in both CLAUDE.md and PRD.md (active section)**: Do nothing
200
+ - **Module exists in CLAUDE.md but is currently deprecated in PRD.md** (found under `# Deprecated Modules`): **Restore it.** Remove the `~~...~~` strikethrough and `[DEPRECATED]` tag from the heading, remove the `_Was: System Module_` / `_Was: Business Module_` hint line directly below the heading, and move the entire module block (heading through its closing `---`) back to the end of its original parent section (`# System Module` or `# Business Module`, per the hint). Preserve all existing content (user stories, NFRs, versions). Record the restoration for the summary.
201
+ - **Module exists in CLAUDE.md but NOT in PRD.md (neither active nor deprecated)**: Append the missing module section at the end of its parent section (`# System Module` or `# Business Module`) using the template structure with empty versioned subsections `[v1.0.0]`
202
+ - **Module exists in PRD.md (active) but NOT in CLAUDE.md**: **Soft-deprecate it.** Rename the heading from `## <Module>` to `## ~~<Module>~~ [DEPRECATED]`, insert an italic hint line `_Was: System Module_` or `_Was: Business Module_` immediately below the heading (so the original tier is recoverable), and move the entire module block (heading through its closing `---`) to a `# Deprecated Modules` section at the end of the file. If `# Deprecated Modules` does not yet exist, create it (see Deprecated Modules Template). **Do not touch the inner subsections or version tags** — only the heading is marked, and the block is relocated. Record the deprecation for the summary output.
203
+ - **Module is deprecated in PRD.md AND still absent from CLAUDE.md**: Do nothing — it is already deprecated. No duplicate markers.
204
+ 4. **Check for missing `### Test` subsections in active modules.** For each module that already exists in PRD.md under `# System Module` or `# Business Module` (not under `# Deprecated Modules`), check whether it contains a `### Test` subsection. If the `### Test` subsection is **missing**, insert it after the last existing standard subsection (`### Reference`) and before the `---` separator that ends the module section, using the template:
205
+ ```markdown
206
+ ### Test
207
+ [v1.0.0]
208
+ ```
209
+ Record the addition for the summary output. If the `### Test` subsection already exists, do nothing — never modify existing content. Deprecated modules are skipped for this check.
210
+
211
+ ### 5. Sync BUG.md for Each Application
212
+
213
+ For each custom application folder:
214
+
215
+ #### 5a. BUG.md Does Not Exist
216
+
217
+ Create a new `BUG.md` inside the application folder using the template below:
218
+ - Include the `# Common Module` section
219
+ - Populate the `# System Module` section with all system modules from CLAUDE.md
220
+ - Populate the `# Business Module` section with all business modules from CLAUDE.md
221
+ - Each module gets an empty section with a separator
222
+
223
+ #### 5b. BUG.md Already Exists
224
+
225
+ 1. Parse the existing BUG.md to find all module headings (`## <Module Name>`) under `# System Module`, `# Business Module`, and (if present) `# Deprecated Modules`. For deprecated headings like `## ~~<Module>~~ [DEPRECATED]`, strip the strikethrough markers and `[DEPRECATED]` tag to obtain the canonical module name for comparison.
226
+ 2. Compare against the module list from CLAUDE.md:
227
+ - **Module exists in both CLAUDE.md and BUG.md (active section)**: Do nothing
228
+ - **Module exists in CLAUDE.md but is currently deprecated in BUG.md** (found under `# Deprecated Modules`): **Restore it.** Remove the `~~...~~` strikethrough and `[DEPRECATED]` tag from the heading, remove the `_Was: ..._` hint line, and move the block back to the end of its original parent section (`# System Module` or `# Business Module`, per the hint). Preserve all existing bug content and version tags. Record the restoration for the summary.
229
+ - **Module exists in CLAUDE.md but NOT in BUG.md (neither active nor deprecated)**: Append the missing module section at the end of its parent section using the template structure
230
+ - **Module exists in BUG.md (active) but NOT in CLAUDE.md**: **Soft-deprecate it.** Rename the heading from `## <Module>` to `## ~~<Module>~~ [DEPRECATED]`, insert an italic hint line `_Was: System Module_` or `_Was: Business Module_` immediately below the heading, and move the entire module block (heading through its closing `---`) to a `# Deprecated Modules` section at the end of the file. If `# Deprecated Modules` does not yet exist, create it (see Deprecated Modules Template). Do not alter bug entries or version tags. Record the deprecation for the summary output.
231
+ - **Module is deprecated in BUG.md AND still absent from CLAUDE.md**: Do nothing.
232
+
233
+ ### 6. Resolve PRD.md and BUG.md Paths
234
+
235
+ PRD.md and BUG.md files are located inside the application folder. The exact path depends on whether the project uses a `context/` subfolder:
236
+ - If `<app_folder>/context/` exists, use `<app_folder>/context/PRD.md` and `<app_folder>/context/BUG.md`
237
+ - Otherwise, use `<app_folder>/PRD.md` and `<app_folder>/BUG.md`
238
+
239
+ Follow the folder structure defined in CLAUDE.md's `# Application Folder structure` section (or `# Folder structure` in older projects) to determine the correct path. When the CLAUDE.md specification lists `context/` as the home of PRD.md and BUG.md, treat the `context/` subfolder path as authoritative and create it if missing before scaffolding the files.
240
+
241
+ ### 7. Output Summary
242
+
243
+ Print a summary of all actions taken, validation results, and warnings:
244
+
245
+ ```
246
+ ## Project Sync Summary
247
+
248
+ ### Modules Detected in CLAUDE.md
249
+ | Tier | Count | Names |
250
+ |------|-------|-------|
251
+ | System Module | 7 | Authentication and Authorization, User, Notification, Activities, Audit Trail, Document Management, Batch Job |
252
+ | Business Module | 14 | Dashboard, Location Information, Corridor, Recruitment Step, Employer, Recruitment Agent, Industrial Classification, Occupation Classification, Job Demand, Candidate Profile, Recruitment Agent Sync, News and Announcement, Support Ticket, ... |
253
+
254
+ ### Dependency Validation
255
+ | Check | Status | Issues |
256
+ |-------|--------|--------|
257
+ | Circular Dependencies | PASS/FAIL | 0 or description |
258
+ | Missing Dependencies | PASS/FAIL | 0 or count |
259
+ | Duplicate Dependencies | PASS/FAIL | 0 or count |
260
+ | Self Dependencies | PASS/FAIL | 0 or count |
261
+ | Illogical Dependencies | PASS/FAIL | 0 or count |
262
+ | Orphaned Services | PASS/FAIL | 0 or count |
263
+
264
+ ### Validation TODOs Inserted
265
+ | Application | Section | Issues |
266
+ |-------------|---------|--------|
267
+ | Hub Middleware | Custom Applications | DUP_DEP: "Hub Cache" listed twice |
268
+ | Hub Analytics | Supporting 3rd Party Applications | ORPHANED_SVC: No custom application depends on this service |
269
+
270
+ ### Application Folders
271
+ | Application | Folder | Status |
272
+ |-------------|--------|--------|
273
+ | Hub Middleware | hub_middleware | Created |
274
+ | HC Adapter | hc_adapter | Already exists |
275
+
276
+ ### PRD.md Sync
277
+ | Application | Status | Sections Added | Modules Added | Modules Deprecated | Modules Restored | Test Subsections Added |
278
+ |-------------|--------|----------------|---------------|--------------------|------------------|------------------------|
279
+ | hub_middleware | Updated | Design System, Architecture Principle | Payment, Billing | Legacy Auth | Activities | User, Notification |
280
+ | hc_adapter | Created | (all sections) | (all modules) | - | - | (all modules) |
281
+
282
+ ### BUG.md Sync
283
+ | Application | Status | Modules Added | Modules Deprecated | Modules Restored |
284
+ |-------------|--------|---------------|--------------------|------------------|
285
+ | hub_middleware | Updated | Payment, Billing | Legacy Auth | Activities |
286
+ | hc_adapter | Created | (all modules) | - | - |
287
+
288
+ ### Deprecation Notes
289
+ - [hub_middleware/PRD.md] Module "Legacy Auth" was removed from CLAUDE.md — soft-deprecated under `# Deprecated Modules` (content preserved).
290
+ - [hub_middleware/PRD.md] Module "Activities" is back in CLAUDE.md — restored from `# Deprecated Modules` to `# System Module`.
291
+ ```
292
+
293
+ ## PRD.md Template
294
+
295
+ When creating a new PRD.md or adding module sections, use this structure:
296
+
297
+ ```markdown
298
+ # Context
299
+ - This document contain user stories, non-functional requirements, constraints and references by module about this application
300
+ - The application name can be inferred from the root folder name where this file is located.
301
+ - This is a version controlled document, the version is indicated in the square bracket after each section title, and it will be updated whenever there is any change in the content of that section. The versioning format is [v{major}.{minor}.{patch}] where:
302
+ - Major version will be updated when there is a significant change in the content that may affect the overall understanding of the module or the system.
303
+ - Minor version will be updated when there is a minor change in the content that may affect some details but not the overall understanding of the module or the system.
304
+ - Patch version will be updated when there is a small change in the content that does not affect the overall understanding of the module or the system, such as fixing typos or formatting issues.
305
+ - For user any item which is no longer valid or applicable, it will be marked with strikethrough and indicated in the new version.
306
+
307
+ ---
308
+
309
+ # Design System
310
+ - No design system defined yet. Refer to a design system specification file if available (e.g., `[DESIGN_SYSTEM.md](reference/DESIGN_SYSTEM.md)`).
311
+
312
+ ---
313
+
314
+ # Architecture Principle
315
+ - No architecture principles defined yet.
316
+
317
+ ---
318
+
319
+ # High Level Process Flow
320
+ - No high level process flows defined yet.
321
+
322
+ ---
323
+
324
+ # System Module
325
+
326
+ ## {{System Module Name}}
327
+
328
+ ### User Story
329
+ [v1.0.0]
330
+
331
+ ### Non Functional Requirement
332
+ [v1.0.0]
333
+
334
+ ### Constraint
335
+ [v1.0.0]
336
+
337
+ ### Reference
338
+ [v1.0.0]
339
+
340
+ ### Test
341
+ [v1.0.0]
342
+
343
+ ---
344
+
345
+ # Business Module
346
+
347
+ ## {{Business Module Name}}
348
+
349
+ ### User Story
350
+ [v1.0.0]
351
+
352
+ ### Non Functional Requirement
353
+ [v1.0.0]
354
+
355
+ ### Constraint
356
+ [v1.0.0]
357
+
358
+ ### Reference
359
+ [v1.0.0]
360
+
361
+ ### Test
362
+ [v1.0.0]
363
+
364
+ ---
365
+ ```
366
+
367
+ ### Adding a Missing Module to Existing PRD.md
368
+
369
+ When a module exists in CLAUDE.md but not in PRD.md, append this block at the end of the appropriate parent section (before the next `#` heading or end of file):
370
+
371
+ ```markdown
372
+
373
+ ## {{Module Name}}
374
+
375
+ ### User Story
376
+ [v1.0.0]
377
+
378
+ ### Non Functional Requirement
379
+ [v1.0.0]
380
+
381
+ ### Constraint
382
+ [v1.0.0]
383
+
384
+ ### Reference
385
+ [v1.0.0]
386
+
387
+ ### Test
388
+ [v1.0.0]
389
+
390
+ ---
391
+ ```
392
+
393
+ ## BUG.md Template
394
+
395
+ When creating a new BUG.md or adding module sections, use this structure:
396
+
397
+ ```markdown
398
+ # Context
399
+ - This document contain list of bugs reported by users or testers about this application
400
+ - All previously reported bugs have been resolved and merged into the PRD.md as NFRs or constraints.
401
+
402
+ ---
403
+
404
+ # Common Module
405
+
406
+ [v1.0.0]
407
+
408
+ ---
409
+
410
+ # System Module
411
+
412
+ ## {{System Module Name}}
413
+
414
+ [v1.0.0]
415
+
416
+ ---
417
+
418
+ # Business Module
419
+
420
+ ## {{Business Module Name}}
421
+
422
+ [v1.0.0]
423
+
424
+ ---
425
+ ```
426
+
427
+ ### Adding a Missing Module to Existing BUG.md
428
+
429
+ When a module exists in CLAUDE.md but not in BUG.md, append this block at the end of the appropriate parent section:
430
+
431
+ ```markdown
432
+
433
+ ## {{Module Name}}
434
+
435
+ [v1.0.0]
436
+
437
+ ---
438
+ ```
439
+
440
+ ## Deprecated Modules Template
441
+
442
+ When a module is soft-deprecated (present in PRD.md/BUG.md but removed from CLAUDE.md), it is relocated under a single trailing `# Deprecated Modules` section. The original tier is preserved in an italic hint line for later restoration.
443
+
444
+ **Section skeleton (created on first deprecation, appended to end of file):**
445
+
446
+ ```markdown
447
+
448
+ ---
449
+
450
+ # Deprecated Modules
451
+ - Modules in this section were present in a prior CLAUDE.md but have since been removed. Content is preserved (not deleted) so that historical user stories, NFRs, constraints, tests, or bug reports remain auditable. If a module returns to CLAUDE.md, the sync skill restores it automatically.
452
+
453
+ ---
454
+
455
+ ## ~~{{Module Name}}~~ [DEPRECATED]
456
+ _Was: System Module_
457
+
458
+ ### User Story
459
+ [v1.0.0]
460
+ ... (original content preserved verbatim) ...
461
+
462
+ ---
463
+ ```
464
+
465
+ **Rules for the deprecation move:**
466
+
467
+ - Only the `## <Module>` heading is rewritten (to `## ~~<Module>~~ [DEPRECATED]`) and a single `_Was: <tier>_` hint line is inserted directly under it. Everything else inside the module block — subsection headings, version tags, text, tables — is moved verbatim.
468
+ - The trailing `---` separator that closes the module block moves with it.
469
+ - If `# Deprecated Modules` already exists, append the block to its end rather than creating a second section.
470
+ - For BUG.md, the same structure applies, but the module body is a single `[v1.0.0]` (or whatever version was already present) followed by any bug entries — move them verbatim.
471
+
472
+ **Rules for restoration (module returns to CLAUDE.md):**
473
+
474
+ - Locate the deprecated block by canonical name (strip `~~...~~` and `[DEPRECATED]`).
475
+ - Rewrite the heading back to `## <Module>` and delete the `_Was: <tier>_` hint line.
476
+ - Move the block to the end of the parent section named in the hint (`# System Module` or `# Business Module`).
477
+ - If after restoration `# Deprecated Modules` contains no more module blocks, leave the empty `# Deprecated Modules` section in place — do not delete it (users may want to see that deprecations have historically occurred). Re-running the skill with all modules active leaves it untouched.
478
+
479
+ ## Important Rules
480
+
481
+ - **NEVER delete existing authored content** (user stories, NFRs, constraints, references, tests, bug entries) in PRD.md or BUG.md. When a module is removed from CLAUDE.md, soft-deprecate the module block — do not hard-delete it.
482
+ - **NEVER modify existing version tags** (e.g., `[v1.0.0]`). These are immutable, including when a module is deprecated or restored.
483
+ - **NEVER modify the inner subsections of an existing module** — only the `## <Module>` heading may be rewritten (for deprecation marking or restoration), and only the `_Was: <tier>_` hint line may be inserted or removed by this skill.
484
+ - Preserve all existing content, formatting, and indentation exactly.
485
+ - Application folder names must use `snake_case`.
486
+ - Folders are only created for `# Custom Applications`, not for `# Supporting 3rd Party Applications`.
487
+ - PRD.md and BUG.md are only created/synced for `# Custom Applications`.
488
+ - Dependency validation covers `# Custom Applications`, `# Supporting 3rd Party Applications`, and `## External Services`.
489
+ - When matching existing folders, account for numeric prefixes (e.g., `1_hub_middleware` matches application "Hub Middleware").
490
+ - When adding modules to existing files, maintain the correct order: system modules under `# System Module`, business modules under `# Business Module`.
491
+ - Always include separator lines (`---`) between module sections.
492
+ - New module sections added to existing files use `[v1.0.0]` as the initial version.
493
+ - Module synchronization is bi-directional with content preservation:
494
+ - Module added to CLAUDE.md → appended to PRD.md/BUG.md (or restored from `# Deprecated Modules` if a deprecated block with the same canonical name exists).
495
+ - Module removed from CLAUDE.md → soft-deprecated (heading marked `~~...~~ [DEPRECATED]`, block relocated under `# Deprecated Modules`). Content is never destroyed.
496
+ - Module name matching for deprecation/restoration is by **canonical name only** — strip `~~` strikethrough, `[DEPRECATED]` tag, and surrounding whitespace before comparing against CLAUDE.md entries. Name matching is case-insensitive.
497
+ - If CLAUDE.md has no custom applications defined, report this clearly and stop without making any changes.
498
+ - When inserting `[TODO]` annotations in CLAUDE.md, insert them **immediately above** the `## <Application Name>` heading — never inside the application's content.
499
+ - Do not insert duplicate `[TODO]` annotations. If re-running the skill, check for existing `[TODO]` lines above each application heading and skip if the same issue is already annotated.
500
+ - When matching dependency names, strip parenthetical qualifiers (e.g., `Hub Support Database (urp_hub_kc)` matches `Hub Support Database`).
501
+ - Validation is advisory — it does not block folder creation or PRD.md/BUG.md syncing. All steps run regardless of validation results.