@fluentcommerce/ai-skills 0.1.0

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 (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +622 -0
  3. package/bin/cli.mjs +1973 -0
  4. package/content/cli/agents/fluent-cli/agent.json +149 -0
  5. package/content/cli/agents/fluent-cli.md +132 -0
  6. package/content/cli/skills/fluent-bootstrap/SKILL.md +181 -0
  7. package/content/cli/skills/fluent-cli-index/SKILL.md +63 -0
  8. package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +77 -0
  9. package/content/cli/skills/fluent-cli-reference/SKILL.md +1031 -0
  10. package/content/cli/skills/fluent-cli-retailer/SKILL.md +85 -0
  11. package/content/cli/skills/fluent-cli-settings/SKILL.md +106 -0
  12. package/content/cli/skills/fluent-connect/SKILL.md +886 -0
  13. package/content/cli/skills/fluent-module-deploy/SKILL.md +349 -0
  14. package/content/cli/skills/fluent-profile/SKILL.md +180 -0
  15. package/content/cli/skills/fluent-workflow/SKILL.md +310 -0
  16. package/content/dev/agents/fluent-dev/agent.json +88 -0
  17. package/content/dev/agents/fluent-dev.md +525 -0
  18. package/content/dev/reference-modules/catalog.json +4754 -0
  19. package/content/dev/skills/fluent-build/SKILL.md +192 -0
  20. package/content/dev/skills/fluent-connection-analysis/SKILL.md +386 -0
  21. package/content/dev/skills/fluent-custom-code/SKILL.md +895 -0
  22. package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +714 -0
  23. package/content/dev/skills/fluent-e2e-test/SKILL.md +394 -0
  24. package/content/dev/skills/fluent-event-api/SKILL.md +945 -0
  25. package/content/dev/skills/fluent-feature-explain/SKILL.md +603 -0
  26. package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +695 -0
  27. package/content/dev/skills/fluent-feature-plan/SKILL.md +227 -0
  28. package/content/dev/skills/fluent-job-batch/SKILL.md +138 -0
  29. package/content/dev/skills/fluent-mermaid-validate/SKILL.md +86 -0
  30. package/content/dev/skills/fluent-module-scaffold/SKILL.md +1928 -0
  31. package/content/dev/skills/fluent-module-validate/SKILL.md +775 -0
  32. package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1108 -0
  33. package/content/dev/skills/fluent-retailer-config/SKILL.md +1111 -0
  34. package/content/dev/skills/fluent-rule-scaffold/SKILL.md +385 -0
  35. package/content/dev/skills/fluent-scope-decompose/SKILL.md +1021 -0
  36. package/content/dev/skills/fluent-session-audit-export/SKILL.md +632 -0
  37. package/content/dev/skills/fluent-session-summary/SKILL.md +195 -0
  38. package/content/dev/skills/fluent-settings/SKILL.md +1058 -0
  39. package/content/dev/skills/fluent-source-onboard/SKILL.md +632 -0
  40. package/content/dev/skills/fluent-system-monitoring/SKILL.md +767 -0
  41. package/content/dev/skills/fluent-test-data/SKILL.md +513 -0
  42. package/content/dev/skills/fluent-trace/SKILL.md +1143 -0
  43. package/content/dev/skills/fluent-transition-api/SKILL.md +346 -0
  44. package/content/dev/skills/fluent-version-manage/SKILL.md +744 -0
  45. package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +959 -0
  46. package/content/dev/skills/fluent-workflow-builder/SKILL.md +319 -0
  47. package/content/dev/skills/fluent-workflow-deploy/SKILL.md +267 -0
  48. package/content/mcp-extn/agents/fluent-mcp.md +69 -0
  49. package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +461 -0
  50. package/content/mcp-official/agents/fluent-mcp-core.md +91 -0
  51. package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -0
  52. package/content/rfl/agents/fluent-rfl.md +56 -0
  53. package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -0
  54. package/docs/CAPABILITY_MAP.md +77 -0
  55. package/docs/CLI_COVERAGE.md +47 -0
  56. package/docs/DEV_WORKFLOW.md +802 -0
  57. package/docs/FLOW_RUN.md +142 -0
  58. package/docs/USE_CASES.md +404 -0
  59. package/metadata.json +156 -0
  60. package/package.json +51 -0
@@ -0,0 +1,1108 @@
1
+ ---
2
+ name: fluent-pre-deploy-check
3
+ description: Run pre-deployment checklist for Fluent Commerce modules and workflows. Validates environment readiness, module structure, workflow integrity, settings, and connection topology before deployment. Triggers on "pre-deploy check", "deployment checklist", "ready to deploy", "deploy gate", "can I deploy".
4
+ user-invocable: true
5
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep
6
+ argument-hint: [--profile <profile>] [--retailer <ref>] [--module-path <path>] [--skip <phase,...>]
7
+ ---
8
+
9
+ # Pre-Deployment Checklist
10
+
11
+ Structured deployment gate between "build passes" and "deploy to retailer." Runs 8 phases of validation with 26 individual quality gates, producing a machine-readable pass/fail report that blocks deployment on critical failures.
12
+
13
+ This skill is the final checkpoint in the Agent-Driven Development (ADD) lifecycle, positioned at Phase 6 (Demo Deployment). It aggregates validation from multiple specialized skills and MCP tools into a single, traceable pre-flight report.
14
+
15
+ ## Planning Gate
16
+
17
+ **This skill IS the planning gate for deployment.** Running a pre-deploy check is always safe (read-only analysis). No approval needed to run the check itself. However, if the check result includes a GO verdict and the user asks to proceed with deployment, the deployment skills (`/fluent-module-deploy`, `/fluent-workflow-deploy`) have their own planning gates that apply.
18
+
19
+ ## Ownership Boundary
20
+
21
+ This skill owns:
22
+ - The checklist execution protocol (phase sequencing, gate evaluation, severity thresholds)
23
+ - The aggregate pass/fail decision and overall deployment readiness verdict
24
+ - The checklist report artifact (`pre-deploy/<MODULE>-<VERSION>.checklist.json`)
25
+
26
+ This skill delegates to:
27
+ - `/fluent-module-validate` -- module structure validation (Phase 2)
28
+ - `/fluent-build` -- Maven build execution (Phase 2)
29
+ - `/fluent-version-manage` -- version comparison and drift detection (Phase 2, Phase 7)
30
+ - `/fluent-workflow-analyzer` -- workflow structure analysis and orphan detection (Phase 3)
31
+ - `/fluent-connection-analysis` -- cross-entity topology and dependency mapping (Phase 4)
32
+ - `/fluent-settings` -- settings audit and value validation (Phase 5)
33
+ - `/fluent-module-deploy` -- receives the READY signal to proceed with deployment
34
+ - `/fluent-session-summary` -- tracks all checklist operations for audit trail
35
+
36
+ Individual gate validations are NOT reimplemented here. This skill orchestrates existing capabilities and evaluates their results against deployment thresholds.
37
+
38
+ ## When to Use
39
+
40
+ - Before deploying a module to any retailer (mandatory gate)
41
+ - Before deploying workflow changes to a retailer
42
+ - As part of CI/CD pipelines for automated release gating
43
+ - When asked "is this ready to deploy?" or "can I deploy?"
44
+ - After completing all development tasks from a scope decomposition
45
+ - Before go-live as part of Ready For Launch (RFL) preparation
46
+
47
+ ## Required Inputs
48
+
49
+ | Parameter | Required | Default | Description |
50
+ |-----------|----------|---------|-------------|
51
+ | `--profile` | No | Active `FLUENT_PROFILE` | Target Fluent CLI profile for environment queries |
52
+ | `--retailer` | No | Profile default retailer | Target retailer ref (e.g., `HM_TEST`) |
53
+ | `--module-path` | No | Auto-detect from `accounts/<PROFILE>/SOURCE/` | Path to module root (directory containing `resources/module.json`) |
54
+ | `--workflow-path` | No | Auto-detect from `accounts/<PROFILE>/workflows/<RETAILER>/` | Path to workflow JSON directory |
55
+ | `--skip` | No | None | Comma-separated phase numbers to skip (e.g., `--skip 4,7`) |
56
+ | `--severity-threshold` | No | `CRITICAL` | Minimum severity that blocks deployment: `CRITICAL`, `HIGH`, or `MEDIUM` |
57
+ | `--deployed-version` | No | Auto-detect via `plugin.list` | Currently deployed module version for diff comparison |
58
+
59
+ ### Auto-Detection Logic
60
+
61
+ When `--module-path` is not provided:
62
+ 1. Search `accounts/<PROFILE>/SOURCE/` recursively for `resources/module.json`
63
+ 2. If exactly one found, use it
64
+ 3. If multiple found, list them and ask user to select
65
+ 4. If none found, skip module-related phases (2, 7.2, 7.3) and note in report
66
+
67
+ When `--workflow-path` is not provided:
68
+ 1. Check `accounts/<PROFILE>/workflows/<RETAILER>/` for `*.json` files
69
+ 2. Fall back to `accounts/<PROFILE>/workflows/` (legacy flat layout)
70
+ 3. If no workflows found, skip workflow-related phases (3, 4) and note in report
71
+
72
+ ## Partial Deployment Scenarios
73
+
74
+ Not every deployment includes all components. The checklist adapts:
75
+
76
+ | Scenario | Phases Run | Phases Skipped |
77
+ |----------|-----------|---------------|
78
+ | Module + Workflow deploy | All 8 phases | None |
79
+ | Module-only deploy | 1, 2, 5, 6, 7, 8 | 3 (Workflow), 4 (Connection) |
80
+ | Workflow-only deploy | 1, 3, 4, 5, 6, 8 | 2 (Module), 7.2-7.3 (module-specific risk) |
81
+ | Settings-only deploy | 1, 5, 6, 8 | 2 (Module), 3 (Workflow), 4 (Connection), 7 (Risk) |
82
+ | Multiple modules | All 8, repeated per module | None (iterate Phase 2 per module) |
83
+
84
+ Phases are auto-skipped when their inputs are unavailable. The `--skip` flag forces additional skips beyond auto-detection.
85
+
86
+ ---
87
+
88
+ ## Checklist Phases and Gates
89
+
90
+ ### Phase 1: Environment Readiness
91
+
92
+ Verify the target environment is accessible, correctly configured, and capable of receiving a deployment.
93
+
94
+ #### Gate 1.0: CLI Available
95
+
96
+ **Severity:** HIGH
97
+
98
+ **Tool:** Bash (`fluent --version`)
99
+
100
+ **Invocation:**
101
+ ```bash
102
+ fluent --version
103
+ ```
104
+
105
+ **Pass criteria:** Command succeeds and returns a version string (e.g., `v2.0.0`).
106
+
107
+ **Fail criteria:** Command not found or returns an error. Many deployment operations (module install, workflow list/download, verification) require the Fluent CLI. HIGH rather than CRITICAL because MCP tools can handle some operations without CLI, but the standard deployment path requires it.
108
+
109
+ **Details captured:** CLI version string, CLI path (from `which fluent` or `where fluent`).
110
+
111
+ #### Gate 1.1: Authentication Valid
112
+
113
+ **Severity:** CRITICAL
114
+
115
+ **Tool:** `connection.test` (MCP fluent-mcp-extn)
116
+
117
+ **Invocation:**
118
+ ```
119
+ connection.test({})
120
+ ```
121
+
122
+ **Pass criteria:** Response contains `user` object with `id`, `username`, and at least one role. The `status` field of the user is not `INACTIVE`.
123
+
124
+ **Fail criteria:** Connection refused, auth error, or user has no roles. Deployment cannot proceed without valid authentication.
125
+
126
+ **Details captured:** Username, email, roles list, retailer context.
127
+
128
+ #### Gate 1.2: Retailer Exists and Active
129
+
130
+ **Severity:** CRITICAL
131
+
132
+ **Tool:** `environment.discover` (MCP fluent-mcp-extn)
133
+
134
+ **Invocation:**
135
+ ```
136
+ environment.discover({ include: ["retailer"] })
137
+ ```
138
+
139
+ **Pass criteria:** Response contains retailer with `status = "ACTIVE"` and `ref` matching the `--retailer` parameter.
140
+
141
+ **Fail criteria:** Retailer not found, status is not ACTIVE, or ref mismatch. Cannot deploy to an inactive or non-existent retailer.
142
+
143
+ **Details captured:** Retailer ID, ref, tradingName, status.
144
+
145
+ #### Gate 1.3: Locations Exist
146
+
147
+ **Severity:** HIGH
148
+
149
+ **Tool:** `environment.discover` (MCP fluent-mcp-extn)
150
+
151
+ **Invocation:**
152
+ ```
153
+ environment.discover({ include: ["locations"] })
154
+ ```
155
+
156
+ **Pass criteria:** At least 1 location exists with `type = "WAREHOUSE"` or `type = "STORE"` and `status = "ACTIVE"`.
157
+
158
+ **Fail criteria:** No active locations found. Most workflows require at least one location for fulfilment routing. This is HIGH rather than CRITICAL because some module deployments (e.g., pure data modules) do not require locations.
159
+
160
+ **Details captured:** Total location count, count by type (WAREHOUSE, STORE), active vs inactive.
161
+
162
+ #### Gate 1.4: Networks Wired
163
+
164
+ **Severity:** HIGH
165
+
166
+ **Tool:** `environment.discover` (MCP fluent-mcp-extn)
167
+
168
+ **Invocation:**
169
+ ```
170
+ environment.discover({ include: ["networks"] })
171
+ ```
172
+
173
+ **Pass criteria:** At least 1 network exists with at least 1 associated location.
174
+
175
+ **Fail criteria:** No networks found, or all networks have zero locations. Fulfilment routing requires network-to-location wiring.
176
+
177
+ **Details captured:** Network count, locations-per-network count.
178
+
179
+ ---
180
+
181
+ ### Phase 2: Module Integrity
182
+
183
+ Verify the module builds cleanly, tests pass, structure is valid, and the version has been bumped.
184
+
185
+ **Skip condition:** No `--module-path` provided and no module found via auto-detection.
186
+
187
+ #### Gate 2.1: Build Passes
188
+
189
+ **Severity:** CRITICAL
190
+
191
+ **Tool:** Bash (`mvn clean install`)
192
+
193
+ **Invocation:**
194
+ ```bash
195
+ cd "<MODULE_ROOT>/plugins" && mvn clean install -q 2>&1
196
+ ```
197
+
198
+ **Pass criteria:** Exit code 0. Maven build completes without compilation errors.
199
+
200
+ **Fail criteria:** Non-zero exit code. Compilation errors, dependency resolution failures, or plugin errors. Deployment of a broken build must be blocked.
201
+
202
+ **Details captured:** Build duration, test count from Maven output (e.g., "Tests run: 42, Failures: 0, Errors: 0, Skipped: 0").
203
+
204
+ #### Gate 2.2: Tests Pass
205
+
206
+ **Severity:** CRITICAL
207
+
208
+ **Tool:** Included in the Maven build output from Gate 2.1.
209
+
210
+ **Pass criteria:** Maven reports 0 failures and 0 errors in test execution. The string `BUILD SUCCESS` appears in output.
211
+
212
+ **Fail criteria:** Any test failure or error. Parse Maven output for `Tests run: X, Failures: Y, Errors: Z`. If Y > 0 or Z > 0, this gate fails.
213
+
214
+ **Details captured:** Total tests, failures, errors, skipped count.
215
+
216
+ #### Gate 2.3: module.json Valid
217
+
218
+ **Severity:** CRITICAL
219
+
220
+ **Tool:** Read (`resources/module.json` in the module root)
221
+
222
+ **Invocation:**
223
+ ```
224
+ Read file: <MODULE_ROOT>/resources/module.json
225
+ ```
226
+ Then validate the parsed JSON:
227
+
228
+ **Pass criteria:** All of the following:
229
+ - File exists and is valid JSON
230
+ - Has `name` field (non-empty string)
231
+ - Has `version` field (matches semver pattern `^\d+\.\d+\.\d+(-SNAPSHOT)?$`)
232
+ - Has `modules` array with at least one entry
233
+ - Each module entry has `provides` array with rule registrations
234
+ - No duplicate rule names across all `provides` arrays
235
+
236
+ **Fail criteria:** Missing file, invalid JSON, missing required fields, or duplicate rule registrations. The module manifest is the deployment identity -- any defect here is CRITICAL.
237
+
238
+ **Details captured:** Module name, version, rule count, any validation errors.
239
+
240
+ #### Gate 2.4: Version Bumped vs Deployed
241
+
242
+ **Severity:** HIGH
243
+
244
+ **Tool:** `plugin.list` (MCP fluent-mcp-extn) + Read (`resources/module.json`)
245
+
246
+ **Invocation:**
247
+ ```
248
+ plugin.list({})
249
+ ```
250
+ Then extract the deployed module version by matching module name from the rule key prefix pattern `<ACCOUNT>.<context>.<RuleName>`.
251
+
252
+ Alternatively, if `--deployed-version` is provided, compare directly.
253
+
254
+ **Pass criteria:** Local version in `module.json` is strictly greater than the currently deployed version. Semver comparison: `localVersion > deployedVersion`.
255
+
256
+ **Fail criteria:** Local version equals or is less than deployed version. Deploying the same version causes confusion; deploying a lower version is a potential rollback. This is HIGH because version-same deployments are technically possible (idempotent reinstall) but indicate a process gap.
257
+
258
+ **Edge case:** If `plugin.list` returns no rules matching this module (first-time deployment), this gate passes with a note: "First deployment -- no previous version to compare."
259
+
260
+ **Details captured:** Local version, deployed version (or "not deployed"), comparison result.
261
+
262
+ ---
263
+
264
+ ### Phase 3: Workflow Validity
265
+
266
+ Verify all workflow JSON files are structurally sound, internally consistent, and reference only existing rules.
267
+
268
+ **Skip condition:** No `--workflow-path` provided and no workflows found via auto-detection.
269
+
270
+ #### Gate 3.1: Workflows Parse
271
+
272
+ **Severity:** CRITICAL
273
+
274
+ **Tool:** Read + JSON validation (each `*.json` file in the workflow directory)
275
+
276
+ **Invocation:**
277
+ ```
278
+ For each *.json file in <WORKFLOW_PATH>/:
279
+ Read file content
280
+ Parse as JSON
281
+ Validate required fields
282
+ ```
283
+
284
+ **Pass criteria:** Every workflow JSON file:
285
+ - Parses as valid JSON
286
+ - Has a `name` field (string, e.g., `"ORDER::HD"`)
287
+ - Has a `statuses` array with at least one status entry
288
+ - Has a `rulesets` array with at least one ruleset entry
289
+ - Each ruleset has `name`, `rules` (array), and `triggers` (array)
290
+
291
+ **Fail criteria:** Any file fails to parse, or any required structural field is missing. Deploying a malformed workflow will cause runtime failures.
292
+
293
+ **Details captured:** Per-file parse status, workflow names found, total ruleset count, total status count.
294
+
295
+ #### Gate 3.2: No Orphaned Rulesets
296
+
297
+ **Severity:** HIGH
298
+
299
+ **Tool:** Workflow JSON analysis (apply `/fluent-workflow-analyzer` orphan detection logic)
300
+
301
+ **Invocation:**
302
+ For each parsed workflow, build the trigger graph:
303
+ 1. Index all statuses defined in `statuses[]`
304
+ 2. Index all rulesets and their `triggers[].status` entries
305
+ 3. Index all `SendEvent` / `ScheduleEvent` / `ForwardEvent*` rule props for `eventName`
306
+ 4. For each ruleset, check if it is reachable:
307
+ - Has a trigger on a defined status, OR
308
+ - Has its name as a `SendEvent` target from another reachable ruleset, OR
309
+ - Is the `CREATE` ruleset (always reachable)
310
+
311
+ **Pass criteria:** Every ruleset is reachable from either a status trigger or an inbound SendEvent chain.
312
+
313
+ **Fail criteria:** One or more rulesets have no inbound path. Orphaned rulesets indicate dead code or missing wiring that could cause silent failures.
314
+
315
+ **Details captured:** List of orphaned rulesets (if any), total rulesets analyzed.
316
+
317
+ #### Gate 3.3: Rules Exist in Registry
318
+
319
+ **Severity:** CRITICAL
320
+
321
+ **Tool:** `plugin.list` (MCP fluent-mcp-extn)
322
+
323
+ **Invocation:**
324
+ ```
325
+ plugin.list({ compact: true })
326
+ ```
327
+ Then cross-reference every rule class name referenced in workflow rulesets against the registered rules.
328
+
329
+ **Pass criteria:** Every rule `name` in every ruleset's `rules[].name` field exists in the `plugin.list` response. The rule key pattern is `<ACCOUNT>.<context>.<RuleName>` or `FLUENTRETAIL.<context>.<RuleName>`.
330
+
331
+ **Fail criteria:** Any rule referenced in a workflow ruleset is not found in the registry. This means the rule's module has not been deployed, or the rule name is misspelled. Deploying a workflow that references non-existent rules causes NO_MATCH events at runtime.
332
+
333
+ **Details captured:** Total rules referenced, total matched, list of unmatched rules with the rulesets that reference them.
334
+
335
+ #### Gate 3.4: No Breaking Removals
336
+
337
+ **Severity:** HIGH
338
+
339
+ **Tool:** `workflow.diff` (MCP fluent-mcp-extn)
340
+
341
+ **Invocation:**
342
+ Download the currently deployed workflow for comparison:
343
+ ```bash
344
+ fluent workflow download -p <PROFILE> -r <RETAILER> -w <WORKFLOW_NAME> -o /tmp/deployed-<WORKFLOW_NAME>.json
345
+ ```
346
+ Then:
347
+ ```
348
+ workflow.diff({
349
+ base: <deployed_workflow_json>,
350
+ target: <local_workflow_json>,
351
+ format: "detailed"
352
+ })
353
+ ```
354
+
355
+ **Pass criteria:** No rulesets with `change: "REMOVED"` that have `risk: "HIGH"`. Added rulesets and modified props are acceptable.
356
+
357
+ **Fail criteria:** Any ruleset removal flagged as HIGH risk by the diff tool. Removing a ruleset that handles active entity states can cause orders/fulfilments to get stuck.
358
+
359
+ **Edge case:** If no deployed workflow exists (first deployment), this gate passes automatically.
360
+
361
+ **Details captured:** Rulesets added, modified, removed. Risk level for each removal.
362
+
363
+ ---
364
+
365
+ ### Phase 4: Connection Topology
366
+
367
+ Verify cross-entity event wiring, SendEvent target resolution, and absence of circular dependencies.
368
+
369
+ **Skip condition:** No workflows available (no `--workflow-path` and none found via auto-detection).
370
+
371
+ #### Gate 4.1: SendEvent Targets Exist
372
+
373
+ **Severity:** HIGH
374
+
375
+ **Tool:** Workflow JSON analysis (apply `/fluent-connection-analysis` emitter index logic)
376
+
377
+ **Invocation:**
378
+ For each workflow in the workflow set:
379
+ 1. Scan all rules for `eventName` and `noMatchEventName` props
380
+ 2. Build the emitter index: `{ emittedEventName -> [sourceRuleset, ...] }`
381
+ 3. For each emitted event name, check if a ruleset exists anywhere in the workflow set that:
382
+ - Has `name` matching the emitted event name, OR
383
+ - Has a trigger that matches the emitted event name
384
+
385
+ **Pass criteria:** Every emitted `eventName` has at least one matching target ruleset in the workflow set.
386
+
387
+ **Fail criteria:** An emitted event has no matching target. This means the event will fire but nothing will process it, causing a NO_MATCH event at runtime. Exception: events targeting external systems (webhooks) or events known to be received from external integration partners are exempt -- flag these as INFO rather than FAIL.
388
+
389
+ **Details captured:** Total SendEvent emissions found, matched count, unmatched list with source rulesets.
390
+
391
+ #### Gate 4.2: Cross-Entity Refs Valid
392
+
393
+ **Severity:** MEDIUM
394
+
395
+ **Tool:** Workflow JSON analysis
396
+
397
+ **Invocation:**
398
+ Scan all rules for entity type references in props:
399
+ - `SendEventForOrder` implies ORDER entity type
400
+ - `SendEventForAllFulfilmentChoices` implies FULFILMENT_CHOICE entity type
401
+ - `SendEventForAllFulfilments` implies FULFILMENT entity type
402
+ - `CreateFulfilmentFromSourcingLocation` implies FULFILMENT creation
403
+ - Any rule prop referencing `entityType` values
404
+
405
+ For each cross-entity reference, verify a workflow exists for that entity type in the workflow set.
406
+
407
+ **Pass criteria:** Every cross-entity reference targets an entity type that has a corresponding workflow loaded in the workflow set.
408
+
409
+ **Fail criteria:** A cross-entity event targets an entity type with no loaded workflow. This may indicate a missing workflow download or a broken cross-entity chain.
410
+
411
+ **Details captured:** Cross-entity edges found (source -> target entity type), matched/unmatched counts.
412
+
413
+ #### Gate 4.3: No Circular Dependencies
414
+
415
+ **Severity:** MEDIUM
416
+
417
+ **Tool:** Workflow JSON analysis (apply `/fluent-connection-analysis` cycle detection logic)
418
+
419
+ **Invocation:**
420
+ Build the directed event chain graph from all workflows:
421
+ 1. Nodes = rulesets
422
+ 2. Edges = SendEvent emissions (source ruleset -> target ruleset)
423
+ 3. Run depth-first cycle detection on the graph
424
+
425
+ **Pass criteria:** No cycles detected in the event chain graph. Note: status-based cycles (entity returns to a previous status via user action) are NOT circular dependencies -- only automated event chains are checked.
426
+
427
+ **Fail criteria:** An automated event chain forms a cycle (A sends to B, B sends to C, C sends to A). This causes infinite event loops at runtime. Cycles through user actions or external integration events are acceptable (they require human/system intervention to continue).
428
+
429
+ **Details captured:** Cycle paths found (if any), total nodes and edges in the graph.
430
+
431
+ ---
432
+
433
+ ### Phase 5: Settings Completeness
434
+
435
+ Verify all settings referenced by workflow rules exist in the target retailer with valid values.
436
+
437
+ #### Gate 5.1: Required Settings Exist
438
+
439
+ **Severity:** HIGH
440
+
441
+ **Tool:** `graphql.query` (MCP fluent-mcp-extn)
442
+
443
+ **Invocation:**
444
+ 1. Extract all setting key references from workflow rules (scan rule props for setting-related patterns: `settingName`, `settingKey`, `webhookSettingKey`, `configKey`, and any prop value matching known setting name conventions)
445
+ 2. For each extracted setting key, query using cascading scope resolution:
446
+
447
+ ```
448
+ graphql.query({
449
+ query: "{ settings(first: 50, context: \"RETAILER\", contextId: <RETAILER_ID>, name: [\"<SETTING_KEY>\"]) { edges { node { id name value lobValue } } } }"
450
+ })
451
+ ```
452
+
453
+ If not found at RETAILER scope:
454
+ ```
455
+ graphql.query({
456
+ query: "{ settings(first: 50, context: \"ACCOUNT\", contextId: 0, name: [\"<SETTING_KEY>\"]) { edges { node { id name value lobValue } } } }"
457
+ })
458
+ ```
459
+
460
+ **Pass criteria:** Every setting key referenced by workflow rules is found at either RETAILER or ACCOUNT scope.
461
+
462
+ **Fail criteria:** A referenced setting is missing from both scopes. Missing settings cause rules to fail silently or throw exceptions at runtime.
463
+
464
+ **Details captured:** Per-setting: key, scope found (RETAILER/ACCOUNT), or MISSING status.
465
+
466
+ #### Gate 5.2: Setting Values Valid
467
+
468
+ **Severity:** MEDIUM
469
+
470
+ **Tool:** Read setting values from Gate 5.1 query results, then validate format
471
+
472
+ **Invocation:** Analyze each found setting's value:
473
+ - Webhook settings (key contains `webhook`, `url`, `endpoint`): Value must be a valid URL (starts with `http://` or `https://`) or valid JSON containing a `url` field
474
+ - JSON settings (value starts with `{` or `[`): Must parse as valid JSON
475
+ - Non-empty check: `value` or `lobValue` must be non-empty
476
+
477
+ **Pass criteria:** All found settings have non-empty values in the expected format.
478
+
479
+ **Fail criteria:** A setting exists but has an empty value, or the value format does not match expectations (e.g., a webhook URL setting contains plain text instead of a URL).
480
+
481
+ **Details captured:** Per-setting: key, value preview (first 50 chars, redact if contains sensitive patterns), format validation result.
482
+
483
+ #### Gate 5.3: No Stale Settings
484
+
485
+ **Severity:** LOW
486
+
487
+ **Tool:** Compare settings list against current workflow rules
488
+
489
+ **Invocation:**
490
+ 1. Query all settings at RETAILER scope:
491
+ ```
492
+ graphql.query({
493
+ query: "{ settings(first: 100, context: \"RETAILER\", contextId: <RETAILER_ID>) { edges { node { id name value } } } }"
494
+ })
495
+ ```
496
+ 2. Cross-reference with the setting keys extracted from current workflow rules
497
+ 3. Identify settings that exist in the retailer but are NOT referenced by any current workflow rule
498
+
499
+ **Pass criteria:** No stale settings found, or all unreferenced settings are clearly infrastructure/system settings (not workflow-specific).
500
+
501
+ **Fail criteria:** Settings exist that were likely created for removed rulesets. This is LOW severity because stale settings are not harmful but indicate configuration drift.
502
+
503
+ **Details captured:** List of potentially stale settings with their current values.
504
+
505
+ ---
506
+
507
+ ### Phase 6: Target Verification
508
+
509
+ Verify the deployment target is correct and the environment is healthy.
510
+
511
+ #### Gate 6.1: Target Retailer Matches
512
+
513
+ **Severity:** CRITICAL
514
+
515
+ **Tool:** Config validation + `environment.discover`
516
+
517
+ **Invocation:**
518
+ Compare the `--retailer` parameter (or profile default) against the authenticated session context:
519
+ ```
520
+ environment.discover({ include: ["retailer"] })
521
+ ```
522
+
523
+ **Pass criteria:** The retailer ref returned by `environment.discover` matches the `--retailer` parameter. If the module has retailer-scoped configuration (e.g., `module.config.json` with retailer tokens), the configured retailer must also match.
524
+
525
+ **Fail criteria:** Mismatch between target retailer and authenticated context. This prevents deploying to the wrong retailer -- a common and dangerous mistake in multi-retailer accounts.
526
+
527
+ **Details captured:** Expected retailer ref, actual retailer ref, match result.
528
+
529
+ #### Gate 6.2: No Active Incidents
530
+
531
+ **Severity:** MEDIUM
532
+
533
+ **Tool:** `metrics.healthCheck` (MCP fluent-mcp-extn)
534
+
535
+ **Invocation:**
536
+ ```
537
+ metrics.healthCheck({
538
+ window: "1h",
539
+ thresholds: {
540
+ failureRate: 5,
541
+ pendingRate: 10,
542
+ dominanceRate: 50
543
+ }
544
+ })
545
+ ```
546
+
547
+ **Pass criteria:** No CRITICAL findings in the health check response. HIGH findings are noted but do not block.
548
+
549
+ **Fail criteria:** One or more CRITICAL health findings (e.g., failure rate above 5%, NO_MATCH events detected). Deploying during an active incident risks compounding the problem.
550
+
551
+ **Edge case:** If metrics are unavailable (Prometheus not configured), this gate passes with a note: "Metrics unavailable -- manual environment health check recommended."
552
+
553
+ **Details captured:** Health check findings summary, failure rate, pending rate, top events.
554
+
555
+ ---
556
+
557
+ ### Phase 7: Risk Assessment
558
+
559
+ Quantify the scope of changes, verify rollback capability, and scan for security concerns.
560
+
561
+ #### Gate 7.1: Change Scope Quantified
562
+
563
+ **Severity:** INFO
564
+
565
+ **Tool:** `workflow.diff` (reuse results from Gate 3.4) + file system analysis
566
+
567
+ **Invocation:**
568
+ 1. Count changed workflow rulesets from `workflow.diff` results
569
+ 2. Count changed source files:
570
+ ```bash
571
+ cd "<MODULE_ROOT>" && git diff --stat HEAD~1 --name-only 2>/dev/null | wc -l
572
+ ```
573
+ If git history is unavailable, count all `.java` files as the change scope.
574
+ 3. Count changed settings (from Phase 5 analysis)
575
+
576
+ **Pass criteria:** Always passes (INFO severity). This gate quantifies risk, it does not block.
577
+
578
+ **Fail criteria:** N/A -- this gate always passes but produces a risk summary.
579
+
580
+ **Details captured:** Number of changed rulesets, changed source files, changed settings. Risk categorization: SMALL (< 5 changes), MEDIUM (5-20), LARGE (> 20).
581
+
582
+ #### Gate 7.2: Rollback Path Exists
583
+
584
+ **Severity:** HIGH
585
+
586
+ **Tool:** Version check + `plugin.list`
587
+
588
+ **Invocation:**
589
+ 1. Query the currently deployed module version (from Gate 2.4)
590
+ 2. Verify the previous version's artifact is available:
591
+ - Check `dist/` directory for a ZIP with the previous version
592
+ - Or confirm the previous version exists in the module registry via `plugin.list`
593
+
594
+ **Pass criteria:** A previous module version is recorded and its artifact is accessible for rollback. For first-time deployments, this gate passes with a note: "First deployment -- no rollback version exists."
595
+
596
+ **Fail criteria:** A previous version is deployed but its artifact cannot be located for rollback. Deploying without a rollback path is HIGH risk.
597
+
598
+ **Details captured:** Current deployed version, rollback artifact location (or "not found").
599
+
600
+ #### Gate 7.3: No PII Exposure
601
+
602
+ **Severity:** CRITICAL
603
+
604
+ **Tool:** Grep (scan module source files)
605
+
606
+ **Invocation:**
607
+ ```
608
+ Grep for patterns in <MODULE_ROOT>/plugins/:
609
+ - Email patterns: [a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
610
+ - Hardcoded tokens: (Bearer |token[=:]\s*["']|api[_-]?key[=:]\s*["']|password[=:]\s*["'])
611
+ - PII patterns: (social.?security|ssn|credit.?card|passport.?number)
612
+ ```
613
+
614
+ Exclude test files (`src/test/`) and known safe patterns (annotation strings, log format templates).
615
+
616
+ **Pass criteria:** No matches found in production source code (`src/main/java/`). Matches in test files are reported as INFO but do not fail the gate.
617
+
618
+ **Fail criteria:** Hardcoded credentials, email addresses, or PII patterns found in production source. This is CRITICAL because deployed modules run in the Fluent platform and any hardcoded secrets become visible in the rule registry.
619
+
620
+ **Details captured:** Files scanned, matches found (file path + line number + pattern type), exclusions applied.
621
+
622
+ ---
623
+
624
+ ### Phase 8: Completeness
625
+
626
+ Verify all preparatory work is done before deployment.
627
+
628
+ #### Gate 8.1: All Tasks Complete
629
+
630
+ **Severity:** MEDIUM
631
+
632
+ **Tool:** Read task list artifact (if available from `/fluent-scope-decompose`)
633
+
634
+ **Invocation:**
635
+ ```
636
+ Read file: accounts/<PROFILE>/analysis/scope-decomposition/<MODULE>.tasks.json
637
+ ```
638
+
639
+ **Pass criteria:** Either:
640
+ - No task list exists (deployment is ad-hoc, not from a scope decomposition) -- passes with note
641
+ - Task list exists and all tasks have `status: "completed"` except the CHECKLIST and DEPLOY tasks themselves
642
+
643
+ **Fail criteria:** Task list exists and one or more tasks (excluding CHECKLIST and DEPLOY) are still `pending` or `in_progress`. Deploying with incomplete tasks risks shipping partial functionality.
644
+
645
+ **Details captured:** Total tasks, completed count, pending count, list of incomplete tasks.
646
+
647
+ #### Gate 8.2: CHANGELOG Updated
648
+
649
+ **Severity:** LOW
650
+
651
+ **Tool:** Read (`CHANGELOG.md` in module root)
652
+
653
+ **Invocation:**
654
+ ```
655
+ Read file: <MODULE_ROOT>/CHANGELOG.md
656
+ ```
657
+
658
+ **Pass criteria:** Either:
659
+ - `CHANGELOG.md` exists and has an entry for the current version (matching version from `module.json`), OR
660
+ - `CHANGELOG.md` exists and has a non-empty `[Unreleased]` section
661
+
662
+ **Fail criteria:** `CHANGELOG.md` is missing, empty, or has no entry for the current version and no unreleased content. This is LOW severity because missing changelogs do not cause deployment failures but indicate poor documentation practice.
663
+
664
+ **Details captured:** CHANGELOG exists (yes/no), current version entry found (yes/no), unreleased entry count.
665
+
666
+ ---
667
+
668
+ ## Severity Definitions
669
+
670
+ | Severity | Meaning | Default Behavior |
671
+ |----------|---------|-----------------|
672
+ | **CRITICAL** | Deployment will fail or cause data corruption | Always blocks deployment |
673
+ | **HIGH** | Deployment may succeed but will cause runtime issues | Blocks at default threshold |
674
+ | **MEDIUM** | Potential issues that should be reviewed | Blocks only with `--severity-threshold MEDIUM` |
675
+ | **LOW** | Best practice recommendations | Never blocks, reported as warnings |
676
+ | **INFO** | Informational findings for audit trail | Never blocks, included in report |
677
+
678
+ ### Severity Threshold Logic
679
+
680
+ The `--severity-threshold` parameter controls which gate failures block deployment:
681
+
682
+ ```
683
+ overallResult = "READY"
684
+ for each gate in all phases:
685
+ if gate.result == "FAIL" and gate.severity >= severityThreshold:
686
+ overallResult = "BLOCKED"
687
+ blockedBy.append(gate.id)
688
+ ```
689
+
690
+ Severity ordering: `CRITICAL > HIGH > MEDIUM > LOW > INFO`
691
+
692
+ | Threshold | Blocks on |
693
+ |-----------|----------|
694
+ | `CRITICAL` (default) | Only CRITICAL failures block |
695
+ | `HIGH` | CRITICAL and HIGH failures block |
696
+ | `MEDIUM` | CRITICAL, HIGH, and MEDIUM failures block |
697
+
698
+ ---
699
+
700
+ ## Output Report Schema
701
+
702
+ The checklist report is written as a JSON file with the following structure:
703
+
704
+ ```json
705
+ {
706
+ "schema": "pre-deploy-checklist-v1",
707
+ "profile": "<PROFILE>",
708
+ "retailer": "<RETAILER_REF>",
709
+ "retailerId": "<RETAILER_ID>",
710
+ "module": "<module-name-from-module.json>",
711
+ "moduleVersion": "<version-from-module.json>",
712
+ "timestamp": "<ISO-8601>",
713
+ "severityThreshold": "CRITICAL",
714
+ "overallResult": "READY | BLOCKED",
715
+ "blockedBy": ["<gate-id>", "..."],
716
+ "phases": [
717
+ {
718
+ "number": 1,
719
+ "name": "Environment Readiness",
720
+ "result": "PASS | FAIL | SKIP",
721
+ "skipReason": null,
722
+ "gates": [
723
+ {
724
+ "id": "1.1",
725
+ "name": "Auth valid",
726
+ "severity": "CRITICAL",
727
+ "result": "PASS | FAIL | SKIP | ERROR",
728
+ "details": "User: admin@hmdev, Roles: [ADMIN, SUPER_ADMIN]",
729
+ "tool": "connection.test",
730
+ "duration_ms": 1250,
731
+ "error": null
732
+ },
733
+ {
734
+ "id": "1.2",
735
+ "name": "Retailer exists",
736
+ "severity": "CRITICAL",
737
+ "result": "PASS",
738
+ "details": "HM_TEST (ID 5), status=ACTIVE, tradingName=HM Test",
739
+ "tool": "environment.discover",
740
+ "duration_ms": 890,
741
+ "error": null
742
+ },
743
+ {
744
+ "id": "1.3",
745
+ "name": "Locations exist",
746
+ "severity": "HIGH",
747
+ "result": "PASS",
748
+ "details": "3 locations: 2 WAREHOUSE (active), 1 STORE (active)",
749
+ "tool": "environment.discover",
750
+ "duration_ms": 0,
751
+ "error": null
752
+ },
753
+ {
754
+ "id": "1.4",
755
+ "name": "Networks wired",
756
+ "severity": "HIGH",
757
+ "result": "PASS",
758
+ "details": "1 network with 3 locations",
759
+ "tool": "environment.discover",
760
+ "duration_ms": 0,
761
+ "error": null
762
+ }
763
+ ]
764
+ },
765
+ {
766
+ "number": 2,
767
+ "name": "Module Integrity",
768
+ "result": "FAIL",
769
+ "skipReason": null,
770
+ "gates": [
771
+ {
772
+ "id": "2.1",
773
+ "name": "Build passes",
774
+ "severity": "CRITICAL",
775
+ "result": "PASS",
776
+ "details": "BUILD SUCCESS in 45s, 42 tests run",
777
+ "tool": "bash:mvn",
778
+ "duration_ms": 45200,
779
+ "error": null
780
+ },
781
+ {
782
+ "id": "2.2",
783
+ "name": "Tests pass",
784
+ "severity": "CRITICAL",
785
+ "result": "PASS",
786
+ "details": "Tests run: 42, Failures: 0, Errors: 0, Skipped: 0",
787
+ "tool": "bash:mvn",
788
+ "duration_ms": 0,
789
+ "error": null
790
+ },
791
+ {
792
+ "id": "2.3",
793
+ "name": "module.json valid",
794
+ "severity": "CRITICAL",
795
+ "result": "PASS",
796
+ "details": "Name: fc-module-hm-extensions, Version: 1.3.0, Rules: 8",
797
+ "tool": "read:module.json",
798
+ "duration_ms": 50,
799
+ "error": null
800
+ },
801
+ {
802
+ "id": "2.4",
803
+ "name": "Version bumped",
804
+ "severity": "HIGH",
805
+ "result": "FAIL",
806
+ "details": "Local 1.2.3 == deployed 1.2.3. Run /fluent-version-manage bump",
807
+ "tool": "plugin.list",
808
+ "duration_ms": 2100,
809
+ "error": null
810
+ }
811
+ ]
812
+ },
813
+ {
814
+ "number": 3,
815
+ "name": "Workflow Validity",
816
+ "result": "PASS",
817
+ "skipReason": null,
818
+ "gates": []
819
+ },
820
+ {
821
+ "number": 4,
822
+ "name": "Connection Topology",
823
+ "result": "SKIP",
824
+ "skipReason": "No workflow changes detected",
825
+ "gates": []
826
+ },
827
+ {
828
+ "number": 5,
829
+ "name": "Settings Completeness",
830
+ "result": "PASS",
831
+ "skipReason": null,
832
+ "gates": []
833
+ },
834
+ {
835
+ "number": 6,
836
+ "name": "Target Verification",
837
+ "result": "PASS",
838
+ "skipReason": null,
839
+ "gates": []
840
+ },
841
+ {
842
+ "number": 7,
843
+ "name": "Risk Assessment",
844
+ "result": "PASS",
845
+ "skipReason": null,
846
+ "gates": []
847
+ },
848
+ {
849
+ "number": 8,
850
+ "name": "Completeness",
851
+ "result": "PASS",
852
+ "skipReason": null,
853
+ "gates": []
854
+ }
855
+ ],
856
+ "summary": {
857
+ "totalGates": 26,
858
+ "pass": 22,
859
+ "fail": 2,
860
+ "skip": 1,
861
+ "error": 0,
862
+ "bySeverity": {
863
+ "CRITICAL": { "total": 8, "pass": 8, "fail": 0 },
864
+ "HIGH": { "total": 8, "pass": 6, "fail": 2 },
865
+ "MEDIUM": { "total": 5, "pass": 5, "fail": 0 },
866
+ "LOW": { "total": 2, "pass": 2, "fail": 0 },
867
+ "INFO": { "total": 2, "pass": 2, "fail": 0 }
868
+ }
869
+ },
870
+ "recommendations": [
871
+ {
872
+ "gateId": "2.4",
873
+ "action": "Run /fluent-version-manage bump --level patch to increment version",
874
+ "skill": "fluent-version-manage"
875
+ },
876
+ {
877
+ "gateId": "3.3",
878
+ "action": "Deploy the module first, then re-run checklist for workflows",
879
+ "skill": "fluent-module-deploy"
880
+ }
881
+ ]
882
+ }
883
+ ```
884
+
885
+ ### Output Path
886
+
887
+ ```
888
+ accounts/<PROFILE>/analysis/pre-deploy/<MODULE_NAME>-<VERSION>.checklist.json
889
+ ```
890
+
891
+ Where `<MODULE_NAME>` is derived from `module.json` name with `/` replaced by `--` (e.g., `fluent-commerce--fc-module-hm-extensions`).
892
+
893
+ For workflow-only deployments without a module, the filename uses the primary workflow name: `<WORKFLOW_NAME>.checklist.json`.
894
+
895
+ ---
896
+
897
+ ## Execution Flow
898
+
899
+ ```
900
+ 1. RESOLVE inputs:
901
+ a. Determine profile (--profile or active FLUENT_PROFILE)
902
+ b. Determine retailer (--retailer or profile default)
903
+ c. Locate module path (--module-path or auto-detect from accounts/<PROFILE>/SOURCE/)
904
+ d. Locate workflow path (--workflow-path or auto-detect from accounts/<PROFILE>/workflows/<RETAILER>/)
905
+ e. Parse --skip list (comma-separated phase numbers)
906
+ f. Parse --severity-threshold (default: CRITICAL)
907
+
908
+ 2. DETERMINE deployment scenario:
909
+ a. Module found? -> include Phases 2, 7.2, 7.3
910
+ b. Workflows found? -> include Phases 3, 4
911
+ c. Apply --skip overrides on top of auto-detection
912
+
913
+ 3. INITIALIZE report:
914
+ a. Create report JSON skeleton with profile, retailer, module, timestamp
915
+ b. Set overallResult = "READY" (optimistic)
916
+
917
+ 4. EXECUTE phases sequentially (1 through 8):
918
+ For each phase:
919
+ a. Check if phase is skipped (auto or --skip) -> record SKIP with reason
920
+ b. For each gate in the phase:
921
+ i. Record start time
922
+ ii. Execute the gate's tool/invocation
923
+ iii. Evaluate pass/fail criteria
924
+ iv. Record result, details, duration, any errors
925
+ v. If result == FAIL and severity >= threshold:
926
+ - Add gate.id to blockedBy[]
927
+ - Set overallResult = "BLOCKED"
928
+ c. Set phase result = FAIL if any gate failed, PASS if all passed, SKIP if skipped
929
+
930
+ IMPORTANT: Do NOT short-circuit on failure. Run ALL phases and ALL gates
931
+ regardless of failures. The complete report is more valuable than an early exit.
932
+
933
+ 5. COMPUTE summary:
934
+ a. Count pass/fail/skip/error across all gates
935
+ b. Break down by severity level
936
+ c. Generate recommendations for each failed gate
937
+
938
+ 6. WRITE report:
939
+ a. Ensure output directory exists:
940
+ mkdir -p accounts/<PROFILE>/analysis/pre-deploy/
941
+ b. Write JSON report using the Write tool
942
+ c. Record output path
943
+
944
+ 7. DISPLAY console summary:
945
+ a. Print phase-by-phase results
946
+ b. Print overall verdict (READY or BLOCKED)
947
+ c. If BLOCKED: list failures with recommended actions
948
+ d. If READY: confirm deployment can proceed via /fluent-module-deploy
949
+ ```
950
+
951
+ ---
952
+
953
+ ## Console Output Format
954
+
955
+ ```
956
+ PRE-DEPLOYMENT CHECKLIST
957
+ ========================
958
+ Profile: HMDEV
959
+ Retailer: HM_TEST (ID 5)
960
+ Module: fc-module-hm-extensions v1.3.0
961
+ Threshold: CRITICAL
962
+ Timestamp: 2026-02-23T10:30:00Z
963
+
964
+ Phase 1: Environment Readiness ........................ PASS
965
+ [PASS] 1.0 CLI available (HIGH) -- fluent v2.0.0
966
+ [PASS] 1.1 Auth valid (CRITICAL) -- admin@hmdev, roles: ADMIN
967
+ [PASS] 1.2 Retailer exists (CRITICAL) -- HM_TEST, ACTIVE
968
+ [PASS] 1.3 Locations exist (HIGH) -- 3 locations (2 WH, 1 STORE)
969
+ [PASS] 1.4 Networks wired (HIGH) -- 1 network, 3 locations
970
+
971
+ Phase 2: Module Integrity ............................. FAIL
972
+ [PASS] 2.1 Build passes (CRITICAL) -- BUILD SUCCESS, 42 tests
973
+ [PASS] 2.2 Tests pass (CRITICAL) -- 0 failures, 0 errors
974
+ [PASS] 2.3 module.json valid (CRITICAL) -- 8 rules registered
975
+ [FAIL] 2.4 Version bumped (HIGH) -- 1.2.3 == 1.2.3 (not bumped)
976
+
977
+ Phase 3: Workflow Validity ............................ PASS
978
+ [PASS] 3.1 Workflows parse (CRITICAL) -- 4 workflows, all valid
979
+ [PASS] 3.2 No orphaned rulesets (HIGH) -- 0 orphans in 47 rulesets
980
+ [PASS] 3.3 Rules exist (CRITICAL) -- 82/82 rules found
981
+ [PASS] 3.4 No breaking removals (HIGH) -- 2 added, 1 modified, 0 removed
982
+
983
+ Phase 4: Connection Topology .......................... PASS
984
+ [PASS] 4.1 SendEvent targets exist (HIGH) -- 15/15 targets resolved
985
+ [PASS] 4.2 Cross-entity refs valid (MEDIUM) -- 3 cross-entity edges, all valid
986
+ [PASS] 4.3 No circular dependencies (MEDIUM) -- 0 cycles in 47 nodes
987
+
988
+ Phase 5: Settings Completeness ........................ PASS
989
+ [PASS] 5.1 Required settings exist (HIGH) -- 12/12 found
990
+ [PASS] 5.2 Setting values valid (MEDIUM) -- 12/12 valid format
991
+ [PASS] 5.3 No stale settings (LOW) -- 0 stale settings
992
+
993
+ Phase 6: Target Verification .......................... PASS
994
+ [PASS] 6.1 Target retailer matches (CRITICAL) -- HM_TEST confirmed
995
+ [PASS] 6.2 No active incidents (MEDIUM) -- 0 CRITICAL findings
996
+
997
+ Phase 7: Risk Assessment .............................. PASS
998
+ [PASS] 7.1 Change scope quantified (INFO) -- MEDIUM: 12 files, 3 rulesets
999
+ [PASS] 7.2 Rollback path exists (HIGH) -- v1.2.3 artifact in dist/
1000
+ [PASS] 7.3 No PII exposure (CRITICAL) -- 0 matches in 8 source files
1001
+
1002
+ Phase 8: Completeness ................................. PASS
1003
+ [PASS] 8.1 All tasks complete (MEDIUM) -- 10/10 tasks completed
1004
+ [PASS] 8.2 CHANGELOG updated (LOW) -- v1.3.0 entry present
1005
+
1006
+ SUMMARY
1007
+ -------
1008
+ Total: 26 gates | PASS: 25 | FAIL: 1 | SKIP: 0
1009
+
1010
+ VERDICT: READY
1011
+ (Gate 2.4 failed at HIGH but threshold is CRITICAL -- does not block)
1012
+
1013
+ Recommendation: Bump version before deploying to avoid version confusion.
1014
+ -> Run: /fluent-version-manage bump --level patch
1015
+
1016
+ Report saved: accounts/HMDEV/analysis/pre-deploy/fluent-commerce--fc-module-hm-extensions-1.3.0.checklist.json
1017
+
1018
+ To proceed with deployment:
1019
+ -> Run: /fluent-module-deploy --profile HMDEV --retailer HM_TEST
1020
+ ```
1021
+
1022
+ When the verdict is `BLOCKED`:
1023
+
1024
+ ```
1025
+ VERDICT: BLOCKED
1026
+ Deployment blocked by 2 gate failures at or above CRITICAL threshold:
1027
+
1028
+ [FAIL] 2.1 Build passes (CRITICAL) -- Compilation error in CancelOrderRule.java:45
1029
+ -> Fix compilation error, then re-run /fluent-pre-deploy-check
1030
+
1031
+ [FAIL] 3.3 Rules exist (CRITICAL) -- 2 rules not found: HMDEV.custom.NewRule, HMDEV.custom.OtherRule
1032
+ -> Deploy module first to register rules, then re-run for workflows
1033
+
1034
+ Resolve all CRITICAL failures before deployment.
1035
+ ```
1036
+
1037
+ ---
1038
+
1039
+ ## Integration with Other Skills
1040
+
1041
+ | Skill | Integration Point | Direction |
1042
+ |-------|------------------|-----------|
1043
+ | `/fluent-module-validate` | Phase 2 reuses module validation logic; can also read cached `.report.json` if module unchanged | Input |
1044
+ | `/fluent-build` | Phase 2 gate 2.1 executes the Maven build | Input |
1045
+ | `/fluent-version-manage` | Phase 2 gate 2.4 and Phase 7 gate 7.2 use version comparison | Input |
1046
+ | `/fluent-workflow-analyzer` | Phase 3 gate 3.2 applies orphan detection algorithm | Input |
1047
+ | `/fluent-connection-analysis` | Phase 4 applies connection topology and cycle detection | Input |
1048
+ | `/fluent-settings` | Phase 5 applies settings audit patterns | Input |
1049
+ | `/fluent-scope-decompose` | Phase 8 gate 8.1 reads the task list artifact | Input |
1050
+ | `/fluent-module-deploy` | Receives the READY verdict to proceed | Output |
1051
+ | `/fluent-workflow-deploy` | Receives the READY verdict for workflow-only deploys | Output |
1052
+ | `/fluent-session-summary` | All gate executions are tracked for audit trail | Bidirectional |
1053
+ | `/fluent-session-audit-export` | Checklist report path recorded in audit document | Output |
1054
+
1055
+ ### Recommended Sequencing in ADD Lifecycle
1056
+
1057
+ ```
1058
+ /fluent-scope-decompose -> /fluent-rule-scaffold -> /fluent-build
1059
+ | | |
1060
+ v v v
1061
+ /fluent-workflow-builder -> /fluent-version-manage -> /fluent-pre-deploy-check
1062
+ |
1063
+ READY? ---------> /fluent-module-deploy
1064
+ BLOCKED? -------> Fix issues, re-run
1065
+ ```
1066
+
1067
+ ---
1068
+
1069
+ ## Edge Cases
1070
+
1071
+ ### No module path (workflow-only deploy)
1072
+ Phases 2, 7.2, and 7.3 are auto-skipped. The report module field is set to `null` and the filename uses the primary workflow name. Phase 3-4 gates still execute normally.
1073
+
1074
+ ### No workflows (module-only deploy)
1075
+ Phases 3 and 4 are auto-skipped. Phase 5 still runs because settings may be module-related. Phase 7.1 reports change scope based on source files only.
1076
+
1077
+ ### Multiple modules in SOURCE directory
1078
+ When auto-detection finds multiple `resources/module.json` files, the skill lists them and asks the user to select one. Alternatively, the user can run the checklist multiple times with explicit `--module-path` for each module.
1079
+
1080
+ ### First-time deployment (no previous version)
1081
+ Gates 2.4 (version bumped), 3.4 (no breaking removals), and 7.2 (rollback path) pass automatically with informational notes indicating this is a first deployment.
1082
+
1083
+ ### MCP tools unavailable
1084
+ If MCP tools fail (connection error, timeout), the affected gate records `result: "ERROR"` instead of PASS/FAIL. ERROR gates do not block deployment but are flagged prominently in the report with the recommendation to fix MCP connectivity and re-run.
1085
+
1086
+ ### Module validates but build has not been run recently
1087
+ Gate 2.1 always runs a fresh `mvn clean install` to ensure the build is current. It does not rely on cached build artifacts. This adds time but guarantees the build state matches the source.
1088
+
1089
+ ### Settings referenced by rules that are not yet deployed
1090
+ When Gate 3.3 (rules exist) fails, Gate 5.1 (settings exist) may also show misleading results because the settings may be correct but the rules referencing them are not yet registered. The report includes a cross-reference note: "Settings validation may be incomplete because some rules are not yet deployed."
1091
+
1092
+ ### Windows platform
1093
+ All Bash invocations use cross-platform patterns. Maven commands use the same syntax on Windows (the `mvn` wrapper handles platform differences). File path operations use forward slashes in report output for consistency.
1094
+
1095
+ ---
1096
+
1097
+ ## Troubleshooting
1098
+
1099
+ | Issue | Likely Cause | Fix |
1100
+ |-------|-------------|-----|
1101
+ | Gate 1.1 fails with auth error | Expired token or wrong profile | Run `fluent auth login -p <PROFILE>` or check `.fluent/credentials.json` |
1102
+ | Gate 2.1 hangs | Maven downloading dependencies | Wait for completion or check network; set timeout with `mvn -T 5m` |
1103
+ | Gate 3.3 shows many missing rules | Module not yet deployed | Deploy module first, then re-run checklist for workflows |
1104
+ | Gate 5.1 shows MISSING for module-installed settings | Settings deployed at ACCOUNT scope | Cascading resolution should find these; check `contextId=0` query |
1105
+ | Gate 6.2 returns ERROR | Prometheus not configured on environment | Gate passes with warning; recommend manual health check |
1106
+ | Gate 7.3 false positives | Test email addresses in production code | Move test data to `src/test/` or add to exclusion list |
1107
+ | All gates pass but deployment still fails | Runtime issue not covered by static checks | Run `/fluent-e2e-test` after deployment to validate runtime behavior |
1108
+ | Report file path too long on Windows | Module name with many segments | Use the `--` separator convention to keep filenames reasonable |