@fluentcommerce/ai-skills 0.1.0 → 0.3.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.

Potentially problematic release.


This version of @fluentcommerce/ai-skills might be problematic. Click here for more details.

Files changed (168) hide show
  1. package/README.md +866 -622
  2. package/bin/cli.mjs +2112 -1973
  3. package/content/cli/agents/fluent-cli/agent.json +149 -149
  4. package/content/cli/agents/fluent-cli.md +132 -132
  5. package/content/cli/skills/fluent-bootstrap/SKILL.md +214 -181
  6. package/content/cli/skills/fluent-cli-index/SKILL.md +1 -1
  7. package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +117 -1
  8. package/content/cli/skills/fluent-cli-reference/SKILL.md +1040 -1031
  9. package/content/cli/skills/fluent-cli-retailer/SKILL.md +27 -2
  10. package/content/cli/skills/fluent-cli-settings/SKILL.md +21 -1
  11. package/content/cli/skills/fluent-connect/SKILL.md +937 -886
  12. package/content/cli/skills/fluent-module-deploy/SKILL.md +63 -5
  13. package/content/cli/skills/fluent-profile/SKILL.md +73 -0
  14. package/content/cli/skills/fluent-workflow/SKILL.md +360 -310
  15. package/content/dev/agents/fluent-backend-dev/AGENT.md +58 -0
  16. package/content/dev/agents/fluent-backend-dev/agent.json +69 -0
  17. package/content/dev/agents/fluent-backend-dev.md +287 -0
  18. package/content/dev/agents/fluent-dev/AGENT.md +98 -0
  19. package/content/dev/agents/fluent-dev/agent.json +14 -2
  20. package/content/dev/agents/fluent-dev.md +194 -525
  21. package/content/dev/agents/fluent-frontend-dev/AGENT.md +63 -0
  22. package/content/dev/agents/fluent-frontend-dev/agent.json +52 -0
  23. package/content/dev/agents/fluent-frontend-dev.md +323 -0
  24. package/content/dev/skills/fluent-archive/SKILL.md +234 -0
  25. package/content/dev/skills/fluent-build/SKILL.md +312 -192
  26. package/content/dev/skills/fluent-connection-analysis/SKILL.md +422 -386
  27. package/content/dev/skills/fluent-custom-code/SKILL.md +15 -9
  28. package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +19 -2
  29. package/content/dev/skills/fluent-e2e-test/SKILL.md +501 -394
  30. package/content/dev/skills/fluent-event-api/SKILL.md +962 -945
  31. package/content/dev/skills/fluent-feature-explain/SKILL.md +680 -603
  32. package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +27 -2
  33. package/content/dev/skills/fluent-feature-plan/SKILL.md +478 -227
  34. package/content/dev/skills/fluent-feature-status/SKILL.md +335 -0
  35. package/content/dev/skills/fluent-feedback/SKILL.md +221 -0
  36. package/content/dev/skills/fluent-implementation-map/SKILL.md +644 -0
  37. package/content/dev/skills/fluent-job-batch/SKILL.md +10 -0
  38. package/content/dev/skills/fluent-module-scaffold/SKILL.md +64 -2
  39. package/content/dev/skills/fluent-module-validate/SKILL.md +778 -775
  40. package/content/dev/skills/fluent-mystique-analyze/SKILL.md +817 -0
  41. package/content/dev/skills/fluent-mystique-builder/COMPONENT_TEMPLATE.md +81 -0
  42. package/content/dev/skills/fluent-mystique-builder/README.md +63 -0
  43. package/content/dev/skills/fluent-mystique-builder/SKILL.md +1294 -0
  44. package/content/dev/skills/fluent-mystique-builder/components/INDEX.md +92 -0
  45. package/content/dev/skills/fluent-mystique-builder/components/fc.accordion.md +48 -0
  46. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.fulfilmentpack.md +20 -0
  47. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.multiparcel.md +21 -0
  48. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.returnitems.md +21 -0
  49. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.wavepick.md +21 -0
  50. package/content/dev/skills/fluent-mystique-builder/components/fc.action.inline.md +24 -0
  51. package/content/dev/skills/fluent-mystique-builder/components/fc.activity.entity.md +25 -0
  52. package/content/dev/skills/fluent-mystique-builder/components/fc.analytics.viz.md +20 -0
  53. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.column.md +111 -0
  54. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.json.md +20 -0
  55. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.jsoneditor.md +54 -0
  56. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.locationId.md +51 -0
  57. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.retailerId.md +52 -0
  58. package/content/dev/skills/fluent-mystique-builder/components/fc.button.bar.md +57 -0
  59. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.download.md +53 -0
  60. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.compatibility.md +60 -0
  61. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.md +53 -0
  62. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.md +24 -0
  63. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.pick.md +61 -0
  64. package/content/dev/skills/fluent-mystique-builder/components/fc.buttons.add.reject.md +20 -0
  65. package/content/dev/skills/fluent-mystique-builder/components/fc.card.attribute.md +73 -0
  66. package/content/dev/skills/fluent-mystique-builder/components/fc.card.attributes.grid.md +40 -0
  67. package/content/dev/skills/fluent-mystique-builder/components/fc.card.image.md +37 -0
  68. package/content/dev/skills/fluent-mystique-builder/components/fc.card.map.point.md +24 -0
  69. package/content/dev/skills/fluent-mystique-builder/components/fc.card.multi.md +79 -0
  70. package/content/dev/skills/fluent-mystique-builder/components/fc.card.product.md +27 -0
  71. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.md +34 -0
  72. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.wrapper.feed.md +98 -0
  73. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.md +52 -0
  74. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.wrapper.source.md +104 -0
  75. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.md +28 -0
  76. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.wrapper.threshold.md +118 -0
  77. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.line.md +32 -0
  78. package/content/dev/skills/fluent-mystique-builder/components/fc.conditional.md +62 -0
  79. package/content/dev/skills/fluent-mystique-builder/components/fc.dashboard.threshold.md +65 -0
  80. package/content/dev/skills/fluent-mystique-builder/components/fc.daterange.wrapper.forwarder.md +56 -0
  81. package/content/dev/skills/fluent-mystique-builder/components/fc.drawer.button.md +21 -0
  82. package/content/dev/skills/fluent-mystique-builder/components/fc.event.detail.md +20 -0
  83. package/content/dev/skills/fluent-mystique-builder/components/fc.events.search.md +21 -0
  84. package/content/dev/skills/fluent-mystique-builder/components/fc.field.daterange.md +83 -0
  85. package/content/dev/skills/fluent-mystique-builder/components/fc.field.filterComplex.md +106 -0
  86. package/content/dev/skills/fluent-mystique-builder/components/fc.field.intrange.md +82 -0
  87. package/content/dev/skills/fluent-mystique-builder/components/fc.field.multistring.md +50 -0
  88. package/content/dev/skills/fluent-mystique-builder/components/fc.filterPanel.md +53 -0
  89. package/content/dev/skills/fluent-mystique-builder/components/fc.json.editor.md +22 -0
  90. package/content/dev/skills/fluent-mystique-builder/components/fc.json.viewer.md +21 -0
  91. package/content/dev/skills/fluent-mystique-builder/components/fc.list.customAction.md +79 -0
  92. package/content/dev/skills/fluent-mystique-builder/components/fc.list.md +116 -0
  93. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.bppmetrics.md +69 -0
  94. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.feed.md +65 -0
  95. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.source.md +64 -0
  96. package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.addItem.md +60 -0
  97. package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.md +21 -0
  98. package/content/dev/skills/fluent-mystique-builder/components/fc.mutation.inline.md +88 -0
  99. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.attributes.md +83 -0
  100. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.text.md +33 -0
  101. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.link.md +30 -0
  102. package/content/dev/skills/fluent-mystique-builder/components/fc.order.itemDetails.md +20 -0
  103. package/content/dev/skills/fluent-mystique-builder/components/fc.order.shipmentDetails.md +20 -0
  104. package/content/dev/skills/fluent-mystique-builder/components/fc.page.filter.select.md +87 -0
  105. package/content/dev/skills/fluent-mystique-builder/components/fc.page.md +64 -0
  106. package/content/dev/skills/fluent-mystique-builder/components/fc.page.refresh.md +48 -0
  107. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.column.md +71 -0
  108. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.header.md +61 -0
  109. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.md +59 -0
  110. package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.md +45 -0
  111. package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.summary.md +56 -0
  112. package/content/dev/skills/fluent-mystique-builder/components/fc.progress.circular.md +20 -0
  113. package/content/dev/skills/fluent-mystique-builder/components/fc.provider.graphql.md +71 -0
  114. package/content/dev/skills/fluent-mystique-builder/components/fc.quantity.list.md +87 -0
  115. package/content/dev/skills/fluent-mystique-builder/components/fc.repeater.md +56 -0
  116. package/content/dev/skills/fluent-mystique-builder/components/fc.reports.ipuipc.md +54 -0
  117. package/content/dev/skills/fluent-mystique-builder/components/fc.return.rowExpansion.md +19 -0
  118. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcode.md +21 -0
  119. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcodeFilter.md +72 -0
  120. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.camera.md +20 -0
  121. package/content/dev/skills/fluent-mystique-builder/components/fc.settingForm.md +64 -0
  122. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.drawer.button.md +19 -0
  123. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.modal.button.md +64 -0
  124. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.strategy.modal.button.md +20 -0
  125. package/content/dev/skills/fluent-mystique-builder/components/fc.stepper.md +20 -0
  126. package/content/dev/skills/fluent-mystique-builder/components/fc.tab.content.md +56 -0
  127. package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.card.md +64 -0
  128. package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.md +69 -0
  129. package/content/dev/skills/fluent-mystique-builder/components/fc.tile.metric.md +73 -0
  130. package/content/dev/skills/fluent-mystique-builder/components/fc.workflow.provider.md +77 -0
  131. package/content/dev/skills/fluent-mystique-builder/validate-docs.ps1 +260 -0
  132. package/content/dev/skills/fluent-mystique-scaffold/SKILL.md +1830 -0
  133. package/content/dev/skills/fluent-mystique-validate/SKILL.md +646 -0
  134. package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1144 -1108
  135. package/content/dev/skills/fluent-retailer-config/SKILL.md +1162 -1111
  136. package/content/dev/skills/fluent-rollback/SKILL.md +387 -0
  137. package/content/dev/skills/fluent-rule-scaffold/SKILL.md +515 -385
  138. package/content/dev/skills/fluent-scope-decompose/SKILL.md +1123 -1021
  139. package/content/dev/skills/fluent-session-audit-export/SKILL.md +880 -632
  140. package/content/dev/skills/fluent-session-summary/SKILL.md +320 -195
  141. package/content/dev/skills/fluent-settings/SKILL.md +160 -1
  142. package/content/dev/skills/fluent-source-onboard/SKILL.md +31 -3
  143. package/content/dev/skills/fluent-sourcing/SKILL.md +1185 -0
  144. package/content/dev/skills/fluent-system-monitoring/SKILL.md +771 -767
  145. package/content/dev/skills/fluent-test-data/SKILL.md +514 -513
  146. package/content/dev/skills/fluent-trace/SKILL.md +1169 -1143
  147. package/content/dev/skills/fluent-transition-api/SKILL.md +364 -346
  148. package/content/dev/skills/fluent-use-case-discover/SKILL.md +593 -0
  149. package/content/dev/skills/fluent-use-case-discover/SPEC_TEMPLATE.md +281 -0
  150. package/content/dev/skills/fluent-version-manage/SKILL.md +53 -2
  151. package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +995 -959
  152. package/content/dev/skills/fluent-workflow-builder/SKILL.md +668 -319
  153. package/content/dev/skills/fluent-workflow-deploy/SKILL.md +480 -267
  154. package/content/dev/skills/fluent-workspace-tree/SKILL.md +281 -0
  155. package/content/mcp-extn/agents/fluent-mcp.md +133 -69
  156. package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +812 -461
  157. package/content/mcp-official/agents/fluent-mcp-core.md +91 -91
  158. package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -94
  159. package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -172
  160. package/docs/CAPABILITY_MAP.md +106 -77
  161. package/docs/DEPLOYMENT_PROMOTION_RUNBOOK.md +218 -0
  162. package/docs/DESIGN-implementation-map.md +698 -0
  163. package/docs/DEV_WORKFLOW.md +814 -802
  164. package/docs/FLOW_RUN.md +142 -142
  165. package/docs/GETTING_STARTED.md +427 -0
  166. package/docs/USE_CASES.md +909 -52
  167. package/metadata.json +184 -156
  168. package/package.json +3 -2
