@rashidee/co2 1.2.6 → 1.3.1

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 (86) hide show
  1. package/dist/index.js +5302 -3137
  2. package/drizzle/0011_workflow_history_v152.sql +5 -0
  3. package/drizzle/0012_prd_sections_v160.sql +14 -0
  4. package/drizzle/0013_brainstorm_sessions_v170.sql +10 -0
  5. package/drizzle/0014_bug_module_v180.sql +4 -0
  6. package/drizzle/0015_project_config_v190.sql +23 -0
  7. package/drizzle/0016_cicd_v2100.sql +22 -0
  8. package/drizzle/meta/_journal.json +42 -0
  9. package/package.json +1 -1
  10. package/plugin/README.md +2 -0
  11. package/plugin/SKILLS.md +414 -350
  12. package/plugin/skills/conductor-feature-develop/SKILL.md +1 -1
  13. package/plugin/skills/conductor-feature-prepare/SKILL.md +1 -1
  14. package/plugin/skills/depgen-k8s/SKILL.md +1 -1
  15. package/plugin/skills/tracegen-matrix/SKILL.md +1 -1
  16. package/plugin/skills/util-gencicdscript/SKILL.md +91 -0
  17. package/plugin/skills/util-gencicdscript/references/cicd-app-template.md +414 -0
  18. package/plugin/skills/util-plancicd/SKILL.md +130 -0
  19. package/plugin/skills/util-projectinit/SKILL.md +1 -1
  20. package/plugin/skills/util-projectsync/SKILL.md +1 -1
  21. package/plugin/skills/util-updprd/SKILL.md +85 -15
  22. package/plugin/skills/util-usanalyzer/SKILL.md +1 -1
  23. package/plugin/skills/util-ustagger/SKILL.md +1 -1
  24. package/static/assets/{abnfDiagram-VRR7QNED-DvPuwyCV.js → abnfDiagram-VRR7QNED-pIypz8mS.js} +1 -1
  25. package/static/assets/{arc-DRKw7sjs.js → arc-DzTLPg59.js} +1 -1
  26. package/static/assets/{architectureDiagram-ZJ3FMSHR-CaNcxUbC.js → architectureDiagram-ZJ3FMSHR-CuC9-Bft.js} +1 -1
  27. package/static/assets/{blockDiagram-677ZJIJ3-Demd4AOK.js → blockDiagram-677ZJIJ3-DcerPwn1.js} +1 -1
  28. package/static/assets/{c4Diagram-LMCZKHZV-PVKUfc2x.js → c4Diagram-LMCZKHZV-aH--jsPu.js} +1 -1
  29. package/static/assets/channel-2AGSySJb.js +1 -0
  30. package/static/assets/{chunk-2Q5K7J3B-CExf8ww_.js → chunk-2Q5K7J3B-6kmvWwD5.js} +1 -1
  31. package/static/assets/{chunk-32BRIVSS-CFPaoONF.js → chunk-32BRIVSS-Dgk5Y2Hd.js} +1 -1
  32. package/static/assets/{chunk-5VM5RSS4-DE2esM67.js → chunk-5VM5RSS4-DISUWWIg.js} +1 -1
  33. package/static/assets/{chunk-EX3LRPZG-SON_YdDG.js → chunk-EX3LRPZG-CptcVUzS.js} +1 -1
  34. package/static/assets/{chunk-JWPE2WC7-Qxah8LNr.js → chunk-JWPE2WC7-DpOM2Td1.js} +1 -1
  35. package/static/assets/{chunk-MOJQB5TN-BcWGQV3j.js → chunk-MOJQB5TN-D0mE8XQJ.js} +1 -1
  36. package/static/assets/{chunk-RYQCIY6F-DkDj-OR5.js → chunk-RYQCIY6F-6tMpp_wE.js} +1 -1
  37. package/static/assets/{chunk-V7JOEXUC-BlI1Mrah.js → chunk-V7JOEXUC-DlhAClLX.js} +1 -1
  38. package/static/assets/{chunk-VR4S4FIN-Agf__duj.js → chunk-VR4S4FIN-CnRRTJhL.js} +1 -1
  39. package/static/assets/{chunk-XXDRQBXY-B5CfAh85.js → chunk-XXDRQBXY-BjHtDhhp.js} +1 -1
  40. package/static/assets/classDiagram-OUVF2IWQ-DfuKvXel.js +1 -0
  41. package/static/assets/classDiagram-v2-EOCWNBFH-DfuKvXel.js +1 -0
  42. package/static/assets/{cose-bilkent-JH36ORCC-DO0cQkcy.js → cose-bilkent-JH36ORCC-ywkSH5WV.js} +1 -1
  43. package/static/assets/{cynefin-VYW2F7L2-CfOnsnXc.js → cynefin-VYW2F7L2-rNCSrA_M.js} +1 -1
  44. package/static/assets/{cynefinDiagram-TSTJHNR4-BJ8tULAv.js → cynefinDiagram-TSTJHNR4-CTO-xyj0.js} +1 -1
  45. package/static/assets/{dagre-VKFMJZFB-DfjwzHqP.js → dagre-VKFMJZFB-DXWjc-x2.js} +1 -1
  46. package/static/assets/{diagram-FQU43EPY-CndSOIIM.js → diagram-FQU43EPY-B6Yg08kE.js} +1 -1
  47. package/static/assets/{diagram-G47NLZAW-Czf5hN0Z.js → diagram-G47NLZAW-FdzgI0QA.js} +1 -1
  48. package/static/assets/{diagram-NH7WQ7WH-COAyojGh.js → diagram-NH7WQ7WH-C7MRGBLI.js} +1 -1
  49. package/static/assets/{diagram-OA4YK3LP-H8PoiN2m.js → diagram-OA4YK3LP-xpJMJx9r.js} +1 -1
  50. package/static/assets/{diagram-WEI45ONY-DzcaVzjp.js → diagram-WEI45ONY-D5PmiZy-.js} +1 -1
  51. package/static/assets/{ebnfDiagram-CCIWWBDH-DPazGYLJ.js → ebnfDiagram-CCIWWBDH-DJzkD6Lj.js} +1 -1
  52. package/static/assets/{erDiagram-Q63AITRT-Bo-fubgF.js → erDiagram-Q63AITRT-D24quzu9.js} +1 -1
  53. package/static/assets/{flowDiagram-23GEKE2U-CSvxUDwh.js → flowDiagram-23GEKE2U-2wLf_cAi.js} +1 -1
  54. package/static/assets/{ganttDiagram-NO4QXBWP-DnBveWX6.js → ganttDiagram-NO4QXBWP-hjpg1Ww8.js} +1 -1
  55. package/static/assets/{gitGraphDiagram-IHSO6WYX-B3rVL8c-.js → gitGraphDiagram-IHSO6WYX-Zm2bxgq8.js} +1 -1
  56. package/static/assets/{index-y7XDSgMG.js → index-CMSll7Xn.js} +173 -172
  57. package/static/assets/{index-LZSQkLE2.css → index-Dn_JY-18.css} +1 -1
  58. package/static/assets/{infoDiagram-FWYZ7A6U-CvWV9yy2.js → infoDiagram-FWYZ7A6U-5eq5DfJX.js} +1 -1
  59. package/static/assets/{ishikawaDiagram-FXEZZL3T-DF28a1N6.js → ishikawaDiagram-FXEZZL3T-BqBn7GDQ.js} +1 -1
  60. package/static/assets/{journeyDiagram-5HDEW3XC-CB6CugYk.js → journeyDiagram-5HDEW3XC-C6AceyMG.js} +1 -1
  61. package/static/assets/{kanban-definition-HUTT4EX6-ResSLF6d.js → kanban-definition-HUTT4EX6-BeQ_o04F.js} +1 -1
  62. package/static/assets/{linear-CLO--ryk.js → linear-CX49V_yy.js} +1 -1
  63. package/static/assets/{mindmap-definition-LN4V7U3C-BvW3EbxX.js → mindmap-definition-LN4V7U3C-CVzByupH.js} +1 -1
  64. package/static/assets/{pegDiagram-2B236MQR-BHCgqrrM.js → pegDiagram-2B236MQR-GuHmU0j3.js} +1 -1
  65. package/static/assets/{pieDiagram-ENE6RG2P-DVmCQ5FA.js → pieDiagram-ENE6RG2P-BKOiteQS.js} +1 -1
  66. package/static/assets/{quadrantDiagram-ABIIQ3AL-B3e5KR52.js → quadrantDiagram-ABIIQ3AL-CNtd5BPA.js} +1 -1
  67. package/static/assets/{railroadDiagram-RFXS5EU6-Csv5ysLc.js → railroadDiagram-RFXS5EU6-D4gIQQiY.js} +1 -1
  68. package/static/assets/{requirementDiagram-TGXJPOKE-DOMVzvnB.js → requirementDiagram-TGXJPOKE-BYokGs63.js} +1 -1
  69. package/static/assets/{sankeyDiagram-HTMAVEWB-B1dcTOvy.js → sankeyDiagram-HTMAVEWB-5RLXfMzy.js} +1 -1
  70. package/static/assets/{sequenceDiagram-DBY2YBRQ-BY414yeO.js → sequenceDiagram-DBY2YBRQ-DugFTncH.js} +1 -1
  71. package/static/assets/{sizeCapture-X5ZJPWSS-CuJfrfBN.js → sizeCapture-X5ZJPWSS-cCLHi08w.js} +1 -1
  72. package/static/assets/{stateDiagram-2N3HPSRC-FX4rJkzV.js → stateDiagram-2N3HPSRC-DQnxouNu.js} +1 -1
  73. package/static/assets/stateDiagram-v2-6OUMAXLB-BsTf558I.js +1 -0
  74. package/static/assets/{swimlanes-5IMT3BWC-Sfy58mmv.js → swimlanes-5IMT3BWC-CET7P2RH.js} +2 -2
  75. package/static/assets/swimlanesDiagram-G3AALYLV-Crsci1-o.js +8 -0
  76. package/static/assets/{timeline-definition-FHXFAJF6-CmV7by8p.js → timeline-definition-FHXFAJF6-49T4daxW.js} +1 -1
  77. package/static/assets/{vennDiagram-L72KCM5P-FqIyFZFt.js → vennDiagram-L72KCM5P-FqAF-S_r.js} +1 -1
  78. package/static/assets/{wardleyDiagram-EHGQE667-BZ06O45i.js → wardleyDiagram-EHGQE667-C9Du1lj9.js} +1 -1
  79. package/static/assets/{xychartDiagram-FW5EYKEG-BOkffR06.js → xychartDiagram-FW5EYKEG-CY-hJxel.js} +1 -1
  80. package/static/index.html +2 -2
  81. package/plugin/skills/util-preparek8senv/SKILL.md +0 -422
  82. package/static/assets/channel-C2nVbuwv.js +0 -1
  83. package/static/assets/classDiagram-OUVF2IWQ-DXJIljsR.js +0 -1
  84. package/static/assets/classDiagram-v2-EOCWNBFH-DXJIljsR.js +0 -1
  85. package/static/assets/stateDiagram-v2-6OUMAXLB-BVufbO_H.js +0 -1
  86. package/static/assets/swimlanesDiagram-G3AALYLV-wDCDw08H.js +0 -8
@@ -1,422 +0,0 @@
1
- ---
2
- name: util-preparek8senv
3
- model: claude-sonnet-4-6
4
- effort: medium
5
- description: >
6
- Prepare Kubernetes environment infrastructure by generating K8s manifests for all 3rd party
7
- supporting applications for a single target environment defined in CLAUDE.md. Creates/updates
8
- ENVIRONMENT.md with per-environment configs and credentials, then generates persistent
9
- StatefulSet-based K8s manifests for each 3rd party application (databases, message queues,
10
- caches, SSO, API gateways, etc.) directly in the `environment/` folder. Since the
11
- `environment/` folder is gitignored, each machine maintains its own independent copy.
12
- Ensures all services are remotely accessible using tools from DEVTOOL.md.
13
- Trigger on keywords: "prepare k8s environment", "prepare kubernetes", "setup k8s infra",
14
- "generate k8s manifests for 3rd party", "prepare environment", "setup infrastructure",
15
- "prepare k8s", "init k8s environment", "scaffold k8s environment".
16
- Accepts an optional environment argument to select which Kubernetes environment to generate for.
17
- ---
18
-
19
- # Util Prepare K8s Environment
20
-
21
- Prepare Kubernetes infrastructure by generating K8s manifests for all 3rd party supporting
22
- applications for a **single target environment**. Manifests are generated directly in the
23
- `environment/` folder (no per-environment subfolders). Since the `environment/` folder is
24
- gitignored, each machine maintains its own independent copy of the manifests.
25
-
26
- ## Input Resolution
27
-
28
- This skill accepts an optional `<environment>` argument:
29
-
30
- ```
31
- /util-preparek8senv [environment]
32
- ```
33
-
34
- | Argument | Required | Example | Description |
35
- |----------|----------|---------|-------------|
36
- | `<environment>` | No | `home_server` | Target environment name — must match a Kubernetes environment in CLAUDE.md |
37
-
38
- If omitted:
39
- - If CLAUDE.md defines exactly **one** Kubernetes environment → auto-select it.
40
- - If CLAUDE.md defines **multiple** Kubernetes environments → list them and ask the user to specify.
41
-
42
- The environment name is matched **case-insensitively** against the environment headings in CLAUDE.md, accepting snake_case, kebab-case, or title-case input (e.g., `home_server`, `home-server`, `Home Server` all match `## Home Server`).
43
-
44
- All other configuration is read from the project root:
45
-
46
- | File | Purpose | Required |
47
- |------|---------|----------|
48
- | `CLAUDE.md` | Project detail, environments, 3rd party applications, rules | Yes |
49
- | `ENVIRONMENT.md` | Per-environment configs and credentials for 3rd party apps | Created if missing |
50
- | `DEVTOOL.md` | Local development tools (CLI paths for kubectl, mysql, mongosh, etc.) | Yes |
51
-
52
- ## Workflow
53
-
54
- ### 1. Parse CLAUDE.md
55
-
56
- Read CLAUDE.md from the project root and extract:
57
-
58
- - **Project Code**: From `# Project Detail` → Project Code (e.g., `URP`). Used as K8s namespace (lowercase: `urp`).
59
- - **Environment list**: Each `## <Environment Name>` heading under `# Environment` is an environment. Extract:
60
- - Environment name (e.g., "Localhost", "Home Server")
61
- - Snake_case identifier for folder name (e.g., `localhost`, `home_server`)
62
- - Domain name (e.g., `localhost`, `home.server`) — from the `- Domain:` field
63
- - Deployment Type (e.g., `Manual`, `Kubernetes`) — from the `- Deployment Type:` field
64
- - Operating system, Kubernetes distribution/version (for Kubernetes environments)
65
- - SSH configuration (IP, port) — for remote environments
66
- - Kube config reference — if mentioned
67
- - **3rd Party Application list**: Each `## <Application Name>` heading under `# Supporting 3rd Party Applications`. Extract:
68
- - Application name (e.g., "Hub Cache", "Hub Core Database")
69
- - Technology and version (e.g., "Redis version 7.2.1", "MongoDB version 7.0.6")
70
- - Databases/database names if applicable
71
- - Dependencies (`- Depends on:` list)
72
- - **Credential rules**: From `# Rules` section — standard username/password format for new accounts.
73
-
74
- **Stop conditions:**
75
- - If `# Environment` section is missing or has no environments → stop with error
76
- - If `# Supporting 3rd Party Applications` section is missing or has no entries → stop with error
77
- - If `DEVTOOL.md` does not exist → stop with error
78
- - If no environment has `Deployment Type: Kubernetes` → stop with error: "No Kubernetes environments found in CLAUDE.md. This skill only generates manifests for environments with Deployment Type: Kubernetes."
79
-
80
- ### 1b. Target Environment Selection
81
-
82
- After parsing all environments, identify Kubernetes environments and select the target:
83
-
84
- 1. Filter environments to those with `Deployment Type: Kubernetes`.
85
- 2. If the user provided an `<environment>` argument, match it against the Kubernetes environments (case-insensitively, accepting snake_case, kebab-case, or title-case).
86
- - If matched → use it as the target environment.
87
- - If not matched → list available Kubernetes environments and stop.
88
- 3. If no argument was provided:
89
- - If exactly **one** Kubernetes environment exists → auto-select it.
90
- - If **multiple** exist → list them and ask the user to specify.
91
-
92
- The selected environment is the **target environment** used for Step 2 (ENVIRONMENT.md sync) and Step 3 (K8s manifest generation). Only this one environment is processed.
93
-
94
- ### 2. Sync ENVIRONMENT.md
95
-
96
- #### 2a. ENVIRONMENT.md Does Not Exist
97
-
98
- Create a new `ENVIRONMENT.md` at the project root using the template structure below.
99
-
100
- #### 2b. ENVIRONMENT.md Already Exists
101
-
102
- Treat as **append-only**:
103
- 1. Parse the existing ENVIRONMENT.md to identify which environment sections (`# <Environment Name>`) and which service subsections (`## <Service Name>`) exist.
104
- 2. Compare against CLAUDE.md:
105
- - **Missing environment section**: Append the entire environment section with all 3rd party app subsections.
106
- - **Missing service subsection** under an existing environment: Append the missing service subsection at the end of that environment section.
107
- - **Missing config keys** under an existing service: Append the missing key lines with `TODO` placeholder values.
108
- - **Existing config keys**: Do **nothing** — leave existing values as-is, even if they differ from defaults.
109
- 3. **Never remove, modify, or reorder** existing sections, headings, or values.
110
-
111
- #### 2c. ENVIRONMENT.md Template
112
-
113
- ```markdown
114
- # Context
115
- - This document contains environment-specific variables and credentials for all 3rd party
116
- supporting applications used in this project.
117
- - Organized by environment as defined in CLAUDE.md.
118
- - **This file must NOT be committed to version control.**
119
-
120
- ---
121
-
122
- # {{Environment Name}}
123
- {{For localhost:}}
124
- - Kube Config: `{{path to kube config or TODO}}`
125
- {{For remote environments:}}
126
- - SSH Credentials:
127
- - Username: `{{username or TODO}}`
128
- - Password: `{{password or TODO}}`
129
- - Kube Config: `{{path to kube config or TODO}}`
130
-
131
- ## {{3rd Party Application Name}}
132
- - {{Technology}} version {{version}}
133
- {{Technology-specific fields — see Section 2d}}
134
-
135
- ---
136
- ```
137
-
138
- #### 2d. Technology-Specific Config Fields
139
-
140
- For each 3rd party application, include config fields based on its technology type.
141
- Use credential rules from CLAUDE.md `# Rules` section for default username/password values.
142
- Use `TODO` for any value not yet known.
143
-
144
- | Technology | Config Fields |
145
- |-----------|---------------|
146
- | MongoDB | Host, Port, Username, Password, Databases (list) |
147
- | MySQL | Host, Port, Username, Password, Databases (list) |
148
- | Redis | Host, Port, Password, Database Index |
149
- | RabbitMQ | Host, AMQP Port, Admin Port, Username, Password, Vhost |
150
- | Keycloak | Host, HTTP Port, Admin Username, Admin Password, Realm, Client IDs |
151
- | Meilisearch | Host, Port, Master Key |
152
- | Kong | Proxy Host, Proxy Port, Admin Host, Admin Port |
153
- | Mailcatcher | SMTP Host, SMTP Port, HTTP Port |
154
-
155
- #### 2e. Custom Docker Image Override
156
-
157
- Any service in ENVIRONMENT.md may optionally specify a custom Docker image using the `Docker Image`
158
- field:
159
-
160
- - **`Docker Image`**: A Docker image reference (registry, name, and tag).
161
- Format: `- Docker Image: <image-reference>`
162
- Example: `- Docker Image: gilacode/hub_single_sign_on:26.5.4`
163
- The image will be used as-is in the K8s manifest with `imagePullPolicy: IfNotPresent`.
164
-
165
- When the `Docker Image` field is not present, the skill falls back to the **official Docker Hub
166
- image** with the exact version from CLAUDE.md (default behavior).
167
-
168
- This field is **per-environment** in ENVIRONMENT.md — one environment may use a custom image
169
- while another uses the official image. The skill reads the target environment's section.
170
-
171
- **Default values:**
172
- - Host: use the **Domain** from the environment's `- Domain:` field in CLAUDE.md (e.g., `localhost`, `home.server`). If no Domain is specified, fall back to `localhost` for localhost environments or the SSH IP for remote environments. If neither is available, use `TODO`.
173
- - Ports: technology defaults (MongoDB: `27017`, MySQL: `3306`, Redis: `6379`, RabbitMQ AMQP: `5672`, RabbitMQ Admin: `15672`, Keycloak: `8180`, Meilisearch: `7700`, Kong Proxy: `8000`, Kong Admin: `8001`, Mailcatcher SMTP: `1025`, Mailcatcher HTTP: `1080`)
174
- - Username/Password: from CLAUDE.md rules section (default: `bestrnd` / `B3st1n3t@2025`), or technology defaults (e.g., RabbitMQ: `guest`/`guest`, MongoDB: no auth)
175
-
176
- ### 3. Generate K8s Manifests
177
-
178
- #### 3a. Ensure Folder Structure
179
-
180
- 1. Check if `environment/` folder exists at the project root. If not, create it.
181
-
182
- Resulting structure (all manifests directly in `environment/`):
183
- ```
184
- environment/
185
- namespace.yaml
186
- smtp_server.yaml
187
- hub_cache_pvc.yaml
188
- hub_cache.yaml
189
- hub_core_database_pvc.yaml
190
- hub_core_database.yaml
191
- ...
192
- ```
193
-
194
- #### 3b. Generate Namespace Manifest
195
-
196
- Create `environment/namespace.yaml`:
197
- - Namespace name: project code in lowercase (e.g., `urp`)
198
- - Identical regardless of environment
199
-
200
- #### 3c. Generate PVC Manifests (Separate Files)
201
-
202
- For each 3rd party application that requires data persistence (databases, message queues, caches),
203
- generate a **separate** PVC file: `environment/<service_snake_case>_pvc.yaml`.
204
-
205
- **Why separate files:** If the PVC is bundled inside the service manifest, running
206
- `kubectl delete -f <service>.yaml` followed by `kubectl apply -f <service>.yaml` would delete
207
- and recreate the PVC, destroying all persisted data. Keeping the PVC in its own file ensures
208
- that `kubectl delete -f <service>.yaml` only removes the StatefulSet, ConfigMap, Secret, and
209
- Services — the PVC (and its data) remains untouched.
210
-
211
- The PVC file contains only the PersistentVolumeClaim resource:
212
-
213
- ```yaml
214
- # ==============================================================================
215
- # {{Application Name}} ({{Technology}}) — PersistentVolumeClaim
216
- # ==============================================================================
217
- ---
218
- apiVersion: v1
219
- kind: PersistentVolumeClaim
220
- metadata:
221
- name: {{service-name}}-pvc
222
- namespace: {{namespace}}
223
- labels:
224
- app: {{service-name}}
225
- project: {{project-code}}
226
- environment: {{environment}}
227
- spec:
228
- accessModes:
229
- - ReadWriteOnce
230
- resources:
231
- requests:
232
- storage: {{size — see Section 3d for defaults per technology}}
233
- ```
234
-
235
- #### 3d-svc. Generate Per-Service Manifests
236
-
237
- For each 3rd party application, generate `environment/<service_snake_case>.yaml` containing a multi-document YAML (separated by `---`) with:
238
-
239
- 1. **ConfigMap** — non-sensitive configuration (hostnames, ports, database names, vhosts)
240
- 2. **Secret** — sensitive configuration (passwords, admin credentials), base64-encoded. Read actual values from ENVIRONMENT.md for the matching environment.
241
- 3. **StatefulSet** (NOT Deployment) — ensures persistent identity, stable network IDs, and ordered scaling:
242
- - **Image resolution** (checked in ENVIRONMENT.md for the target environment — see Section 2e):
243
- 1. If `Docker Image` is specified → use the exact image reference as-is. Set `imagePullPolicy: IfNotPresent`. Do NOT include `args` or `command` — the custom image's `ENTRYPOINT`/`CMD` handles startup.
244
- 2. Otherwise → use the official Docker Hub image with the exact version from CLAUDE.md (e.g., `mongo:7.0.6`, `mysql:8.4`). Include `args`/`command` as needed by the technology.
245
- - `volumeMounts` referencing the PVC (defined in the separate `_pvc.yaml` file) for data persistence
246
- - `env` or `envFrom` referencing ConfigMap and Secret
247
- - Resource requests/limits (sensible defaults per technology)
248
- - Readiness and liveness probes (technology-appropriate)
249
- - `serviceName` matching the headless Service name
250
- 4. **Service** — two services per StatefulSet:
251
- - **Headless Service** (`clusterIP: None`) — for StatefulSet stable DNS
252
- - **NodePort Service** — for remote access from developer machines and CLI tools.
253
- Use a deterministic NodePort assignment strategy to avoid conflicts:
254
- - Base port = `30000 + (index * 10)` where index is the service's position in alphabetical order
255
- - Map each technology's primary port to the NodePort
256
- 5. **Init containers** (if the service depends on another service):
257
- - E.g., Keycloak depends on Hub Support Database — add an init container that waits for MySQL to be ready before starting Keycloak
258
-
259
- **Important:** The service manifest must NOT contain the PersistentVolumeClaim. It only references the PVC by `claimName` in the StatefulSet's `volumes` section.
260
-
261
- #### 3d. Technology-Specific Manifest Details
262
-
263
- **MongoDB:**
264
- - Image: `mongo:{version}`
265
- - PVC: 5Gi default
266
- - Ports: 27017
267
- - Env: `MONGO_INITDB_ROOT_USERNAME`, `MONGO_INITDB_ROOT_PASSWORD` (from Secret, or skip if no auth)
268
- - Init script: create databases listed in CLAUDE.md via ConfigMap-mounted init script
269
- - Probe: `mongosh --eval "db.adminCommand('ping')"`
270
-
271
- **MySQL:**
272
- - Image: `mysql:{version}`
273
- - PVC: 5Gi default
274
- - Ports: 3306
275
- - Env: `MYSQL_ROOT_PASSWORD` (from Secret)
276
- - Init script: create databases listed in CLAUDE.md via ConfigMap-mounted `/docker-entrypoint-initdb.d/` script
277
- - Probe: `mysqladmin ping -h localhost`
278
-
279
- **Redis:**
280
- - Image: `redis:{version}`
281
- - PVC: 1Gi default
282
- - Ports: 6379
283
- - Env: `REDIS_PASSWORD` (from Secret, optional — skip if no auth)
284
- - Probe: `redis-cli ping`
285
-
286
- **RabbitMQ:**
287
- - Image: `rabbitmq:{version}-management` (include management plugin for admin UI)
288
- - PVC: 2Gi default
289
- - Ports: 5672 (AMQP), 15672 (Management UI)
290
- - Env: `RABBITMQ_DEFAULT_USER`, `RABBITMQ_DEFAULT_PASS`, `RABBITMQ_DEFAULT_VHOST` (from Secret/ConfigMap)
291
- - Probe: `rabbitmq-diagnostics -q ping`
292
-
293
- **Keycloak:**
294
- - Image resolution: check ENVIRONMENT.md for `Docker Image` first (see Section 2e).
295
- - If custom image (e.g., `gilacode/hub_single_sign_on:26.5.4`): use the specified image name; do NOT add `args: ["start-dev"]` (custom image handles startup). Use HTTP Port from ENVIRONMENT.md (typically `8180` for custom builds) for containerPort, probes, and services. Add `KC_HTTP_PORT` to ConfigMap.
296
- - If no custom image: `quay.io/keycloak/keycloak:{version}` with `args: ["start-dev"]`. Default port `8080`.
297
- - PVC: none (stateless — state is in the database)
298
- - Env: `KC_DB`, `KC_DB_URL`, `KC_DB_USERNAME`, `KC_DB_PASSWORD`, `KC_HEALTH_ENABLED`, `KC_HTTP_ENABLED`, `KC_HOSTNAME_STRICT`, `KC_HTTP_PORT`, `KEYCLOAK_ADMIN`, `KEYCLOAK_ADMIN_PASSWORD` (from Secret/ConfigMap)
299
- - Init container: wait for MySQL (Hub Support Database) to be ready
300
- - Probe: HTTP GET `/health/ready` on the configured HTTP port
301
-
302
- **Kong API Gateway:**
303
- - Image: `kong:{version}`
304
- - PVC: none (stateless — DB-less mode or state in database)
305
- - Ports: 8000 (Proxy), 8001 (Admin API)
306
- - Env: `KONG_DATABASE=off`, `KONG_PROXY_LISTEN=0.0.0.0:8000`, `KONG_ADMIN_LISTEN=0.0.0.0:8001`
307
- - Probe: HTTP GET `/status` on admin port
308
-
309
- **Mailcatcher (SMTP):**
310
- - Image: `schickling/mailcatcher:{version}` or `sj26/mailcatcher:latest` (if specific version unavailable)
311
- - PVC: none (ephemeral — mail is not persisted)
312
- - Ports: 1025 (SMTP), 1080 (HTTP UI)
313
- - Probe: TCP check on port 1025
314
-
315
- **Meilisearch:**
316
- - Image: `getmeili/meilisearch:v{version}`
317
- - PVC: 2Gi default
318
- - Ports: 7700
319
- - Env: `MEILI_MASTER_KEY` (from Secret)
320
- - Probe: HTTP GET `/health`
321
-
322
- #### 3e. Create or Update Logic
323
-
324
- For each service, there are up to two files to manage in `environment/`:
325
- - `<service_snake_case>_pvc.yaml` — PVC file (only for services that require persistence)
326
- - `<service_snake_case>.yaml` — service manifest (ConfigMap, Secret, StatefulSet, Services)
327
-
328
- For each file:
329
-
330
- 1. **If the file does not exist** (CREATE mode): Generate and write the manifest.
331
- 2. **If it already exists** (UPDATE mode):
332
- - Read the existing manifest
333
- - Compare against current CLAUDE.md/ENVIRONMENT.md values for the target environment:
334
- - Version changed → update image tag
335
- - New databases added → update init scripts
336
- - Credentials changed in ENVIRONMENT.md → update Secret values
337
- - New dependencies → add init containers
338
- - Storage size changed → update PVC (in `_pvc.yaml` only)
339
- - Preserve any resources marked with `# CUSTOM:` comments
340
- - Update only the parts that changed
341
- - Log what was changed
342
-
343
- #### 3f. Remote Accessibility
344
-
345
- All NodePort Services must be accessible from the developer's machine using the CLI tools
346
- specified in DEVTOOL.md. Include a comment block at the top of each service manifest with
347
- connection instructions:
348
-
349
- ```yaml
350
- # Service: {{Application Name}} ({{Technology}} {{version}})
351
- # Environment: {{Environment Name}}
352
- #
353
- # Connect from local machine:
354
- # {{CLI tool from DEVTOOL.md}} {{connection command using NodePort}}
355
- #
356
- # Example:
357
- # mysql -h {{host}} -P {{nodeport}} -u {{username}} -p{{password}}
358
- # mongosh mongodb://{{host}}:{{nodeport}}/{{database}}
359
- # rdcli -h {{host}} -p {{nodeport}}
360
- # rabbitmqadmin -H {{host}} -P {{nodeport}} list queues
361
- ---
362
- ```
363
-
364
- Use the **Domain** from the target environment's `- Domain:` field in CLAUDE.md as host with NodePort (e.g., `localhost`, `home.server`). If no Domain is specified, fall back to `localhost` for localhost environments or the SSH IP for remote environments.
365
-
366
- ### 4. Output Summary
367
-
368
- Print a summary of all actions taken:
369
-
370
- ```
371
- ## K8s Environment Preparation Summary
372
-
373
- ### Target Environment
374
- | Environment | Deployment Type | Output Folder |
375
- |-------------|----------------|---------------|
376
- | Home Server | Kubernetes | environment/ |
377
-
378
- ### ENVIRONMENT.md
379
- | Action | Details |
380
- |--------|---------|
381
- | Created/Updated | Synced Home Server environment, 11 services |
382
-
383
- ### K8s Manifests Generated
384
- | Service | File | Status |
385
- |---------|------|--------|
386
- | SMTP Server | environment/smtp_server.yaml | Created |
387
- | Hub Cache (PVC) | environment/hub_cache_pvc.yaml | Created |
388
- | Hub Cache | environment/hub_cache.yaml | Created |
389
- | Hub Core Database (PVC) | environment/hub_core_database_pvc.yaml | Created |
390
- | Hub Core Database | environment/hub_core_database.yaml | Created |
391
- | ... | ... | ... |
392
-
393
- ### NodePort Assignments
394
- | Service | Primary Port | NodePort |
395
- |---------|-------------|----------|
396
- | HC Adapter Message Queue | 5672 | 30000 |
397
- | HC Database | 3306 | 30010 |
398
- | Hub Cache | 6379 | 30020 |
399
- | Hub Core Database | 27017 | 30030 |
400
- | Hub Single Sign On | 8180 (custom) / 8080 (official) | 30040 |
401
- | Hub Support Database | 3306 | 30050 |
402
- | SC API Gateway | 8000 | 30060 |
403
- | SC Adapter Message Queue | 5672 | 30070 |
404
- | SC Database | 3306 | 30080 |
405
- | SMTP Server | 1025 | 30090 |
406
- ```
407
-
408
- ## Important Rules
409
-
410
- - **NEVER remove, modify, or delete existing values** in ENVIRONMENT.md. Only add missing sections, services, and config keys.
411
- - **StatefulSet over Deployment** — all 3rd party services use StatefulSet to ensure persistent identity, stable network IDs, and data persistence across pod restarts.
412
- - **PersistentVolumeClaim in separate files** — PVCs MUST be generated in their own `<service>_pvc.yaml` files, never bundled inside the service manifest. This prevents accidental data loss when recreating services with `kubectl delete -f` / `kubectl apply -f`. The service manifest references the PVC by `claimName` only.
413
- - **PersistentVolumeClaim** is mandatory for any service that stores data (databases, message queues, caches). Ephemeral services (Mailcatcher, Kong DB-less) are exempt.
414
- - **NodePort for remote access** — every service must have a NodePort Service so developers can connect using local CLI tools from DEVTOOL.md.
415
- - **Deterministic NodePort assignment** — use alphabetical ordering of service names to assign NodePorts starting from 30000 with interval of 10. This ensures consistent ports across environments and avoids conflicts.
416
- - **Init containers for dependencies** — if a 3rd party app depends on another (e.g., Keycloak → MySQL), add an init container that waits for the dependency to be ready.
417
- - **Image resolution precedence** — for each service, check ENVIRONMENT.md for the target environment's `Docker Image` field first (see Section 2e). If present, use the exact image reference with `imagePullPolicy: IfNotPresent` and do not add `args`/`command`. If absent, fall back to the official Docker Hub image with the exact version from CLAUDE.md (never use `latest`).
418
- - **Namespace isolation** — all manifests use the project namespace (project code lowercase). The namespace manifest is generated once.
419
- - **Credential rules from CLAUDE.md** — when generating default credentials for new services, follow the `# Rules` section in CLAUDE.md for standard username/password format.
420
- - **Idempotent execution** — safe to re-run. Existing manifests are updated only where values changed. Manual customizations marked with `# CUSTOM:` are preserved.
421
- - **ENVIRONMENT.md is the credential source** — K8s Secret values come from ENVIRONMENT.md, not hardcoded. If a value is `TODO` in ENVIRONMENT.md, use `TODO` (base64-encoded) in the Secret and log a warning.
422
- - This skill only generates manifests for **3rd party supporting applications** — NOT for custom applications (those are handled by `depgen-k8s`).
@@ -1 +0,0 @@
1
- import{ag as o,ah as n}from"./index-y7XDSgMG.js";const t=(a,r)=>o.lang.round(n.parse(a)[r]);export{t as c};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BlI1Mrah.js";import{_ as i}from"./index-y7XDSgMG.js";import"./chunk-5VM5RSS4-DE2esM67.js";import"./chunk-XXDRQBXY-B5CfAh85.js";import"./chunk-VR4S4FIN-Agf__duj.js";import"./chunk-32BRIVSS-CFPaoONF.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{s as a,c as s,a as e,C as t}from"./chunk-V7JOEXUC-BlI1Mrah.js";import{_ as i}from"./index-y7XDSgMG.js";import"./chunk-5VM5RSS4-DE2esM67.js";import"./chunk-XXDRQBXY-B5CfAh85.js";import"./chunk-VR4S4FIN-Agf__duj.js";import"./chunk-32BRIVSS-CFPaoONF.js";var u={parser:e,get db(){return new t},renderer:s,styles:a,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{u as diagram};
@@ -1 +0,0 @@
1
- import{s as e,b as r,a,S as s}from"./chunk-EX3LRPZG-SON_YdDG.js";import{_ as i}from"./index-y7XDSgMG.js";import"./chunk-XXDRQBXY-B5CfAh85.js";import"./chunk-VR4S4FIN-Agf__duj.js";import"./chunk-32BRIVSS-CFPaoONF.js";var p={parser:a,get db(){return new s(2)},renderer:r,styles:e,init:i(t=>{t.state||(t.state={}),t.state.arrowMarkerAbsolute=t.arrowMarkerAbsolute},"init")};export{p as diagram};
@@ -1,8 +0,0 @@
1
- import{c as e,s as r}from"./flowDiagram-23GEKE2U-CSvxUDwh.js";import{_ as a}from"./index-y7XDSgMG.js";import"./chunk-5VM5RSS4-DE2esM67.js";import"./chunk-XXDRQBXY-B5CfAh85.js";import"./chunk-VR4S4FIN-Agf__duj.js";import"./chunk-32BRIVSS-CFPaoONF.js";import"./channel-C2nVbuwv.js";var o=a(t=>`${r(t)}
2
- .swimlane.cluster rect {
3
- stroke: ${t.clusterBorder} !important;
4
- }
5
- [data-look="neo"].cluster rect {
6
- filter: none;
7
- }
8
- `,"getStyles"),s=o,f=e({defaultLayout:"swimlane",styles:s});export{f as diagram};