@fluentcommerce/ai-skills 0.2.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 (169) hide show
  1. package/README.md +866 -616
  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 -190
  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 -623
  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 +181 -17
  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 -76
  19. package/content/dev/agents/fluent-dev/agent.json +24 -2
  20. package/content/dev/agents/fluent-dev.md +194 -524
  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 -170
  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 +731 -0
  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 +40 -11
  33. package/content/dev/skills/fluent-feature-plan/SKILL.md +478 -221
  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 +134 -3
  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 -1090
  135. package/content/dev/skills/fluent-retailer-config/SKILL.md +1162 -1120
  136. package/content/dev/skills/fluent-rollback/SKILL.md +387 -0
  137. package/content/dev/skills/fluent-rule-scaffold/SKILL.md +515 -394
  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 +151 -2
  142. package/content/dev/skills/fluent-source-onboard/SKILL.md +23 -4
  143. package/content/dev/skills/fluent-sourcing/SKILL.md +14 -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 -471
  149. package/content/dev/skills/fluent-use-case-discover/SPEC_TEMPLATE.md +22 -1
  150. package/content/dev/skills/fluent-version-manage/SKILL.md +44 -3
  151. package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +995 -959
  152. package/content/dev/skills/fluent-workflow-builder/SKILL.md +668 -326
  153. package/content/dev/skills/fluent-workflow-deploy/SKILL.md +480 -0
  154. package/content/dev/skills/fluent-workspace-tree/SKILL.md +281 -0
  155. package/content/mcp-extn/agents/fluent-mcp.md +133 -132
  156. package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +812 -800
  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 -73
  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 +906 -50
  167. package/metadata.json +184 -155
  168. package/package.json +7 -2
  169. package/docs/USE_CASES.pdf +0 -0
@@ -1,346 +1,364 @@
1
- ---
2
- name: fluent-transition-api
3
- description: Query the Fluent Commerce Transition API to discover available user actions for entities at any workflow status. Enables dynamic test sequences and UI action validation. Triggers on "transition api", "user actions", "available actions", "workflow transitions", "what actions".
4
- user-invocable: true
5
- allowed-tools: Bash, Read, Write, Edit, Glob, Grep
6
- argument-hint: <entity-type> <subtype> <status> [--retailer-id <id>]
7
- ---
8
-
9
- # Transition API — User Action Discovery
10
-
11
- Query the Fluent Commerce User Action / Transition API to discover what actions are available for an entity at a given workflow status.
12
-
13
- ## Ownership Boundary
14
-
15
- This skill owns Transition API queries, user action discovery, and action attribute mapping.
16
-
17
- Workflow structure is owned by `/fluent-workflow-builder`.
18
- Event dispatch is owned by `/fluent-mcp-tools`.
19
- E2E test choreography is owned by `/fluent-e2e-test`.
20
-
21
- ## When to Use
22
-
23
- - Discovering what user actions are available at a specific workflow status
24
- - Validating that expected UI buttons/actions appear after workflow deployment
25
- - Building dynamic test sequences that adapt to workflow changes
26
- - Mapping required event attributes for each user action
27
- - Auditing module-specific user action visibility
28
-
29
- ## API Reference
30
-
31
- ### Endpoint
32
-
33
- ```
34
- POST <BASE_URL>/api/v4.1/transition
35
- Content-Type: application/json
36
- Authorization: Bearer <token>
37
- ```
38
-
39
- ### Request Body
40
-
41
- ```json
42
- {
43
- "triggers": [
44
- {
45
- "type": "<ENTITY_TYPE>",
46
- "subtype": "<ENTITY_SUBTYPE>",
47
- "status": "<CURRENT_STATUS>",
48
- "retailerId": "<RETAILER_ID>",
49
- "module": "<MODULE_FILTER>",
50
- "flexType": "<ENTITY_TYPE>::<SUBTYPE>",
51
- "flexVersion": <VERSION_NUMBER>
52
- }
53
- ]
54
- }
55
- ```
56
-
57
- **Parameters:**
58
-
59
- | Field | Required | Description |
60
- |-------|----------|-------------|
61
- | `type` | No | Entity type (ORDER, FULFILMENT, etc.) |
62
- | `subtype` | No | Entity subtype (HD, CC, DEFAULT, etc.) |
63
- | `status` | No | Current entity status. If omitted, returns actions for ALL statuses |
64
- | `retailerId` | Yes | Retailer ID |
65
- | `module` | Yes | Module filter (case-sensitive). Examples: `servicepoint`, `adminconsole`, `all` |
66
- | `flexType` | Yes | Workflow identifier: `<TYPE>::<SUBTYPE>` |
67
- | `flexVersion` | No | Specific workflow version. If omitted, uses latest |
68
-
69
- ### Response
70
-
71
- ```json
72
- {
73
- "response": [
74
- {
75
- "trigger": {
76
- "type": "ORDER",
77
- "subtype": "HD",
78
- "status": "BOOKED",
79
- "module": "adminconsole",
80
- "flexType": "ORDER::HD",
81
- "retailerId": "2"
82
- },
83
- "userActions": [
84
- {
85
- "eventName": "CancelOrder",
86
- "context": [
87
- {
88
- "label": "CANCEL ORDER",
89
- "type": "SECONDARY",
90
- "modules": ["adminconsole"],
91
- "confirm": true
92
- }
93
- ],
94
- "attributes": [
95
- {
96
- "name": "cancellationReason",
97
- "label": "Reason for cancellation",
98
- "type": "String",
99
- "mandatory": true,
100
- "source": "settings.cancellationReasons",
101
- "options": ["Customer request", "Out of stock", "Other"]
102
- }
103
- ]
104
- }
105
- ],
106
- "transitions": [
107
- {
108
- "eventName": "CancelOrder",
109
- "context": [...],
110
- "attributes": [...]
111
- }
112
- ]
113
- }
114
- ]
115
- }
116
- ```
117
-
118
- ## Usage Patterns
119
-
120
- Shell compatibility:
121
- - The examples below are Bash-first.
122
- - On Windows PowerShell, use `Invoke-RestMethod` equivalents (example below).
123
- - When MCP extension tools are available, prefer `workflow.transitions` for cross-platform execution without manual token scripting.
124
-
125
- ```powershell
126
- # PowerShell equivalent for Pattern 1 (auth + transition query)
127
- $token = (Invoke-RestMethod -Method Post -Uri "$BASE_URL/oauth/token" -ContentType "application/x-www-form-urlencoded" -Body @{
128
- username = $FLUENT_USERNAME
129
- password = $FLUENT_PASSWORD
130
- client_id = $ACCOUNT
131
- client_secret = $SECRET
132
- grant_type = "password"
133
- scope = "api"
134
- }).access_token
135
-
136
- $headers = @{
137
- Authorization = "Bearer $token"
138
- "Content-Type" = "application/json"
139
- }
140
-
141
- $body = @{
142
- triggers = @(
143
- @{
144
- type = "ORDER"
145
- subtype = "HD"
146
- status = "BOOKED"
147
- retailerId = "2"
148
- module = "adminconsole"
149
- flexType = "ORDER::HD"
150
- }
151
- )
152
- } | ConvertTo-Json -Depth 10
153
-
154
- Invoke-RestMethod -Method Post -Uri "$BASE_URL/api/v4.1/transition" -Headers $headers -Body $body
155
- ```
156
-
157
- ### Pattern 1: Discover Available Actions at a Status
158
-
159
- > **Cross-platform note:** The REST API examples below use bash syntax. On Windows, use Git Bash, WSL, or the PowerShell equivalents shown earlier. The MCP `workflow.transitions` tool (shown in the PowerShell section above) is the recommended cross-platform approach.
160
-
161
- ```bash
162
- # Authenticate
163
- # IMPORTANT: Use dedicated variables (FLUENT_USERNAME, FLUENT_PASSWORD) instead of $USER,
164
- # which collides with the Unix env var that contains the OS login name.
165
- TOKEN=$(curl -s -X POST "$BASE_URL/oauth/token" \
166
- -H "Content-Type: application/x-www-form-urlencoded" \
167
- -d "username=$FLUENT_USERNAME&password=$FLUENT_PASSWORD&client_id=$ACCOUNT&client_secret=$SECRET&grant_type=password&scope=api" \
168
- | python -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
169
-
170
- # Query transitions for ORDER::HD at BOOKED status
171
- curl -s -X POST "$BASE_URL/api/v4.1/transition" \
172
- -H "Content-Type: application/json" \
173
- -H "Authorization: Bearer $TOKEN" \
174
- -d '{
175
- "triggers": [{
176
- "type": "ORDER",
177
- "subtype": "HD",
178
- "status": "BOOKED",
179
- "retailerId": "2",
180
- "module": "adminconsole",
181
- "flexType": "ORDER::HD"
182
- }]
183
- }' | python -m json.tool
184
- ```
185
-
186
- ### Pattern 2: Map All Actions Across All Statuses
187
-
188
- Query without a `status` to get actions for every status in the workflow:
189
-
190
- ```bash
191
- curl -s -X POST "$BASE_URL/api/v4.1/transition" \
192
- -H "Content-Type: application/json" \
193
- -H "Authorization: Bearer $TOKEN" \
194
- -d '{
195
- "triggers": [{
196
- "type": "ORDER",
197
- "retailerId": "2",
198
- "module": "adminconsole",
199
- "flexType": "ORDER::HD"
200
- }]
201
- }'
202
- ```
203
-
204
- ### Pattern 3: Validate Specific Module Actions
205
-
206
- Filter by module to see only actions visible to a specific UI:
207
-
208
- ```bash
209
- # ServicePoint UI actions
210
- curl -s -X POST "$BASE_URL/api/v4.1/transition" \
211
- -H "Content-Type: application/json" \
212
- -H "Authorization: Bearer $TOKEN" \
213
- -d '{
214
- "triggers": [{
215
- "type": "FULFILMENT",
216
- "subtype": "HD_WH",
217
- "status": "CREATED",
218
- "retailerId": "2",
219
- "module": "servicepoint",
220
- "flexType": "FULFILMENT::HD_WH"
221
- }]
222
- }'
223
- ```
224
-
225
- ### Pattern 4: Dynamic E2E Test Sequence
226
-
227
- Use the Transition API to build adaptive test flows:
228
-
229
- ```
230
- 1. Create entity via graphql.query mutation
231
- 2. Query POST /api/v4.1/transition for current status
232
- 3. For each userAction in response:
233
- a. Extract eventName and required attributes
234
- b. Send event via event.send with extracted attributes
235
- c. Poll entity status until transition completes
236
- d. Query transitions again for new status
237
- 4. Repeat until no userActions
238
- 5. If `userActions` is empty, confirm whether status is terminal or system-managed before stopping
239
- 5. Report all transitions taken
240
- ```
241
-
242
- This approach is more robust than hardcoded event sequences because:
243
- - Test adapts automatically when workflow changes
244
- - Discovers required attributes at runtime
245
- - Validates that expected UI buttons exist
246
- - Catches missing or unexpected user actions
247
-
248
- ### Pattern 5: Empty `userActions` Diagnostic Check
249
-
250
- If transition response contains empty `userActions`, use this check:
251
-
252
- 1. Verify trigger filters are correct (`retailerId`, `flexType`, `subtype`, `module`).
253
- 2. Retry with `module: "all"` to rule out module visibility filtering.
254
- 3. Verify entity is actually in the status used in the trigger.
255
- 4. If still empty and status is non-terminal, treat as system-managed/gated phase and continue with workflow/event-based testing.
256
-
257
- ## Response Field Reference
258
-
259
- ### UserAction Fields
260
-
261
- | Field | Type | Description |
262
- |-------|------|-------------|
263
- | `eventName` | String | Event to send when this action is invoked — maps to `event.send` name parameter |
264
- | `context` | Context[] | UI display information (label, type, module visibility) |
265
- | `attributes` | Attribute[] | Data required from the user when invoking this action |
266
-
267
- ### Context Fields
268
-
269
- | Field | Type | Values | Description |
270
- |-------|------|--------|-------------|
271
- | `label` | String | e.g., "CANCEL ORDER" | Button label in UI |
272
- | `type` | String | `PRIMARY`, `SECONDARY` | Button prominence |
273
- | `modules` | String[] | e.g., `["adminconsole"]` | Which UIs show this action |
274
- | `confirm` | Boolean | | Whether to show confirmation dialog |
275
- | `style` | String | | CSS class hint for button styling |
276
-
277
- ### Attribute Fields
278
-
279
- | Field | Type | Description |
280
- |-------|------|-------------|
281
- | `name` | String | Attribute name to attach to the event |
282
- | `label` | String | UI form label |
283
- | `type` | String | `String`, `Address`, `OrderItem`, `Product` |
284
- | `mandatory` | Boolean | Whether this attribute is required |
285
- | `value` | Object | Locked-in value (if present, don't show form field) |
286
- | `defaultValue` | Object | Pre-filled default |
287
- | `source` | String | Settings key for valid values (e.g., `settings.cancellationReasons`) |
288
- | `options` | Object | Populated from `source` the valid values list |
289
-
290
- ## Mapping to MCP Event Dispatch
291
-
292
- The Transition API response maps directly to MCP `event.send` calls:
293
-
294
- ```
295
- userAction.eventName → event.send name parameter
296
- userAction.attributes → event.send attributes parameter
297
- trigger.retailerId → event.send retailerId parameter
298
- trigger.type + entityRef event.send entityType + entityRef parameters
299
- ```
300
-
301
- **Example:**
302
-
303
- Transition API returns:
304
- ```json
305
- {
306
- "eventName": "ConfirmShipment",
307
- "attributes": [
308
- { "name": "trackingNumber", "type": "String", "mandatory": true },
309
- { "name": "carrierRef", "type": "String", "mandatory": true }
310
- ]
311
- }
312
- ```
313
-
314
- Maps to:
315
- ```json
316
- event.send({
317
- "name": "ConfirmShipment",
318
- "entityRef": "<FULFILMENT_REF>",
319
- "entityType": "FULFILMENT",
320
- "retailerId": "2",
321
- "attributes": {
322
- "trackingNumber": "TRACK-001",
323
- "carrierRef": "DHL"
324
- }
325
- })
326
- ```
327
-
328
- ## Integration with Other Skills
329
-
330
- | Task | Skill |
331
- |------|-------|
332
- | Analyze workflow structure | `/fluent-workflow-analyzer` |
333
- | Build/edit workflow user actions | `/fluent-workflow-builder` |
334
- | Send events discovered by transitions | `/fluent-mcp-tools` |
335
- | Run full E2E test using transitions | `/fluent-e2e-test` |
336
- | Debug failed transitions | `/fluent-trace` |
337
-
338
- ## Tips
339
-
340
- - **Module names are case-sensitive** — `servicepoint` works, `ServicePoint` does not
341
- - **Use `all` as module** to get actions across all UI modules
342
- - **Empty `userActions` array** can mean terminal, system-managed, or filter mismatch (module/flexType/status)
343
- - **`transitions` and `userActions`** often contain the same data — `userActions` is the canonical field
344
- - **Locked `value` attributes** mean the workflow pre-sets the value (e.g., cancellation reason locked to "BROKEN") — do not show a form field for these
345
- - **`flexVersion`** is optional — omit to get actions from the latest workflow version
346
- - **Multiple triggers** can be sent in one request to batch-query actions for multiple entities/statuses
1
+ ---
2
+ name: fluent-transition-api
3
+ description: Query the Fluent Commerce Transition API to discover available user actions for entities at any workflow status. Enables dynamic test sequences and UI action validation. Triggers on "transition api", "user actions", "available actions", "workflow transitions", "what actions".
4
+ user-invocable: true
5
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep
6
+ argument-hint: <entity-type> <subtype> <status> [--retailer-id <id>]
7
+ ---
8
+
9
+ # Transition API — User Action Discovery
10
+
11
+ Query the Fluent Commerce User Action / Transition API to discover what actions are available for an entity at a given workflow status.
12
+
13
+ ## Ownership Boundary
14
+
15
+ This skill owns Transition API queries, user action discovery, and action attribute mapping.
16
+
17
+ Workflow structure is owned by `/fluent-workflow-builder`.
18
+ Event dispatch is owned by `/fluent-mcp-tools`.
19
+ E2E test choreography is owned by `/fluent-e2e-test`.
20
+
21
+ ## When to Use
22
+
23
+ - Discovering what user actions are available at a specific workflow status
24
+ - Validating that expected UI buttons/actions appear after workflow deployment
25
+ - Building dynamic test sequences that adapt to workflow changes
26
+ - Mapping required event attributes for each user action
27
+ - Auditing module-specific user action visibility
28
+
29
+ ## API Reference
30
+
31
+ ### Endpoint
32
+
33
+ ```
34
+ POST <BASE_URL>/api/v4.1/transition
35
+ Content-Type: application/json
36
+ Authorization: Bearer <token>
37
+ ```
38
+
39
+ ### Request Body
40
+
41
+ ```json
42
+ {
43
+ "triggers": [
44
+ {
45
+ "type": "<ENTITY_TYPE>",
46
+ "subtype": "<ENTITY_SUBTYPE>",
47
+ "status": "<CURRENT_STATUS>",
48
+ "retailerId": "<RETAILER_ID>",
49
+ "module": "<MODULE_FILTER>",
50
+ "flexType": "<ENTITY_TYPE>::<SUBTYPE>",
51
+ "flexVersion": <VERSION_NUMBER>
52
+ }
53
+ ]
54
+ }
55
+ ```
56
+
57
+ **Parameters:**
58
+
59
+ | Field | Required | Description |
60
+ |-------|----------|-------------|
61
+ | `type` | No | Entity type (ORDER, FULFILMENT, etc.) |
62
+ | `subtype` | No | Entity subtype (HD, CC, DEFAULT, etc.) |
63
+ | `status` | No | Current entity status. If omitted, returns actions for ALL statuses |
64
+ | `retailerId` | Yes | Retailer ID |
65
+ | `module` | Yes | Module filter (case-sensitive). Examples: `servicepoint`, `adminconsole`, `all` |
66
+ | `flexType` | Yes | Workflow identifier: `<TYPE>::<SUBTYPE>` |
67
+ | `flexVersion` | No | Specific workflow version. If omitted, uses latest |
68
+
69
+ ## Strict User Action Contract (Anti-Hallucination)
70
+
71
+ Transition API is read-only discovery. It does NOT create or modify workflow user actions.
72
+
73
+ When expected actions are missing, treat this as workflow/config drift and validate these non-negotiable contracts:
74
+
75
+ 1. The workflow ruleset defines `userActions` inside the ruleset object (not at workflow root).
76
+ 2. Ruleset has `subtype`, and it matches the workflow/entity subtype being queried.
77
+ 3. `userActions[].eventName` is explicitly set and aligned with the ruleset `name` unless intentionally different.
78
+ 4. `context[]` includes required fields: `label`, `type`, `modules`, `confirm`.
79
+ 5. `context[].modules` values are valid app names (`adminconsole`, `store`, `servicepoint`, or known custom manifest app suffixes from `fc.mystique.apps`).
80
+ 6. No invented schema keys are used in workflow JSON (for example: `actionLabel`, `moduleName`, `requiresConfirmation`, `buttonType`).
81
+ 7. Transition trigger must be internally consistent: `type`, `subtype`, and `flexType` must refer to the same workflow.
82
+
83
+ ### Response
84
+
85
+ ```json
86
+ {
87
+ "response": [
88
+ {
89
+ "trigger": {
90
+ "type": "ORDER",
91
+ "subtype": "HD",
92
+ "status": "BOOKED",
93
+ "module": "adminconsole",
94
+ "flexType": "ORDER::HD",
95
+ "retailerId": "2"
96
+ },
97
+ "userActions": [
98
+ {
99
+ "eventName": "CancelOrder",
100
+ "context": [
101
+ {
102
+ "label": "CANCEL ORDER",
103
+ "type": "SECONDARY",
104
+ "modules": ["adminconsole"],
105
+ "confirm": true
106
+ }
107
+ ],
108
+ "attributes": [
109
+ {
110
+ "name": "cancellationReason",
111
+ "label": "Reason for cancellation",
112
+ "type": "String",
113
+ "mandatory": true,
114
+ "source": "settings.cancellationReasons",
115
+ "options": ["Customer request", "Out of stock", "Other"]
116
+ }
117
+ ]
118
+ }
119
+ ],
120
+ "transitions": [
121
+ {
122
+ "eventName": "CancelOrder",
123
+ "context": [...],
124
+ "attributes": [...]
125
+ }
126
+ ]
127
+ }
128
+ ]
129
+ }
130
+ ```
131
+
132
+ ## Usage Patterns
133
+
134
+ Shell compatibility:
135
+ - The examples below are Bash-first.
136
+ - On Windows PowerShell, use `Invoke-RestMethod` equivalents (example below).
137
+ - When MCP extension tools are available, prefer `workflow.transitions` for cross-platform execution without manual token scripting.
138
+
139
+ ```powershell
140
+ # PowerShell equivalent for Pattern 1 (auth + transition query)
141
+ $token = (Invoke-RestMethod -Method Post -Uri "$BASE_URL/oauth/token" -ContentType "application/x-www-form-urlencoded" -Body @{
142
+ username = $FLUENT_USERNAME
143
+ password = $FLUENT_PASSWORD
144
+ client_id = $ACCOUNT
145
+ client_secret = $SECRET
146
+ grant_type = "password"
147
+ scope = "api"
148
+ }).access_token
149
+
150
+ $headers = @{
151
+ Authorization = "Bearer $token"
152
+ "Content-Type" = "application/json"
153
+ }
154
+
155
+ $body = @{
156
+ triggers = @(
157
+ @{
158
+ type = "ORDER"
159
+ subtype = "HD"
160
+ status = "BOOKED"
161
+ retailerId = "2"
162
+ module = "adminconsole"
163
+ flexType = "ORDER::HD"
164
+ }
165
+ )
166
+ } | ConvertTo-Json -Depth 10
167
+
168
+ Invoke-RestMethod -Method Post -Uri "$BASE_URL/api/v4.1/transition" -Headers $headers -Body $body
169
+ ```
170
+
171
+ ### Pattern 1: Discover Available Actions at a Status
172
+
173
+ > **Cross-platform note:** The REST API examples below use bash syntax. On Windows, use Git Bash, WSL, or the PowerShell equivalents shown earlier. The MCP `workflow.transitions` tool (shown in the PowerShell section above) is the recommended cross-platform approach.
174
+
175
+ ```bash
176
+ # Authenticate
177
+ # IMPORTANT: Use dedicated variables (FLUENT_USERNAME, FLUENT_PASSWORD) instead of $USER,
178
+ # which collides with the Unix env var that contains the OS login name.
179
+ TOKEN=$(curl -s -X POST "$BASE_URL/oauth/token" \
180
+ -H "Content-Type: application/x-www-form-urlencoded" \
181
+ -d "username=$FLUENT_USERNAME&password=$FLUENT_PASSWORD&client_id=$ACCOUNT&client_secret=$SECRET&grant_type=password&scope=api" \
182
+ | python -c "import sys,json; print(json.load(sys.stdin)['access_token'])")
183
+
184
+ # Query transitions for ORDER::HD at BOOKED status
185
+ curl -s -X POST "$BASE_URL/api/v4.1/transition" \
186
+ -H "Content-Type: application/json" \
187
+ -H "Authorization: Bearer $TOKEN" \
188
+ -d '{
189
+ "triggers": [{
190
+ "type": "ORDER",
191
+ "subtype": "HD",
192
+ "status": "BOOKED",
193
+ "retailerId": "2",
194
+ "module": "adminconsole",
195
+ "flexType": "ORDER::HD"
196
+ }]
197
+ }' | python -m json.tool
198
+ ```
199
+
200
+ ### Pattern 2: Map All Actions Across All Statuses
201
+
202
+ Query without a `status` to get actions for every status in the workflow:
203
+
204
+ ```bash
205
+ curl -s -X POST "$BASE_URL/api/v4.1/transition" \
206
+ -H "Content-Type: application/json" \
207
+ -H "Authorization: Bearer $TOKEN" \
208
+ -d '{
209
+ "triggers": [{
210
+ "type": "ORDER",
211
+ "retailerId": "2",
212
+ "module": "adminconsole",
213
+ "flexType": "ORDER::HD"
214
+ }]
215
+ }'
216
+ ```
217
+
218
+ ### Pattern 3: Validate Specific Module Actions
219
+
220
+ Filter by module to see only actions visible to a specific UI:
221
+
222
+ ```bash
223
+ # ServicePoint UI actions
224
+ curl -s -X POST "$BASE_URL/api/v4.1/transition" \
225
+ -H "Content-Type: application/json" \
226
+ -H "Authorization: Bearer $TOKEN" \
227
+ -d '{
228
+ "triggers": [{
229
+ "type": "FULFILMENT",
230
+ "subtype": "HD_WH",
231
+ "status": "CREATED",
232
+ "retailerId": "2",
233
+ "module": "servicepoint",
234
+ "flexType": "FULFILMENT::HD_WH"
235
+ }]
236
+ }'
237
+ ```
238
+
239
+ ### Pattern 4: Dynamic E2E Test Sequence
240
+
241
+ Use the Transition API to build adaptive test flows:
242
+
243
+ ```
244
+ 1. Create entity via graphql.query mutation
245
+ 2. Query POST /api/v4.1/transition for current status
246
+ 3. For each userAction in response:
247
+ a. Extract eventName and required attributes
248
+ b. Send event via event.send with extracted attributes
249
+ c. Poll entity status until transition completes
250
+ d. Query transitions again for new status
251
+ 4. Repeat until no userActions
252
+ 5. If `userActions` is empty, confirm whether status is terminal or system-managed before stopping
253
+ 5. Report all transitions taken
254
+ ```
255
+
256
+ This approach is more robust than hardcoded event sequences because:
257
+ - Test adapts automatically when workflow changes
258
+ - Discovers required attributes at runtime
259
+ - Validates that expected UI buttons exist
260
+ - Catches missing or unexpected user actions
261
+
262
+ ### Pattern 5: Empty `userActions` Diagnostic Check
263
+
264
+ If transition response contains empty `userActions`, use this check:
265
+
266
+ 1. Verify trigger filters are correct (`retailerId`, `flexType`, `subtype`, `module`).
267
+ 2. Retry with `module: "all"` to rule out module visibility filtering.
268
+ 3. Verify entity is actually in the status used in the trigger.
269
+ 4. Verify the workflow ruleset has matching `subtype` and correctly placed `userActions`.
270
+ 5. Verify `userActions[].eventName` and ruleset name alignment in workflow JSON.
271
+ 6. Verify `context[].modules` values exist in target UI app set (`fc.mystique.apps` for custom apps).
272
+ 7. If still empty and status is non-terminal, treat as system-managed/gated phase and continue with workflow/event-based testing.
273
+
274
+ ## Response Field Reference
275
+
276
+ ### UserAction Fields
277
+
278
+ | Field | Type | Description |
279
+ |-------|------|-------------|
280
+ | `eventName` | String | Event to send when this action is invoked — maps to `event.send` name parameter |
281
+ | `context` | Context[] | UI display information (label, type, module visibility) |
282
+ | `attributes` | Attribute[] | Data required from the user when invoking this action |
283
+
284
+ ### Context Fields
285
+
286
+ | Field | Type | Values | Description |
287
+ |-------|------|--------|-------------|
288
+ | `label` | String | e.g., "CANCEL ORDER" | Button label in UI |
289
+ | `type` | String | `PRIMARY`, `SECONDARY` | Button prominence |
290
+ | `modules` | String[] | e.g., `["adminconsole"]` | Which UIs show this action |
291
+ | `confirm` | Boolean | | Whether to show confirmation dialog |
292
+ | `style` | String | | CSS class hint for button styling |
293
+
294
+ ### Attribute Fields
295
+
296
+ | Field | Type | Description |
297
+ |-------|------|-------------|
298
+ | `name` | String | Attribute name to attach to the event |
299
+ | `label` | String | UI form label |
300
+ | `type` | String | `String`, `Address`, `OrderItem`, `Product` |
301
+ | `mandatory` | Boolean | Whether this attribute is required |
302
+ | `value` | Object | Locked-in value (if present, don't show form field) |
303
+ | `defaultValue` | Object | Pre-filled default |
304
+ | `source` | String | Settings key for valid values (e.g., `settings.cancellationReasons`) |
305
+ | `options` | Object | Populated from `source` — the valid values list |
306
+
307
+ ## Mapping to MCP Event Dispatch
308
+
309
+ The Transition API response maps directly to MCP `event.send` calls:
310
+
311
+ ```
312
+ userAction.eventName → event.send name parameter
313
+ userAction.attributes → event.send attributes parameter
314
+ trigger.retailerId → event.send retailerId parameter
315
+ trigger.type + entityRef → event.send entityType + entityRef parameters
316
+ ```
317
+
318
+ **Example:**
319
+
320
+ Transition API returns:
321
+ ```json
322
+ {
323
+ "eventName": "ConfirmShipment",
324
+ "attributes": [
325
+ { "name": "trackingNumber", "type": "String", "mandatory": true },
326
+ { "name": "carrierRef", "type": "String", "mandatory": true }
327
+ ]
328
+ }
329
+ ```
330
+
331
+ Maps to:
332
+ ```json
333
+ event.send({
334
+ "name": "ConfirmShipment",
335
+ "entityRef": "<FULFILMENT_REF>",
336
+ "entityType": "FULFILMENT",
337
+ "retailerId": "2",
338
+ "attributes": {
339
+ "trackingNumber": "TRACK-001",
340
+ "carrierRef": "DHL"
341
+ }
342
+ })
343
+ ```
344
+
345
+ ## Integration with Other Skills
346
+
347
+ | Task | Skill |
348
+ |------|-------|
349
+ | Analyze workflow structure | `/fluent-workflow-analyzer` |
350
+ | Build/edit workflow user actions | `/fluent-workflow-builder` |
351
+ | Send events discovered by transitions | `/fluent-mcp-tools` |
352
+ | Run full E2E test using transitions | `/fluent-e2e-test` |
353
+ | Debug failed transitions | `/fluent-trace` |
354
+
355
+ ## Tips
356
+
357
+ - **Module names are case-sensitive** — `servicepoint` works, `ServicePoint` does not
358
+ - **Use `all` as module** to get actions across all UI modules
359
+ - **Empty `userActions` array** can mean terminal, system-managed, or filter mismatch (module/flexType/status)
360
+ - **`transitions` and `userActions`** often contain the same data — `userActions` is the canonical field
361
+ - **Locked `value` attributes** mean the workflow pre-sets the value (e.g., cancellation reason locked to "BROKEN") — do not show a form field for these
362
+ - **`flexVersion`** is optional — omit to get actions from the latest workflow version
363
+ - **Multiple triggers** can be sent in one request to batch-query actions for multiple entities/statuses
364
+ - **Use workflow JSON as the truth source for schema** — do not invent extra user-action keys; validate against `/fluent-workflow-builder` contract