@@ -10,8 +10,28 @@ argument-hint: [--audit <workflow-file>] [--context RETAILER|ACCOUNT|LOCATION] [
10
10
 
11
11
  Manage Fluent Commerce settings that configure how workflow rules behave at runtime. Settings are the critical glue between deployed workflows and working business logic — when a setting is missing, rules fail silently, orders get stuck, and webhooks never fire.
12
12
 
13
+ ## Pre-flight: Feedback Check
14
+
15
+ Before starting, check for past learnings from this skill:
16
+
17
+ 1. Check if `accounts/<PROFILE>/feedback/fluent-settings.jsonl` exists
18
+ 2. If yes, read last 20 records
19
+ 3. Filter to: same entity type/subtype if known, FAILURE or USER_CORRECTED outcomes, confidence = CONFIRMED or PROMOTED
20
+ 4. Extract top 3 relevant learnings — use as internal "WATCH OUT" guidance during execution
21
+ 5. Do NOT show raw feedback to the user — silently adjust approach based on past issues
22
+
13
23
  ## Planning Gate
14
24
 
25
+ ### Pre-flight: Plan Verification
26
+
27
+ Before proceeding, check for an existing approved plan:
28
+
29
+ 1. **Search** `accounts/<PROFILE>/features/*/status.json` for an entry with `plan: "APPROVED"` that covers these settings, OR check `accounts/<PROFILE>/tasks/` for a task plan with `Status: APPROVED`
30
+ 2. **If multi-artifact work** (settings + rules + workflows): STOP. Invoke `/fluent-feature-plan` first — this skill cannot be used for multi-artifact work without a feature plan
31
+ 3. **If approved plan found:** Skip to implementation, referencing the plan's §9 (Settings) section
32
+ 4. **If settings-only work with no plan:** Continue to the Planning Gate below to write a plan for this skill
33
+ 5. **Read-only operations** (audit, discover, list) are always exempt from planning
34
+
15
35
  **Before creating or updating any settings, write a plan using the template from `PLAN_TEMPLATE.md` in the `fluent-feature-plan` skill.** Every setting row must carry a Source column (NEW/EXISTING/MODIFIED). Read-only operations (audit, discover, list) are exempt.
16
36
 
17
37
  **Settings-specific emphasis — ensure these are covered:**
@@ -23,10 +43,29 @@ Manage Fluent Commerce settings that configure how workflow rules behave at runt
23
43
  5. **Impacted retailers (Section 4.8)** — settings take effect immediately; confirm target environment
24
44
  6. **Risks (Section 7)** — wrong values can break live flows; note immediate-effect risk
25
45
 
26
- **Write the plan to:** `accounts/<PROFILE>/plans/<YYYY-MM-DD>-settings-<slug>.md`. Set `Status: PENDING`.
46
+ **Write the plan to:** `accounts/<PROFILE>/tasks/<YYYY-MM-DD>-settings-<slug>.md`. Set `Status: PENDING`.
27
47
 
28
48
  Present the full plan content to the user and wait for approval before sending any `setting.upsert` or `setting.bulkUpsert` calls. On approval, update the file to `Status: APPROVED`. If the user says "just do it", proceed directly (still write the file for audit trail).
29
49
 
50
+ ## Handoff Protocol
51
+
52
+ ### Signals emitted by this skill
53
+
54
+ | Signal | Condition | Example |
55
+ |--------|-----------|---------|
56
+ | `-> READY: <path>` | Settings applied | `-> READY: 3 settings upserted for retailer HM_TEST` |
57
+ | `-> NEXT: /fluent-<skill>` | Next skill in plan | `-> NEXT: /fluent-e2e-test` |
58
+ | `-> BLOCKED: <reason>` | Cannot proceed | `-> BLOCKED: ENV_UNREACHABLE — Cannot connect to Fluent environment` |
59
+ | `-> SKIP: <reason>` | Read-only audit, no changes | `-> SKIP: Audit mode — no settings changes needed` |
60
+
61
+ ### Error codes
62
+
63
+ | Code | Condition | Recovery |
64
+ |------|-----------|----------|
65
+ | `PLAN_REQUIRED` | Settings creation attempted without approved plan | Run `/fluent-feature-plan` first |
66
+ | `VALIDATION_FAILED` | Setting value format invalid or context missing | Fix setting values and retry |
67
+ | `ENV_UNREACHABLE` | Cannot connect to Fluent environment | Check credentials via `config.validate` |
68
+
30
69
  ## Ownership Boundary
31
70
 
32
71
  This skill owns Settings CRUD, discovery, audit, and migration.
@@ -328,6 +367,9 @@ After extracting setting refs from the workflow:
328
367
 
329
368
  1. Query live setting values (`settings(... name: [...])`).
330
369
  2. Query orchestration audit for webhook actions on a target entity:
370
+
371
+ > **Event filter reference:** For complete filter syntax, see `/fluent-event-api`. The examples below show settings-specific patterns.
372
+
331
373
  ```
332
374
  event.list({
333
375
  "eventType": "ORCHESTRATION_AUDIT",
@@ -462,6 +504,64 @@ When invoked from `/fluent-connection-analysis`, use the webhook/setting depende
462
504
  5. Return combined audit report with Value Check column
463
505
  ```
464
506
 
507
+ ## Phase 2D: Settings Conflict Detection
508
+
509
+ Before creating or updating settings, check for ownership conflicts across features.
510
+
511
+ ### What is a Conflict?
512
+
513
+ A **settings conflict** occurs when:
514
+ 1. Two or more features declare the same setting key in their plans
515
+ 2. A setting being created already exists with a different value than expected
516
+ 3. Multiple feature plans reference the same setting key with different intended values
517
+
518
+ ### Detection Protocol
519
+
520
+ **Step 1: Cross-feature scan**
521
+ Scan all `accounts/<PROFILE>/features/*/plan.md` for settings tables (§9 Settings section). Extract all setting keys mentioned across all plans.
522
+
523
+ **Step 2: Identify overlaps**
524
+ If the same setting key appears in multiple feature plans:
525
+ - Flag as `CONFLICT` if the planned values differ
526
+ - Flag as `SHARED` if the planned values match (same value, multiple consumers — OK)
527
+ - Flag as `OWNED` if only one plan references it
528
+
529
+ **Step 3: Live environment check**
530
+ Before `setting.upsert`, query the current value:
531
+ ```graphql
532
+ {
533
+ settings(first: 1, name: ["<KEY>"], context: "<CONTEXT>") {
534
+ edges { node { id name value lobValue valueType contextId } }
535
+ }
536
+ }
537
+ ```
538
+ Compare existing value to planned value:
539
+ - If no existing value → safe to create (`NEW`)
540
+ - If existing value matches planned value → skip (`ALREADY_SET`)
541
+ - If existing value differs from planned → flag as `OVERWRITE_WARNING`
542
+
543
+ **Step 4: Present conflicts**
544
+ ```markdown
545
+ ### Settings Conflict Report
546
+
547
+ | Key | Context | Feature A (planned) | Feature B (planned) | Live Value | Status |
548
+ |-----|---------|--------------------|--------------------|------------|--------|
549
+ | WEBHOOK_ENDPOINT_ORDER | RETAILER:5 | https://a.com/hook | https://b.com/hook | https://a.com/hook | CONFLICT |
550
+ | ORDER_PREFIX | RETAILER:5 | HD- | HD- | HD- | SHARED |
551
+ | NEW_SETTING | RETAILER:5 | value1 | — | (none) | OWNED |
552
+ ```
553
+
554
+ **Step 5: Resolution**
555
+ - `CONFLICT`: STOP. Present to user with both feature names. User must decide which value wins.
556
+ - `OVERWRITE_WARNING`: WARN. Show current → new diff. User must confirm.
557
+ - `SHARED` / `OWNED` / `NEW`: Proceed normally.
558
+
559
+ ### Handoff
560
+ If conflicts are found:
561
+ ```
562
+ -> BLOCKED: Settings conflict on <N> keys. User resolution required.
563
+ ```
564
+
465
565
  ## Phase 3: CRUD Operations
466
566
 
467
567
  ### Schema Reference (from live introspection)
@@ -1045,6 +1145,40 @@ Feed webhook payload reconstruction into the Phase 2 audit:
1045
1145
  | Debug rule failures caused by missing settings | `/fluent-trace` |
1046
1146
  | Query user actions that source options from settings | `/fluent-transition-api` |
1047
1147
 
1148
+ ## Session Tracking
1149
+
1150
+ When invoked, log the following to the session tracking protocol (consumed by `/fluent-session-summary` and `/fluent-session-audit-export`):
1151
+
1152
+ **On entry:**
1153
+ ```json
1154
+ { "skill": "<this-skill-name>", "timestamp": "<ISO-8601>", "arguments": { "<key>": "<value>", "...": "..." } }
1155
+ ```
1156
+
1157
+ **On exit:**
1158
+ ```json
1159
+ { "skill": "<this-skill-name>", "outcome": "<completed|failed|skipped>", "changesProduced": ["<seq-numbers>"], "toolCallsProduced": ["<seq-numbers>"], "nextRecommended": "<from-handoff-section>" }
1160
+ ```
1161
+
1162
+ All MCP tool calls made during execution should include `"skill": "<this-skill-name>"` in their tracking record for attribution. The `arguments` object should capture the key parameters actually passed (profile, retailer, entity type, etc.) — not a fixed schema. The `nextRecommended` value comes from the Handoff section below.
1163
+
1164
+ ## Handoff
1165
+
1166
+ | Output Artifact | Consumed By | Path |
1167
+ |----------------|-------------|------|
1168
+ | Settings created/updated in Fluent environment | `/fluent-pre-deploy-check` (Phase 5 validation) | Live environment via `graphql.query` |
1169
+ | Settings audit report | `/fluent-workflow-builder` (dependency check) | `accounts/<PROFILE>/analysis/settings/settings-audit.json` |
1170
+
1171
+ ## Error Reporting
1172
+
1173
+ Errors from this skill follow the standard format:
1174
+
1175
+ | Field | Description |
1176
+ |-------|-------------|
1177
+ | `phase` | Skill phase where error occurred (e.g., `audit`, `creation`, `update`, `migration`, `validation`) |
1178
+ | `severity` | `CRITICAL` (blocks downstream), `HIGH` (needs fix), `MEDIUM` (advisory), `LOW` (informational) |
1179
+ | `message` | Human-readable error description |
1180
+ | `resolution` | Suggested fix or downstream skill to invoke |
1181
+
1048
1182
  ## Tips
1049
1183
 
1050
1184
  - **Settings names are case-sensitive** — `webhook.Order.Created` and `webhook.order.created` are different settings
@@ -1056,3 +1190,28 @@ Feed webhook payload reconstruction into the Phase 2 audit:
1056
1190
  - **Update requires 4 fields** — `id`, `valueType`, `context`, `contextId` are all required even if you only want to change the value. Omitting any will cause a validation error.
1057
1191
  - **Transition API `source` field** references settings — when `source: "settings.cancellationReasons"` appears in a user action attribute, that means a setting named `cancellationReasons` (or similar) must exist for the dropdown to populate.
1058
1192
  - **Always query before creating** during migration — creating a setting with a name that already exists at the same context may fail or create a duplicate depending on the Fluent version.
1193
+
1194
+ ## Post-Execution: Feedback Capture
1195
+
1196
+ After completing this skill (whether success or failure), write a feedback record:
1197
+
1198
+ 1. **Classify outcome:** `SUCCESS` (settings applied), `PARTIAL_SUCCESS` (some settings failed), `FAILURE` (could not complete), `BLOCKED` (env unreachable), `USER_CORRECTED` (user overrode values/approach)
1199
+ 2. **Build record:** Create a `feedback-record-v1` JSON object with:
1200
+ - `skill`: `"fluent-settings"`
1201
+ - `feature`: feature slug if applicable
1202
+ - `entityType` / `entitySubtype`: entity type the settings configure (if applicable)
1203
+ - `phases`: trace of each phase (pre-flight, plan, audit, upsert, verify) with PASS/FAIL/SKIP
1204
+ - `learnings`: any gotchas discovered (wrong value type, missing context, silent failure)
1205
+ - `userCorrections`: any corrections the user provided
1206
+ 3. **Redact secrets:** Strip webhook URLs with tokens, API keys. Keep setting names and contexts.
1207
+ 4. **Append** one JSON line to `accounts/<PROFILE>/feedback/fluent-settings.jsonl`
1208
+ 5. **Update** `accounts/<PROFILE>/feedback/index.json` counters (create with `mkdir -p` if missing)
1209
+
1210
+ **Skip capture if:** The execution was read-only (audit, discover, list — no mutations).
1211
+
1212
+ ## Known Pitfalls
1213
+ <!-- feedback-promoted: managed section, updated by feedback loop -->
1214
+
1215
+ _(No promoted learnings yet.)_
1216
+
1217
+ <!-- end feedback-promoted -->
@@ -72,9 +72,11 @@ This skill does **not** own:
72
72
 
73
73
  ## Execution Protocol
74
74
 
75
- ### Phase 1: Source Analysis
75
+ **Phase ordering note:** Unlike most implementation skills, source-onboard runs analysis (Phase 1) BEFORE the planning gate (Phase 2). This is intentional — you must understand what exists before you can plan the restructuring. Phase 1 is read-only analysis. Phase 2 is the mandatory approval gate before any files are modified.
76
76
 
77
- **Goal:** Understand what exists, classify its state, and identify all rule classes.
77
+ ### Phase 1: Source Analysis (read-only)
78
+
79
+ **Goal:** Understand what exists, classify its state, and identify all rule classes. **No files are modified in this phase.**
78
80
 
79
81
  #### Step 1.1: Classify Source Layout
80
82
 
@@ -150,9 +152,18 @@ plugin.list (compact: true)
150
152
 
151
153
  ### Phase 2: Planning Gate
152
154
 
155
+ #### Pre-flight: Plan Verification
156
+
157
+ Before proceeding, check for an existing approved plan:
158
+
159
+ 1. **Search** `accounts/<PROFILE>/features/*/status.json` for an entry with `plan: "APPROVED"` that covers this onboarding, OR check `accounts/<PROFILE>/tasks/` for a task plan with `Status: APPROVED`
160
+ 2. **If multi-artifact work** (onboarding as part of larger feature): STOP. Invoke `/fluent-feature-plan` first
161
+ 3. **If approved plan found:** Skip to implementation, referencing the plan's relevant sections
162
+ 4. **If source-onboard-only work with no plan:** Continue to the Planning Gate below
163
+
153
164
  **MANDATORY: Present a restructuring plan before making ANY changes.** Use the template from `PLAN_TEMPLATE.md` in the `fluent-feature-plan` skill as the base structure. Every table row must carry a Source column (NEW/EXISTING/MODIFIED/REUSED/OOTB). Extend with the source-onboard-specific sections below.
154
165
 
155
- Write the plan to: `accounts/<PROFILE>/plans/<YYYY-MM-DD>-source-onboard-<slug>.md`. Set `Status: PENDING`.
166
+ Write the plan to: `accounts/<PROFILE>/tasks/<YYYY-MM-DD>-source-onboard-<slug>.md`. Set `Status: PENDING`.
156
167
 
157
168
  **Source-onboard specific sections** (in addition to the standard template):
158
169
 
@@ -256,6 +267,23 @@ accounts/<PROFILE>/SOURCE/fluentcommerce-fc-module-<module-name>/
256
267
 
257
268
  **Wait for user approval.** On `--dry-run`, output the plan and exit without making changes.
258
269
 
270
+ ## Handoff Protocol
271
+
272
+ ### Signals emitted by this skill
273
+
274
+ | Signal | Condition | Example |
275
+ |--------|-----------|---------|
276
+ | `-> READY: <path>` | Module restructured | `-> READY: accounts/HMDEV/SOURCE/fc-module-restructured/` |
277
+ | `-> NEXT: /fluent-<skill>` | Ready for build + validation | `-> NEXT: /fluent-build` |
278
+ | `-> BLOCKED: <reason>` | Cannot proceed | `-> BLOCKED: PREREQ_MISSING — No source code found at specified path` |
279
+
280
+ ### Error codes
281
+
282
+ | Code | Condition | Recovery |
283
+ |------|-----------|----------|
284
+ | `PREREQ_MISSING` | No source code found at the specified path | Provide correct path or clone repo |
285
+ | `VALIDATION_FAILED` | Source cannot be restructured (incompatible format) | Manual intervention required |
286
+
259
287
  ### Phase 3: Execute Restructuring
260
288
 
261
289
  After approval, execute the plan in this order: