@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.
- package/LICENSE +21 -0
- package/README.md +622 -0
- package/bin/cli.mjs +1973 -0
- package/content/cli/agents/fluent-cli/agent.json +149 -0
- package/content/cli/agents/fluent-cli.md +132 -0
- package/content/cli/skills/fluent-bootstrap/SKILL.md +181 -0
- package/content/cli/skills/fluent-cli-index/SKILL.md +63 -0
- package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +77 -0
- package/content/cli/skills/fluent-cli-reference/SKILL.md +1031 -0
- package/content/cli/skills/fluent-cli-retailer/SKILL.md +85 -0
- package/content/cli/skills/fluent-cli-settings/SKILL.md +106 -0
- package/content/cli/skills/fluent-connect/SKILL.md +886 -0
- package/content/cli/skills/fluent-module-deploy/SKILL.md +349 -0
- package/content/cli/skills/fluent-profile/SKILL.md +180 -0
- package/content/cli/skills/fluent-workflow/SKILL.md +310 -0
- package/content/dev/agents/fluent-dev/agent.json +88 -0
- package/content/dev/agents/fluent-dev.md +525 -0
- package/content/dev/reference-modules/catalog.json +4754 -0
- package/content/dev/skills/fluent-build/SKILL.md +192 -0
- package/content/dev/skills/fluent-connection-analysis/SKILL.md +386 -0
- package/content/dev/skills/fluent-custom-code/SKILL.md +895 -0
- package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +714 -0
- package/content/dev/skills/fluent-e2e-test/SKILL.md +394 -0
- package/content/dev/skills/fluent-event-api/SKILL.md +945 -0
- package/content/dev/skills/fluent-feature-explain/SKILL.md +603 -0
- package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +695 -0
- package/content/dev/skills/fluent-feature-plan/SKILL.md +227 -0
- package/content/dev/skills/fluent-job-batch/SKILL.md +138 -0
- package/content/dev/skills/fluent-mermaid-validate/SKILL.md +86 -0
- package/content/dev/skills/fluent-module-scaffold/SKILL.md +1928 -0
- package/content/dev/skills/fluent-module-validate/SKILL.md +775 -0
- package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1108 -0
- package/content/dev/skills/fluent-retailer-config/SKILL.md +1111 -0
- package/content/dev/skills/fluent-rule-scaffold/SKILL.md +385 -0
- package/content/dev/skills/fluent-scope-decompose/SKILL.md +1021 -0
- package/content/dev/skills/fluent-session-audit-export/SKILL.md +632 -0
- package/content/dev/skills/fluent-session-summary/SKILL.md +195 -0
- package/content/dev/skills/fluent-settings/SKILL.md +1058 -0
- package/content/dev/skills/fluent-source-onboard/SKILL.md +632 -0
- package/content/dev/skills/fluent-system-monitoring/SKILL.md +767 -0
- package/content/dev/skills/fluent-test-data/SKILL.md +513 -0
- package/content/dev/skills/fluent-trace/SKILL.md +1143 -0
- package/content/dev/skills/fluent-transition-api/SKILL.md +346 -0
- package/content/dev/skills/fluent-version-manage/SKILL.md +744 -0
- package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +959 -0
- package/content/dev/skills/fluent-workflow-builder/SKILL.md +319 -0
- package/content/dev/skills/fluent-workflow-deploy/SKILL.md +267 -0
- package/content/mcp-extn/agents/fluent-mcp.md +69 -0
- package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +461 -0
- package/content/mcp-official/agents/fluent-mcp-core.md +91 -0
- package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -0
- package/content/rfl/agents/fluent-rfl.md +56 -0
- package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -0
- package/docs/CAPABILITY_MAP.md +77 -0
- package/docs/CLI_COVERAGE.md +47 -0
- package/docs/DEV_WORKFLOW.md +802 -0
- package/docs/FLOW_RUN.md +142 -0
- package/docs/USE_CASES.md +404 -0
- package/metadata.json +156 -0
- package/package.json +51 -0
|
@@ -0,0 +1,346 @@
|
|
|
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
|