@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,349 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fluent-module-deploy
|
|
3
|
+
description: Deploy Fluent Commerce modules (reference, extension, or data) to target retailers. Use when deploying, installing, or pushing modules to environments. Triggers on "deploy module", "install module", "push module", "module install".
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash, Read, Write, Edit, Glob, Grep
|
|
6
|
+
argument-hint: <module-path> [--profile name] [--retailer ref]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Module Deployment
|
|
10
|
+
|
|
11
|
+
Deploy modules to Fluent Commerce environments with validation and verification.
|
|
12
|
+
|
|
13
|
+
## Planning Gate
|
|
14
|
+
|
|
15
|
+
**Before deploying any module, write a plan using the template from `PLAN_TEMPLATE.md` in the `fluent-feature-plan` skill.**
|
|
16
|
+
|
|
17
|
+
**Module-deploy specific emphasis — ensure these are covered:**
|
|
18
|
+
|
|
19
|
+
1. **Business Context (Section 1)** — what change this deployment delivers
|
|
20
|
+
2. **Scope (Section 2)** — module name, version, type (reference/extension/data)
|
|
21
|
+
3. **Impacted rulesets (Section 4.3)** — new rules being registered, existing rules being updated
|
|
22
|
+
4. **Settings (Section 4.4)** — settings required by new/changed rules
|
|
23
|
+
5. **Impacted workflows (Section 4.1)** — workflows that reference rules in this module
|
|
24
|
+
6. **Impacted retailers (Section 4.8)** — profile, retailer ref, environment (sandbox/UAT/prod)
|
|
25
|
+
7. **Deployment Sequence (Section 9)** — pre-checks (validation, build, tests) → deploy → verify
|
|
26
|
+
8. **Rollback Plan (Section 10)** — previous module version to restore if deployment fails
|
|
27
|
+
|
|
28
|
+
**Write the plan to:** `accounts/<PROFILE>/plans/<YYYY-MM-DD>-module-deploy-<slug>.md`. Set `Status: PENDING`.
|
|
29
|
+
|
|
30
|
+
Present the full plan content to the user and wait for approval before running `fluent module install`. On approval, update the file to `Status: APPROVED`. If the user says "just do it", proceed directly (still write the file for audit trail).
|
|
31
|
+
|
|
32
|
+
## When to Use
|
|
33
|
+
|
|
34
|
+
- Deploying reference modules from Fluent repository
|
|
35
|
+
- Installing custom extension modules
|
|
36
|
+
- Promoting modules across environments (dev -> UAT -> prod)
|
|
37
|
+
- Installing data modules
|
|
38
|
+
|
|
39
|
+
## Prerequisites
|
|
40
|
+
|
|
41
|
+
- [ ] Active profile set (`fluent profile use <name>`)
|
|
42
|
+
- [ ] Module source available (name, URL, or local path)
|
|
43
|
+
- [ ] Dependencies installed
|
|
44
|
+
- [ ] Configuration values ready (if module requires config)
|
|
45
|
+
- [ ] Module validation passed (check `accounts/<PROFILE>/analysis/module-validate/<name>.report.json` — `summary.status` should be `READY_FOR_BUILD`). Run `/fluent-module-validate` if report is missing or stale.
|
|
46
|
+
|
|
47
|
+
## Cross-Platform Command Notes
|
|
48
|
+
|
|
49
|
+
- Fluent CLI syntax is the same on macOS, Linux, and Windows.
|
|
50
|
+
- Prefer `rg` for placeholder scans (`rg` works in Bash, zsh, and PowerShell).
|
|
51
|
+
- For manifest existence checks, prefer reading `module.json` directly over shell-specific `ls` checks.
|
|
52
|
+
|
|
53
|
+
## Module Type Detection
|
|
54
|
+
|
|
55
|
+
Determine the module type before deploying -- each type has a different validation and deployment flow:
|
|
56
|
+
|
|
57
|
+
| Type | Detection | Deployment Flow |
|
|
58
|
+
|------|-----------|----------------|
|
|
59
|
+
| **Reference** | Name is `core`, `fulfilment`, `order`, `inventory`, or a URL source | describe -> check deps -> config -> install |
|
|
60
|
+
| **Extension** | Local path with `plugins/` directory | validate -> build -> package -> install from local ZIP |
|
|
61
|
+
| **Data** | Local path with `resources/assets/` but no `plugins/` | validate module.json -> install from local path |
|
|
62
|
+
|
|
63
|
+
**Reference module dependency order (mandatory):**
|
|
64
|
+
|
|
65
|
+
| # | Module | Dependencies |
|
|
66
|
+
|---|--------|-------------|
|
|
67
|
+
| 1 | `core` | None (install first) |
|
|
68
|
+
| 2 | `fulfilment` | core |
|
|
69
|
+
| 3 | `order` | core + fulfilment |
|
|
70
|
+
| 4 | `inventory` | core |
|
|
71
|
+
| 5 | Custom extensions | Varies (check module.json `dependencies`) |
|
|
72
|
+
|
|
73
|
+
Installing out of order will result in "dependency not installed" errors. Always verify dependencies via `fluent module list` before installing.
|
|
74
|
+
|
|
75
|
+
## Deployment Workflow
|
|
76
|
+
|
|
77
|
+
### Step 0: Verify CLI Available
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
fluent --version
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
If CLI is not found, **STOP**. The Fluent CLI is required for all module deployment operations (`fluent module install`, `fluent module list`, `fluent module config`). There is no MCP or REST API fallback for module deployment.
|
|
84
|
+
|
|
85
|
+
### Step 1: Validate Prerequisites
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# Check active context
|
|
89
|
+
fluent profile active
|
|
90
|
+
|
|
91
|
+
# Expected output:
|
|
92
|
+
# Active profile: <profile-name>
|
|
93
|
+
# Active retailer: <retailer-ref>
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Step 1.5: Validate Module Structure (local modules only)
|
|
97
|
+
|
|
98
|
+
For local module paths (extension or data modules), run structural validation before deploying:
|
|
99
|
+
|
|
100
|
+
**1. Check validation report:**
|
|
101
|
+
|
|
102
|
+
Read `accounts/<PROFILE>/analysis/module-validate/<module-name>.report.json` if it exists.
|
|
103
|
+
|
|
104
|
+
- If `summary.status == "READY_FOR_BUILD"` -- proceed
|
|
105
|
+
- If `summary.status == "NEEDS_FIXES"` -- **STOP**. List the FAIL items from the report. Run `/fluent-module-validate` to refresh if the report is stale.
|
|
106
|
+
- If report is missing -- **WARN** the user and recommend running `/fluent-module-validate` first. Ask for explicit confirmation before proceeding without validation.
|
|
107
|
+
|
|
108
|
+
**2. Inline minimum checks** (always, regardless of report):
|
|
109
|
+
|
|
110
|
+
- `resources/module.json` exists and parses as valid JSON
|
|
111
|
+
- Has `name` field (non-empty string)
|
|
112
|
+
- Has `version` field (matches semver `^\d+\.\d+\.\d+(-SNAPSHOT)?$`)
|
|
113
|
+
- For **extension modules**: `plugins/pom.xml` exists, version in module.json matches parent POM version
|
|
114
|
+
- For **data modules**: `resources/assets/` directory exists with at least one asset folder
|
|
115
|
+
|
|
116
|
+
### Step 2: Verify Module
|
|
117
|
+
|
|
118
|
+
**For reference modules:**
|
|
119
|
+
```bash
|
|
120
|
+
fluent module describe <module-name>
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
**For local modules:**
|
|
124
|
+
- Read `<module-path>/resources/module.json` directly and confirm it parses as JSON.
|
|
125
|
+
- Confirm the module type matches expectations (extension has `plugins/`, data has `resources/assets/`).
|
|
126
|
+
|
|
127
|
+
### Step 3: Check Dependencies
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
# List installed modules
|
|
131
|
+
fluent module list -p <profile-name>
|
|
132
|
+
|
|
133
|
+
# Compare with module.json dependencies
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
If dependencies missing: install them first!
|
|
137
|
+
|
|
138
|
+
**For reference modules**, enforce the dependency order:
|
|
139
|
+
- Before `fulfilment`: verify `core` is installed
|
|
140
|
+
- Before `order`: verify `core` AND `fulfilment` are installed
|
|
141
|
+
- Before `inventory`: verify `core` is installed
|
|
142
|
+
- Before custom extensions: verify all declared dependencies from `module.json` are installed
|
|
143
|
+
|
|
144
|
+
### Step 4: Generate Configuration (if needed)
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
fluent module config <module-source> \
|
|
148
|
+
--retailer <retailer-ref> \
|
|
149
|
+
--profile <profile-name>
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
Output: `module.config.<retailer>.<module-name>.json`
|
|
153
|
+
|
|
154
|
+
**Check for unreplaced tokens:**
|
|
155
|
+
```bash
|
|
156
|
+
rg '\[\[.*\]\]' module.config.*.json
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
```powershell
|
|
160
|
+
# PowerShell
|
|
161
|
+
Select-String -Path "module.config.*.json" -Pattern '\[\[.*\]\]'
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
### Step 5: Install Module
|
|
165
|
+
|
|
166
|
+
**Basic installation:**
|
|
167
|
+
```bash
|
|
168
|
+
fluent module install <module-source> \
|
|
169
|
+
--retailer <retailer-ref> \
|
|
170
|
+
--profile <profile-name>
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
**With configuration:**
|
|
174
|
+
```bash
|
|
175
|
+
fluent module install <module-source> \
|
|
176
|
+
--config module.config.<retailer>.<module>.json \
|
|
177
|
+
--retailer <retailer-ref> \
|
|
178
|
+
--profile <profile-name>
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
**With filters:**
|
|
182
|
+
```bash
|
|
183
|
+
# Exclude workflows (useful for multi-retailer installs to avoid overwriting customizations)
|
|
184
|
+
fluent module install <module> \
|
|
185
|
+
--exclude workflows \
|
|
186
|
+
--retailer <retailer-ref> \
|
|
187
|
+
--profile <profile-name>
|
|
188
|
+
|
|
189
|
+
# Exclude multiple asset types
|
|
190
|
+
fluent module install <module> \
|
|
191
|
+
--exclude workflows \
|
|
192
|
+
--exclude settings \
|
|
193
|
+
--retailer <retailer-ref> \
|
|
194
|
+
--profile <profile-name>
|
|
195
|
+
|
|
196
|
+
# Include only a specific workflow
|
|
197
|
+
fluent module install <module> \
|
|
198
|
+
--include workflows/fc-workflow-order-hd.json \
|
|
199
|
+
--retailer <retailer-ref> \
|
|
200
|
+
--profile <profile-name>
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Filter paths match the module ZIP structure. Common filterable assets:
|
|
204
|
+
- `workflows` — all workflow JSON files
|
|
205
|
+
- `settings` — all Fluent Settings
|
|
206
|
+
- `rules` — plugin JARs
|
|
207
|
+
- `workflows/<specific-file>.json` — single workflow
|
|
208
|
+
|
|
209
|
+
**Force reinstall:**
|
|
210
|
+
```bash
|
|
211
|
+
fluent module install <module> --force \
|
|
212
|
+
--retailer <retailer-ref> \
|
|
213
|
+
--profile <profile-name>
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Step 6: Verify Installation
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
# Check module installed
|
|
220
|
+
fluent module list -p <profile-name>
|
|
221
|
+
|
|
222
|
+
# Check workflows deployed
|
|
223
|
+
fluent workflow list -p <profile-name> -r <retailer-ref>
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
## Common Module Sources
|
|
227
|
+
|
|
228
|
+
| Type | Example |
|
|
229
|
+
|------|---------|
|
|
230
|
+
| Reference | `core`, `order`, `fulfilment`, `inventory` |
|
|
231
|
+
| URL | `https://downloads.fluentcommerce.com/v1.0.0/modules/fcx/b2c-sample-data/latest` |
|
|
232
|
+
| Local | `dist/my-module-1.0.0/`, `./my-extension.zip` |
|
|
233
|
+
|
|
234
|
+
## Error Handling
|
|
235
|
+
|
|
236
|
+
| Error | Solution |
|
|
237
|
+
|-------|----------|
|
|
238
|
+
| No active profile | `fluent profile use <name> --retailer <ref>` |
|
|
239
|
+
| Module not found | Check spelling, verify path exists |
|
|
240
|
+
| Dependencies not met | Install required modules first |
|
|
241
|
+
| Config missing keys | Edit config file, add missing values |
|
|
242
|
+
| Module already installed | Use `--force` to reinstall |
|
|
243
|
+
| Workflow conflicts | Use `--exclude workflows` |
|
|
244
|
+
|
|
245
|
+
## Version Bumping (Custom Modules)
|
|
246
|
+
|
|
247
|
+
**Any content change requires a version bump** — Java code, workflow JSONs, settings, or resources. Deploying the same version number results in `"already uploaded: Active - nothing more to do"` for the plugin JAR, and makes it impossible to track which version introduced a change.
|
|
248
|
+
|
|
249
|
+
### When to Bump
|
|
250
|
+
|
|
251
|
+
| Changed | Bump Required? | Reason |
|
|
252
|
+
|---------|---------------|--------|
|
|
253
|
+
| Java rule code | **YES** | JAR filename includes version; CLI skips upload if same version exists |
|
|
254
|
+
| Workflow JSON in `resources/workflows/` | **YES** | Module version is the audit trail for what's deployed |
|
|
255
|
+
| Settings in `resources/assets/settings/` | **YES** | Traceability — which version introduced the setting |
|
|
256
|
+
| Any file in `resources/` | **YES** | Everything is packaged into the versioned ZIP |
|
|
257
|
+
| Re-deploy unchanged content | NO | Use `--force` flag if re-install is truly needed |
|
|
258
|
+
|
|
259
|
+
### Files to Keep in Sync
|
|
260
|
+
|
|
261
|
+
For **extension modules** (with Java plugins), bump ALL of these:
|
|
262
|
+
|
|
263
|
+
1. `resources/module.json` (`"version"` field)
|
|
264
|
+
2. Parent `plugins/pom.xml` (top-level `<version>`)
|
|
265
|
+
3. Each child module `pom.xml` (`types/`, `util/`, `rules/`)
|
|
266
|
+
|
|
267
|
+
**All must match.** The CLI uses `module.json` version for the module-level check, while Maven uses the POM version for the JAR filename (`fc-module-<name>-<VERSION>.jar`). A mismatch causes the JAR upload to be silently skipped while the module version appears bumped.
|
|
268
|
+
|
|
269
|
+
For **data modules** (no plugins), only `resources/module.json` needs bumping.
|
|
270
|
+
|
|
271
|
+
### Bump Procedure
|
|
272
|
+
|
|
273
|
+
```bash
|
|
274
|
+
# 1. Bump module.json (edit manually or via script)
|
|
275
|
+
# 2. Bump all POM files in one command:
|
|
276
|
+
cd plugins/ && mvn versions:set -DnewVersion=<NEW_VERSION> -DgenerateBackupPoms=false
|
|
277
|
+
|
|
278
|
+
# 3. Verify no files still reference the old version:
|
|
279
|
+
grep -r "<OLD_VERSION>" plugins/*/pom.xml resources/module.json
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
After bumping, rebuild with Maven and repackage via the module build script.
|
|
283
|
+
|
|
284
|
+
## Config Token Reference
|
|
285
|
+
|
|
286
|
+
Common `[[placeholder]]` tokens in module config files:
|
|
287
|
+
|
|
288
|
+
| Token | Description | Example |
|
|
289
|
+
|-------|-------------|---------|
|
|
290
|
+
| `[[retailer.id]]` | Target retailer's numeric ID | `5` |
|
|
291
|
+
| `[[productCatalogue.ref]]` | Product catalogue reference | `PC:MASTER:5` |
|
|
292
|
+
| `[[network.ref.hd]]` | HD fulfilment network | `B2C_HD_1` |
|
|
293
|
+
| `[[network.ref.cc]]` | CC fulfilment network | `B2C_CC_1` |
|
|
294
|
+
| `[[virtualCatalogue.ref]]` | Virtual catalogue | `BASE:1` |
|
|
295
|
+
| `[[inventoryCatalogue.ref]]` | Inventory catalogue | `DEFAULT:1` |
|
|
296
|
+
| `[[order.validation.gracePeriodSeconds]]` | Grace period timeout | `3600` |
|
|
297
|
+
|
|
298
|
+
**Check for unreplaced tokens before deploying:**
|
|
299
|
+
```bash
|
|
300
|
+
rg '\[\[.*\]\]' module.config.*.json
|
|
301
|
+
```
|
|
302
|
+
|
|
303
|
+
```powershell
|
|
304
|
+
# PowerShell
|
|
305
|
+
Select-String -Path "module.config.*.json" -Pattern '\[\[.*\]\]'
|
|
306
|
+
```
|
|
307
|
+
|
|
308
|
+
## Config Prefix System
|
|
309
|
+
|
|
310
|
+
Module config files use a prefix system to scope variable values:
|
|
311
|
+
|
|
312
|
+
| Prefix | Applies To | Example |
|
|
313
|
+
|--------|-----------|---------|
|
|
314
|
+
| `default:` | All assets (workflows, settings, data) | `"default:carrier.ref": "CARRIER_STD"` |
|
|
315
|
+
| `workflow:<type>:<subtype>:` | Specific workflow only | `"workflow:order:hd:network.ref": "NET_HD"` |
|
|
316
|
+
| `setting:` | Settings only | `"setting:mySettingKey": "value"` |
|
|
317
|
+
|
|
318
|
+
**Specificity rules:** More colons = higher specificity = wins. For `ORDER::HD`, the key `workflow:order:hd:network.ref` (2 levels) overrides `workflow:order:network.ref` (1 level) which overrides `default:network.ref` (0 levels).
|
|
319
|
+
|
|
320
|
+
**Built-in auto-injected variables** (no config needed): `account.id`, `retailer.id`, `retailer.ref`, `retailer.name`.
|
|
321
|
+
|
|
322
|
+
**Unresolved tokens** are left as-is -- the CLI does not error on missing variable values during substitution. Always scan for `[[...]]` tokens before deploying.
|
|
323
|
+
|
|
324
|
+
## Post-Deploy: Workflow Deployment
|
|
325
|
+
|
|
326
|
+
After deploying a module that includes new custom rules, workflows referencing those rules can now be deployed:
|
|
327
|
+
|
|
328
|
+
1. Use `/fluent-workflow-deploy` to upload individual workflow definitions
|
|
329
|
+
2. Or include workflows in the module itself (`resources/assets/workflows/`)
|
|
330
|
+
3. Verify rules are registered: `plugin.list({ name: "<RuleName>" })`
|
|
331
|
+
|
|
332
|
+
**Deployment order:** Module (registers rules) -> Workflows (reference rules) -> Settings (referenced by rules) -> E2E test
|
|
333
|
+
|
|
334
|
+
## Best Practices
|
|
335
|
+
|
|
336
|
+
1. **Always verify active profile** before installing
|
|
337
|
+
2. **Verify CLI is available** (`fluent --version`) before any deployment
|
|
338
|
+
3. **Test in dev** before promoting to production
|
|
339
|
+
4. **Use `--exclude workflows`** for multi-retailer installations
|
|
340
|
+
5. **Generate fresh config** for each environment
|
|
341
|
+
6. **Check dependencies** before installation (especially reference module order)
|
|
342
|
+
7. **Bump version** for every custom module redeploy
|
|
343
|
+
8. **Check for unreplaced `[[...]]` tokens** before deploying config
|
|
344
|
+
9. **Run `/fluent-module-validate`** before deploying local modules
|
|
345
|
+
10. **Deploy module before workflows** if workflows reference new custom rules
|
|
346
|
+
|
|
347
|
+
## Rollback
|
|
348
|
+
|
|
349
|
+
To rollback a module deployment, redeploy the previous version of the module ZIP. The Fluent CLI does not have a built-in rollback command -- keep previous module ZIPs archived for recovery.
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fluent-profile
|
|
3
|
+
description: Manage Fluent CLI profiles for connecting to Fluent Commerce accounts. Use for creating, updating, switching, listing, or exporting profiles. Triggers on "create profile", "switch profile", "list profiles", "export profile", "fluent profile".
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash, Read, Write, Edit, Glob, Grep
|
|
6
|
+
argument-hint: <operation> [profile-name]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Profile Management
|
|
10
|
+
|
|
11
|
+
Manage Fluent CLI profiles for connecting to Fluent Commerce accounts.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
|
|
15
|
+
- Creating new connection to Fluent account
|
|
16
|
+
- Switching between environments (dev/UAT/prod)
|
|
17
|
+
- Exporting credentials for Postman
|
|
18
|
+
- Managing multiple accounts
|
|
19
|
+
|
|
20
|
+
## Quick Reference
|
|
21
|
+
|
|
22
|
+
| Command | Purpose |
|
|
23
|
+
|---------|---------|
|
|
24
|
+
| `fluent profile create` | Create new profile |
|
|
25
|
+
| `fluent profile list` | List all profiles |
|
|
26
|
+
| `fluent profile use` | Set active profile |
|
|
27
|
+
| `fluent profile active` | Show current profile |
|
|
28
|
+
| `fluent profile update` | Modify profile |
|
|
29
|
+
| `fluent profile export` | Export for Postman |
|
|
30
|
+
| `fluent profile clear` | Clear active context |
|
|
31
|
+
|
|
32
|
+
## Operations
|
|
33
|
+
|
|
34
|
+
### 1. Create Profile
|
|
35
|
+
|
|
36
|
+
**Required information:**
|
|
37
|
+
- Profile name (e.g., `cli-b2c`, `prod-au`)
|
|
38
|
+
- Account ID
|
|
39
|
+
- Base URL
|
|
40
|
+
- Username & password
|
|
41
|
+
- Client secret
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
fluent profile create <profile-name> \
|
|
45
|
+
--id <account-id> \
|
|
46
|
+
--base-url <base-url> \
|
|
47
|
+
--username <username> \
|
|
48
|
+
--password <password> \
|
|
49
|
+
--client-secret <client-secret>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
**Example:**
|
|
53
|
+
```bash
|
|
54
|
+
fluent profile create cli-b2c \
|
|
55
|
+
--id ABC123 \
|
|
56
|
+
--base-url https://abc123.sandbox.api.fluentretail.com \
|
|
57
|
+
--username admin_user \
|
|
58
|
+
--password secret123 \
|
|
59
|
+
--client-secret abc123xyz
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### 2. List Profiles
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
fluent profile list
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Output:**
|
|
69
|
+
```
|
|
70
|
+
PROFILE NAME ACCOUNT ID BASE URL
|
|
71
|
+
cli-b2c ABC123 https://abc123.sandbox.api.fluentretail.com
|
|
72
|
+
prod-au XYZ789 https://xyz789.api.fluentretail.com
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### 3. Set Active Profile
|
|
76
|
+
|
|
77
|
+
**Profile only:**
|
|
78
|
+
```bash
|
|
79
|
+
fluent profile use <profile-name>
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Profile + retailer:**
|
|
83
|
+
```bash
|
|
84
|
+
fluent profile use <profile-name> --retailer <retailer-ref>
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### 4. Check Active Profile
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
fluent profile active
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Output:**
|
|
94
|
+
```
|
|
95
|
+
Active profile: cli-b2c
|
|
96
|
+
Active retailer: b2c
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 5. Update Profile
|
|
100
|
+
|
|
101
|
+
**Add user:**
|
|
102
|
+
```bash
|
|
103
|
+
fluent profile update <profile-name> \
|
|
104
|
+
--username <new-username> \
|
|
105
|
+
--password <new-password>
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Add retailer:**
|
|
109
|
+
```bash
|
|
110
|
+
fluent profile update <profile-name> \
|
|
111
|
+
--retailer <retailer-ref> \
|
|
112
|
+
--id <retailer-id> \
|
|
113
|
+
--username <retailer-admin> \
|
|
114
|
+
--password <password>
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Switch active user:**
|
|
118
|
+
```bash
|
|
119
|
+
fluent profile update <profile-name> --user <username>
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
### 6. Export Profile (Postman)
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
fluent profile export <profile-name> \
|
|
126
|
+
--format postman \
|
|
127
|
+
--retailer <retailer-ref>
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
**Output:** `postman.<profile>.<retailer>.environment.json`
|
|
131
|
+
|
|
132
|
+
**Import into Postman:**
|
|
133
|
+
1. Open Postman -> Environments -> Import
|
|
134
|
+
2. Select exported file
|
|
135
|
+
3. Environment ready for API testing
|
|
136
|
+
|
|
137
|
+
### 7. Clear Active Profile
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
fluent profile clear
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
### 8. Purge Sessions
|
|
144
|
+
|
|
145
|
+
Clean up old session files:
|
|
146
|
+
```bash
|
|
147
|
+
fluent profile purge-sessions
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## Profile Storage
|
|
151
|
+
|
|
152
|
+
Profiles stored in: `~/.fluentcommerce/<profile-name>/`
|
|
153
|
+
|
|
154
|
+
```
|
|
155
|
+
~/.fluentcommerce/
|
|
156
|
+
├── cli-b2c/
|
|
157
|
+
│ ├── profile.json
|
|
158
|
+
│ ├── user.admin_user.json
|
|
159
|
+
│ └── retailer.b2c.json
|
|
160
|
+
└── .sessions/
|
|
161
|
+
└── <session-files>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
## Error Handling
|
|
165
|
+
|
|
166
|
+
| Error | Solution |
|
|
167
|
+
|-------|----------|
|
|
168
|
+
| Profile already exists | Use different name or update existing |
|
|
169
|
+
| Profile not found | Check name with `profile list` |
|
|
170
|
+
| Authentication failed | Verify credentials, update profile |
|
|
171
|
+
| No active profile | Use `profile use <name>` |
|
|
172
|
+
| Retailer not found | Add with `profile update` |
|
|
173
|
+
|
|
174
|
+
## Security Best Practices
|
|
175
|
+
|
|
176
|
+
1. **Never log passwords** - Use `[REDACTED]` in any output
|
|
177
|
+
2. **Protect profile directory** - `~/.fluentcommerce/` contains credentials
|
|
178
|
+
3. **Environment-specific profiles** - Don't mix dev/prod
|
|
179
|
+
4. **Handle exports carefully** - Postman files contain plain-text credentials
|
|
180
|
+
5. **Rotate credentials regularly** - Update profiles with new passwords
|