@fluentcommerce/ai-skills 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +622 -0
  3. package/bin/cli.mjs +1973 -0
  4. package/content/cli/agents/fluent-cli/agent.json +149 -0
  5. package/content/cli/agents/fluent-cli.md +132 -0
  6. package/content/cli/skills/fluent-bootstrap/SKILL.md +181 -0
  7. package/content/cli/skills/fluent-cli-index/SKILL.md +63 -0
  8. package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +77 -0
  9. package/content/cli/skills/fluent-cli-reference/SKILL.md +1031 -0
  10. package/content/cli/skills/fluent-cli-retailer/SKILL.md +85 -0
  11. package/content/cli/skills/fluent-cli-settings/SKILL.md +106 -0
  12. package/content/cli/skills/fluent-connect/SKILL.md +886 -0
  13. package/content/cli/skills/fluent-module-deploy/SKILL.md +349 -0
  14. package/content/cli/skills/fluent-profile/SKILL.md +180 -0
  15. package/content/cli/skills/fluent-workflow/SKILL.md +310 -0
  16. package/content/dev/agents/fluent-dev/agent.json +88 -0
  17. package/content/dev/agents/fluent-dev.md +525 -0
  18. package/content/dev/reference-modules/catalog.json +4754 -0
  19. package/content/dev/skills/fluent-build/SKILL.md +192 -0
  20. package/content/dev/skills/fluent-connection-analysis/SKILL.md +386 -0
  21. package/content/dev/skills/fluent-custom-code/SKILL.md +895 -0
  22. package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +714 -0
  23. package/content/dev/skills/fluent-e2e-test/SKILL.md +394 -0
  24. package/content/dev/skills/fluent-event-api/SKILL.md +945 -0
  25. package/content/dev/skills/fluent-feature-explain/SKILL.md +603 -0
  26. package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +695 -0
  27. package/content/dev/skills/fluent-feature-plan/SKILL.md +227 -0
  28. package/content/dev/skills/fluent-job-batch/SKILL.md +138 -0
  29. package/content/dev/skills/fluent-mermaid-validate/SKILL.md +86 -0
  30. package/content/dev/skills/fluent-module-scaffold/SKILL.md +1928 -0
  31. package/content/dev/skills/fluent-module-validate/SKILL.md +775 -0
  32. package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1108 -0
  33. package/content/dev/skills/fluent-retailer-config/SKILL.md +1111 -0
  34. package/content/dev/skills/fluent-rule-scaffold/SKILL.md +385 -0
  35. package/content/dev/skills/fluent-scope-decompose/SKILL.md +1021 -0
  36. package/content/dev/skills/fluent-session-audit-export/SKILL.md +632 -0
  37. package/content/dev/skills/fluent-session-summary/SKILL.md +195 -0
  38. package/content/dev/skills/fluent-settings/SKILL.md +1058 -0
  39. package/content/dev/skills/fluent-source-onboard/SKILL.md +632 -0
  40. package/content/dev/skills/fluent-system-monitoring/SKILL.md +767 -0
  41. package/content/dev/skills/fluent-test-data/SKILL.md +513 -0
  42. package/content/dev/skills/fluent-trace/SKILL.md +1143 -0
  43. package/content/dev/skills/fluent-transition-api/SKILL.md +346 -0
  44. package/content/dev/skills/fluent-version-manage/SKILL.md +744 -0
  45. package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +959 -0
  46. package/content/dev/skills/fluent-workflow-builder/SKILL.md +319 -0
  47. package/content/dev/skills/fluent-workflow-deploy/SKILL.md +267 -0
  48. package/content/mcp-extn/agents/fluent-mcp.md +69 -0
  49. package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +461 -0
  50. package/content/mcp-official/agents/fluent-mcp-core.md +91 -0
  51. package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -0
  52. package/content/rfl/agents/fluent-rfl.md +56 -0
  53. package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -0
  54. package/docs/CAPABILITY_MAP.md +77 -0
  55. package/docs/CLI_COVERAGE.md +47 -0
  56. package/docs/DEV_WORKFLOW.md +802 -0
  57. package/docs/FLOW_RUN.md +142 -0
  58. package/docs/USE_CASES.md +404 -0
  59. package/metadata.json +156 -0
  60. package/package.json +51 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Fluent Commerce
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,622 @@
1
+ # @fluentcommerce/ai-skills
2
+
3
+ [![npm version](https://img.shields.io/npm/v/@fluentcommerce/ai-skills.svg)](https://www.npmjs.com/package/@fluentcommerce/ai-skills)
4
+ [![license](https://img.shields.io/npm/l/@fluentcommerce/ai-skills.svg)](https://opensource.org/licenses/MIT)
5
+ [![node](https://img.shields.io/node/v/@fluentcommerce/ai-skills.svg)](https://nodejs.org/)
6
+
7
+ > **Alpha** — This package is under active development. Skill content, CLI options, and supported targets may change between releases without notice. Use in non-production environments and pin to a specific version if stability matters.
8
+
9
+ Modular [Fluent Commerce](https://fluentcommerce.com) AI skill packs for coding assistants.
10
+ Install all groups, or only what each project needs.
11
+
12
+ **What this does:** AI coding assistants (Claude Code, Cursor, Copilot, etc.) are general-purpose — they don't know Fluent Commerce. This package injects Fluent-specific domain knowledge (workflows, events, rules, GraphQL patterns, CLI commands, deployment procedures) into your assistant so it can analyze workflows, scaffold rules, run E2E tests, debug failed events, and manage settings — all through natural language.
13
+
14
+ **New here?** See [What Can You Do With Fluent AI Skills?](docs/USE_CASES.md) for scenario-based examples — from debugging stuck orders to building new workflows to go-live readiness checks.
15
+
16
+ **What is a "skill"?** A skill is a structured instruction file that teaches the AI how to perform a specific Fluent task. For example, `/fluent-workflow-analyzer` teaches the AI how to read workflow JSON, map status graphs, detect orphaned rulesets, and generate Mermaid diagrams. Skills are installed into your assistant's native format (Claude agents/skills, Cursor rules, Copilot instructions, etc.).
17
+
18
+ ## What Can You Do?
19
+
20
+ | Persona | Example prompt | What happens |
21
+ |---------|---------------|-------------|
22
+ | New developer | "Explain how Home Delivery works" | Feature Architecture Document with diagrams, rules, settings |
23
+ | Debugging | "Why is order HD-001 stuck?" | Event forensics, NO_MATCH analysis, remediation options |
24
+ | Building | "Build an ORDER::RETURN workflow" | Plan mode → state machine → rulesets → deploy → E2E test |
25
+ | Pre-go-live | "Run a Ready For Launch assessment" | Scored report across workflows, rules, settings, integrations |
26
+ | Ops | "Show event failure rates for the last hour" | Metrics anomaly detection with threshold alerts |
27
+
28
+ See [full scenario guide](docs/USE_CASES.md) for 11 detailed walkthroughs.
29
+
30
+ ## Quick Start
31
+
32
+ ```bash
33
+ # Install all skill groups (default target: Claude Code)
34
+ npx @fluentcommerce/ai-skills install
35
+
36
+ # Configure MCP server entries for your project
37
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE
38
+
39
+ # Verify what's installed
40
+ npx @fluentcommerce/ai-skills status
41
+ ```
42
+
43
+ ### Quick Start by Target
44
+
45
+ Run from your project root:
46
+
47
+ Primary target is **Claude**. The adapters below are **beta**.
48
+
49
+ ```bash
50
+ # Cursor
51
+ npx @fluentcommerce/ai-skills install --target cursor
52
+ npx @fluentcommerce/ai-skills status --target cursor
53
+
54
+ # VS Code (Copilot instructions format)
55
+ npx @fluentcommerce/ai-skills install --target vscode
56
+ npx @fluentcommerce/ai-skills status --target vscode
57
+
58
+ # GitHub Copilot
59
+ npx @fluentcommerce/ai-skills install --target copilot
60
+ npx @fluentcommerce/ai-skills status --target copilot
61
+
62
+ # Windsurf
63
+ npx @fluentcommerce/ai-skills install --target windsurf
64
+ npx @fluentcommerce/ai-skills status --target windsurf
65
+
66
+ # Codex
67
+ npx @fluentcommerce/ai-skills install --target codex
68
+ npx @fluentcommerce/ai-skills status --target codex
69
+
70
+ # Gemini CLI
71
+ npx @fluentcommerce/ai-skills install --target gemini
72
+ npx @fluentcommerce/ai-skills status --target gemini
73
+ ```
74
+
75
+ Tip: to keep instruction size lighter, install only needed groups (for example `npx @fluentcommerce/ai-skills install --target cursor cli mcp-extn`).
76
+
77
+ ## Requirements
78
+
79
+ - Node.js 18+
80
+ - Fluent CLI (`npm i -g @fluentcommerce/cli`) — needed for official MCP server
81
+
82
+ ## Supported Targets
83
+
84
+ Skills install into your coding assistant's native format:
85
+
86
+ | Target | Output location | Scope | Status |
87
+ |---|---|---|---|
88
+ | `claude` (default) | `~/.claude/agents/` + `~/.claude/skills/` | Global (shared across projects) | **Primary** |
89
+ | `cursor` | `.cursor/rules/*.mdc` | Project | Beta |
90
+ | `copilot` | `.github/copilot-instructions.md` | Project | Beta |
91
+ | `vscode` | `.github/copilot-instructions.md` (alias of `copilot`) | Project | Beta |
92
+ | `windsurf` | `.windsurfrules` | Project | Beta |
93
+ | `codex` | `AGENTS.md` | Project | Beta |
94
+ | `gemini` | `GEMINI.md` | Project | Beta |
95
+
96
+ > Claude Code is the primary target with full support (agents, skills, slash commands, MCP integration). Other targets receive the same domain knowledge as merged instruction content and are tested where possible, but may have limited functionality compared to Claude Code.
97
+
98
+ ```bash
99
+ # Install for a specific target
100
+ npx @fluentcommerce/ai-skills install --target cursor
101
+
102
+ # Install specific groups only
103
+ npx @fluentcommerce/ai-skills install --target copilot cli mcp-extn
104
+ ```
105
+
106
+ For non-Claude targets, the installer writes a managed block (`<!-- fluent-ai-skills:start --> ... <!-- fluent-ai-skills:end -->`). Uninstall removes only managed content and preserves anything else in the file.
107
+
108
+ ## Available Groups
109
+
110
+ | Group | What it provides | Claude Code slash commands |
111
+ |---|---|---|
112
+ | `cli` | Fluent CLI command-family coverage (index routing, reference, account connect, profile, retailer, settings, modules, workflows, MCP/CI-CD, bootstrap) | `/fluent-cli-index` `/fluent-cli-reference` `/fluent-connect` `/fluent-cli-mcp-cicd` `/fluent-bootstrap` `/fluent-cli-retailer` `/fluent-cli-settings` `/fluent-module-deploy` `/fluent-profile` `/fluent-workflow` |
113
+ | `mcp-official` | Official Fluent CLI MCP server operations | `/fluent-mcp-core` |
114
+ | `mcp-extn` | Extension MCP tools (events, transitions, GraphQL, metrics, batch) | `/fluent-mcp-tools` |
115
+ | `rfl` | Ready For Launch assessments | `/fluent-rfl-assess` |
116
+ | `dev` | Feature planning (with universal NEW/EXISTING/MODIFIED/REUSED/OOTB classification), workflow builder, workflow deploy, analyzer, connection analysis (with `--validate` static-vs-dynamic comparison and cross-entity event tracing), custom code analysis, transition API, rule scaffold, module scaffold, data module scaffold, source onboarding, module validation, build, version management, trace, event API (model + causality analysis), system monitoring, batch ingestion, E2E, test data, settings (with Phase 2B value format validation and cascading scope resolution), environment setup, pre-deploy checks, session summary, session audit export, scope decomposition, feature explanation, Mermaid diagram validation | `/fluent-feature-plan` `/fluent-workflow-builder` `/fluent-workflow-deploy` `/fluent-workflow-analyzer` `/fluent-connection-analysis` `/fluent-custom-code` `/fluent-transition-api` `/fluent-rule-scaffold` `/fluent-module-scaffold` `/fluent-data-module-scaffold` `/fluent-source-onboard` `/fluent-module-validate` `/fluent-build` `/fluent-version-manage` `/fluent-trace` `/fluent-event-api` `/fluent-system-monitoring` `/fluent-job-batch` `/fluent-e2e-test` `/fluent-test-data` `/fluent-settings` `/fluent-retailer-config` `/fluent-session-summary` `/fluent-scope-decompose` `/fluent-pre-deploy-check` `/fluent-session-audit-export` `/fluent-feature-explain` |
117
+
118
+ > Slash commands are Claude Code specific. Other targets receive the same knowledge as merged instruction content.
119
+
120
+ For detailed command-family and guide-section coverage status (`full/partial/missing`), see [docs/CLI_COVERAGE.md](docs/CLI_COVERAGE.md).
121
+
122
+ ### Group Aliases
123
+
124
+ | Alias | Resolves to |
125
+ |---|---|
126
+ | `mcp` | `mcp-extn` |
127
+ | `extn` | `mcp-extn` |
128
+ | `extension` | `mcp-extn` |
129
+ | `mcp-core` | `mcp-official` |
130
+ | `official` | `mcp-official` |
131
+
132
+ ## Autonomous Development Workflow
133
+
134
+ The `dev` skill group enables AI agents to run a full closed-loop development lifecycle with a mandatory planning gate:
135
+
136
+ ```
137
+ ANALYZE → EXPLAIN (if requested) or PLAN → [USER APPROVAL] → IMPLEMENT → BUILD → DEPLOY → TEST → DIAGNOSE → FIX → (loop back)
138
+ ```
139
+
140
+ After analysis, the agent presents a structured implementation plan (workflow changes, settings, rules, Mermaid diagrams, risk assessment, test plan) and waits for explicit user approval before making changes. The agent then continues iterating until all E2E tests pass or an unresolvable blocker is hit.
141
+
142
+ Event API source docs are curated into skills via selective extraction; they are not mirrored wholesale.
143
+
144
+ | Phase | Skill / Command | What the agent does |
145
+ |-------|----------------|---------------------|
146
+ | Analyze | `/fluent-workflow-analyzer`, `/fluent-connection-analysis` | Map status graphs, trace event chains, detect orphans, verify connectivity; `--validate` mode compares static workflow paths with runtime events, traces cross-entity propagation, and produces timing analysis |
147
+ | Custom code analysis | `/fluent-custom-code` | Scan custom source, generate reusable analysis artifacts (source-map, workflow-rule-map, constraints, behavior-map, extension-plan) |
148
+ | Discover | `/fluent-transition-api` | Query available user actions at each status, map required attributes |
149
+ | Scope decomposition | `/fluent-scope-decompose` | Parse scope documents into ordered task lists with dependency DAG, skill mappings, and ambiguity detection |
150
+ | Feature plan | `/fluent-feature-plan` | Produce comprehensive implementation plan with universal source classification (NEW/EXISTING/MODIFIED/REUSED/OOTB) across all artifacts — rules, workflows, settings, webhooks, cross-entity flows, deployment sequence |
151
+ | Plan & Approve | *(check gate)* | Present structured implementation plan (workflows, settings, rules, Mermaid diagrams, risks, test plan). **Wait for user approval.** |
152
+ | Implement | `/fluent-workflow-builder`, `/fluent-rule-scaffold` | Edit workflow JSON, scaffold Java rules, update settings |
153
+ | Scaffold module | `/fluent-module-scaffold` | Generate complete Maven module skeleton (POMs, module.json, rule classes, build scripts) |
154
+ | Onboard source | `/fluent-source-onboard` | Restructure existing Java source (loose files, decompiled JARs, non-standard layouts) into proper Fluent module format; validate and build |
155
+ | Validate | `/fluent-module-validate` | Check module structure, version consistency, rule wiring, test coverage; cached report with content hash |
156
+ | Version | `/fluent-version-manage` | Read, bump, sync, and tag versions across POM files, module.json, and CHANGELOG |
157
+ | Build | `/fluent-build` | Version bump, Maven compile, ZIP packaging |
158
+ | Pre-deploy | `/fluent-pre-deploy-check` | 26 quality gates across 8 phases (env, module, workflow, connections, settings, target, risk, completeness) |
159
+ | Deploy module | `/fluent-module-deploy` or `flow-run` | Module install via CLI |
160
+ | Deploy workflow | `/fluent-workflow-deploy` | Workflow upload via MCP tool, REST API fallback, CLI last resort |
161
+ | Test | `/fluent-e2e-test` | Create entities, fire events, poll states, assert transitions |
162
+ | Test data | `/fluent-test-data` | Discover retailer environment and generate valid test entity payloads |
163
+ | Settings | `/fluent-settings` | Manage retailer settings — discover, audit (with Phase 2B value format validation), create/update, migrate; cascading scope resolution (RETAILER -> ACCOUNT) for module-installed settings |
164
+ | Environment | `/fluent-retailer-config` | Configure retailer environments — locations, networks, catalogues, inventory, carriers |
165
+ | Diagnose | `/fluent-trace`, `/fluent-event-api` | Trace failed events, correlate with rulesets, and build causality chains across parent/child events |
166
+ | Fix | (routes back to Implement/Build/Deploy) | Apply fix based on diagnosis, re-test |
167
+ | Explain | `/fluent-feature-explain` | Reverse-engineer existing feature into a Feature Architecture Document with Mermaid diagrams, data flow, and runtime evidence; tiered analysis (plugin.list → decompiled JAR / source code → runtime), auto-discovers entities, JAR decompilation fallback, Analysis Confidence section; saved to `accounts/<PROFILE>/analysis/features/` |
168
+ | Audit | `/fluent-session-summary`, `/fluent-session-audit-export` | Track all changes made during session; export machine-readable JSON audit trail |
169
+
170
+ Artifacts from custom code analysis are written to `accounts/<PROFILE>/analysis/custom-code/` and reused by other skills (workflow-analyzer, trace, rule-scaffold, etc.). A `fingerprint.json` file is used to detect input changes and skip re-parsing when nothing changed. Module validation reports are written to `accounts/<PROFILE>/analysis/module-validate/` with a content hash — re-validation is skipped when the module source is unchanged.
171
+
172
+ Account workspace convention — see [Workspace Setup](#workspace-setup) for the full guide.
173
+
174
+ ### Settings Update Quick Recipe
175
+
176
+ For safe setting updates, use this exact flow with `/fluent-settings`:
177
+
178
+ 1. Resolve by `name` + `context/contextId` to fetch `id`, `valueType`, and current value.
179
+ 2. Update by `id` (never guessed) using:
180
+ - `value` for `STRING`/`BOOLEAN`
181
+ - `lobValue` for `LOB`/`JSON`
182
+ 3. Re-query the same `name` + scope and confirm the value changed.
183
+ 4. If no setting exists, create it with the same scope (upsert behavior).
184
+
185
+ See [docs/DEV_WORKFLOW.md](docs/DEV_WORKFLOW.md) for the complete orchestration protocol with decision trees, tool chains, and error recovery patterns.
186
+
187
+ ### Deep Analysis Fallback (Vague Ruleset/Rule Intent)
188
+
189
+ When workflow/ruleset descriptions are too generic to explain behavior confidently, the skills escalate evidence in this order:
190
+
191
+ 1. Ask focused clarification questions (trigger, expected state, actual outcome).
192
+ 2. Request source (`module.json` + Java rule classes).
193
+ 3. If source is unavailable, first check for JAR/ZIP already present under `accounts/<PROFILE>/SOURCE/`, then decompile targeted rule classes.
194
+ 4. Correlate decompiled logic with workflow props and runtime event/log evidence.
195
+
196
+ This keeps end-to-end analysis grounded in executable rule logic rather than names/descriptions only.
197
+
198
+ ## Workspace Setup
199
+
200
+ Skills expect implementation source code, workflows, and analysis artifacts to be organized under an `accounts/` directory in your workspace root, keyed by Fluent CLI profile name.
201
+
202
+ ### Directory Structure
203
+
204
+ ```
205
+ accounts/
206
+ <PROFILE>/ # matches your FLUENT_PROFILE name
207
+ SOURCE/ # account-level, shared across retailers
208
+ <repo-name>/ # git-cloned custom plugin repo
209
+ resources/module.json
210
+ pom.xml
211
+ src/main/java/...
212
+ <reference-module>/ # reference module package (module.json + JAR)
213
+ module.json
214
+ assets/rules/*.jar
215
+ .decompiled/<jar-basename>/ # auto-generated from JAR decompilation
216
+ DECOMPILED.md # marker with source JAR, date, decompiler
217
+ com/fluentcommerce/... # decompiled Java classes
218
+ workflows/ # retailer-scoped workflow definitions
219
+ <RETAILER_REF>/
220
+ ORDER__HD.json
221
+ FULFILMENT__HD_WH.json
222
+ workflow-context.json # download metadata
223
+ analysis/ # generated analysis artifacts
224
+ custom-code/source-map.json
225
+ module-validate/*.report.json
226
+ plans/ # persisted implementation plans (audit trail)
227
+ 2026-02-23-rule-scaffold-curbside-pickup.md
228
+ 2026-02-23-workflow-builder-order-hd-returns.md
229
+ workspace-state.json # cached state for idempotent re-runs
230
+ workspace-index.json # cross-profile index
231
+ ```
232
+
233
+ **Why this layout:**
234
+ - `SOURCE/` is at the profile (account) level because plugin code is deployed per-account and shared across retailers.
235
+ - `workflows/` are scoped by retailer ref inside subdirectories because workflow definitions can differ per retailer.
236
+ - `analysis/` holds generated artifacts that other skills reuse (source maps, module validation reports, etc.).
237
+ - `plans/` stores implementation plans created by the Planning Gate. Each plan is a markdown file with status tracking (`PENDING` → `APPROVED`/`REJECTED`), Mermaid diagrams, file lists, environment impact, tasks, risks, and test plans. Plans persist across sessions for audit trail and re-use.
238
+
239
+ ### Guided Onboarding (`/fluent-connect`)
240
+
241
+ The fastest way to set up a workspace is the guided connect wizard. In Claude Code:
242
+
243
+ ```
244
+ /fluent-connect
245
+ ```
246
+
247
+ Or with explicit arguments to skip interactive selection:
248
+
249
+ ```
250
+ /fluent-connect --profile MYPROFILE --retailer MY_RETAILER
251
+ ```
252
+
253
+ The wizard runs through 5 phases:
254
+
255
+ 1. **Profile Discovery** — scans `~/.fluentcommerce/` for CLI profiles, presents a table with account name and environment tier
256
+ 2. **Retailer Selection** — reads retailer files for the selected profile, asks which retailer to target
257
+ 3. **MCP Wiring** — runs `mcp-setup`, verifies `.mcp.json`, prompts IDE reload, validates connectivity
258
+ 4. **Workspace Readiness** — creates directories, downloads workflows, scans source repos, decompiles JARs if needed, builds a deployed rule inventory by cross-referencing `plugin.list` with local source
259
+ 5. **Persist & Report** — writes `workspace-state.json` (with content hash for caching), updates `workspace-index.json`, prints a readiness report with next-step suggestions
260
+
261
+ Re-running `/fluent-connect` is safe and instant if nothing changed (content hash match). Use `--force` to re-run full discovery.
262
+
263
+ ### Adding Source Code
264
+
265
+ Clone your custom plugin repositories into `accounts/<PROFILE>/SOURCE/`:
266
+
267
+ ```bash
268
+ cd accounts/MYPROFILE/SOURCE
269
+ git clone https://bitbucket.org/yourorg/fc-module-extensions.git
270
+ git clone https://bitbucket.org/yourorg/fc-module-returns.git
271
+ ```
272
+
273
+ Each repo should contain at minimum:
274
+ - `resources/module.json` — module metadata and rule registrations
275
+ - `pom.xml` — Maven build configuration
276
+ - `src/main/java/` — Java rule classes
277
+
278
+ Skills automatically detect repos by searching recursively for `module.json`, `pom.xml`, or `src/main/java/`. Nested directory structures (including double-nested git clone artifacts like `repo/repo/`) are handled.
279
+
280
+ ### Adding JAR Files
281
+
282
+ When original source code is not available, place compiled module JARs directly in `SOURCE/`:
283
+
284
+ ```bash
285
+ cp fc-module-extensions-1.2.3.jar accounts/MYPROFILE/SOURCE/
286
+ ```
287
+
288
+ Skills will:
289
+ 1. Auto-detect JAR files during workspace setup
290
+ 2. Decompile them (using CFR or Fernflower if available) into `SOURCE/.decompiled/<jar-basename>/`
291
+ 3. Extract `module.json` from the JAR if present
292
+ 4. Create a `DECOMPILED.md` marker noting the source JAR, date, and confidence level
293
+
294
+ **Decompiled source is read-only.** Skills can analyze it for rule discovery, behavior explanation, and workflow-rule mapping, but will never suggest editing decompiled files. To modify code, provide original source or scaffold a new module.
295
+
296
+ ### Reference Modules
297
+
298
+ Reference (OOTB) modules that ship as a `module.json` + JAR package can also be placed in `SOURCE/`:
299
+
300
+ ```bash
301
+ cp -r fluent-module-order/ accounts/MYPROFILE/SOURCE/
302
+ # Contains: module.json + assets/rules/*.jar
303
+ ```
304
+
305
+ Skills read rule names, descriptions, and version directly from `module.json` — no decompilation needed for metadata. Decompilation is only triggered if deep analysis of rule implementation logic is requested.
306
+
307
+ ### Adding a New Account
308
+
309
+ ```bash
310
+ # Create the directory structure
311
+ mkdir -p accounts/NEW_PROFILE/SOURCE
312
+ mkdir -p accounts/NEW_PROFILE/workflows
313
+ mkdir -p accounts/NEW_PROFILE/analysis
314
+
315
+ # Clone plugin repos
316
+ cd accounts/NEW_PROFILE/SOURCE
317
+ git clone <repo-url>
318
+
319
+ # Download workflows (after setting up profile)
320
+ fluent workflow download -p NEW_PROFILE -r RETAILER_REF -w all \
321
+ -o accounts/NEW_PROFILE/workflows/RETAILER_REF/
322
+ ```
323
+
324
+ Or let `/fluent-connect` do all of this interactively.
325
+
326
+ ### How Analysis Works
327
+
328
+ Once the workspace is populated, skills build a holistic view of what's deployed:
329
+
330
+ 1. **Live environment** — `plugin.list` queries all registered orchestration rules
331
+ 2. **Local source** — repos with full Java source (modifiable, buildable)
332
+ 3. **Local JARs** — decompiled bytecode (analyzable, read-only)
333
+ 4. **Workflow definitions** — downloaded JSON files
334
+
335
+ Cross-referencing these produces a **deployed rule inventory**:
336
+
337
+ | Status | Meaning | What you can do |
338
+ |--------|---------|-----------------|
339
+ | Full source | Rule class found in a git repo | Analyze, modify, build, redeploy |
340
+ | Decompiled | Rule class found in decompiled JAR | Analyze behavior, cannot modify |
341
+ | Missing | Deployed rule with no local source or JAR | Blind spot — provide source or JAR |
342
+
343
+ This inventory is persisted in `workspace-state.json` and powers downstream skills like `/fluent-custom-code`, `/fluent-workflow-analyzer`, and `/fluent-rfl-assess`.
344
+
345
+ ### .gitignore
346
+
347
+ The `accounts/` directory should be in `.gitignore` — it may contain credentials (via profile references), downloaded workflows, and customer-specific source code:
348
+
349
+ ```gitignore
350
+ accounts/
351
+ ```
352
+
353
+ ## Setup Guide
354
+
355
+ ### Option A — Fastest (no source clone)
356
+
357
+ ```bash
358
+ npx @fluentcommerce/ai-skills install
359
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE
360
+
361
+ # Multi-retailer profile (retailer ref for extension server)
362
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE --profile-retailer YOUR_RETAILER_REF
363
+ ```
364
+
365
+ When `--profile` is provided, both MCP servers are wired with `FLUENT_PROFILE` automatically.
366
+ You can run immediately with profile auth, or override with explicit OAuth/token env vars.
367
+
368
+ For explicit env auth in `.mcp.json`, fill:
369
+
370
+ - `FLUENT_BASE_URL` — your tenant API URL
371
+ - `FLUENT_RETAILER_ID` — target retailer ID
372
+ - `FLUENT_CLIENT_ID` / `FLUENT_CLIENT_SECRET` — OAuth credentials
373
+ - `FLUENT_USERNAME` / `FLUENT_PASSWORD` — user credentials (if using password grant)
374
+ - `FLUENT_PROFILE_RETAILER` — optional retailer ref for profile-scoped user overrides
375
+
376
+ Restart your IDE after editing `.mcp.json`.
377
+
378
+ ### Option B — Extension source clone + local build
379
+
380
+ ```bash
381
+ npx @fluentcommerce/ai-skills mcp-setup --install-extn-source --profile YOUR_PROFILE
382
+ ```
383
+
384
+ This clones the `fluent-mcp-extn` source into your project, builds it, and wires `.mcp.json` to the local build. Use this if you want to debug or customize the extension server.
385
+
386
+ ### Option C — Install from tarball
387
+
388
+ ```bash
389
+ # Create tarball
390
+ cd fluent-ai-skills && npm pack
391
+
392
+ # Install from tarball on any machine
393
+ npx ./fluentcommerce-ai-skills-0.0.1.tgz install
394
+ ```
395
+
396
+ ## End-to-End Validation (Recommended)
397
+
398
+ Validate the full setup path (skills bootstrap -> MCP config -> extension runtime smoke):
399
+
400
+ ```bash
401
+ # 1) Install skills + generate MCP config
402
+ npx @fluentcommerce/ai-skills install
403
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE --profile-retailer YOUR_RETAILER_REF
404
+
405
+ # 2) Verify generated env in .mcp.json (extension server)
406
+ # FLUENT_PROFILE=YOUR_PROFILE
407
+ # FLUENT_PROFILE_RETAILER=YOUR_RETAILER_REF
408
+
409
+ # 3) Run extension end-to-end smoke
410
+ cd fluent-mcp-extn
411
+ npm install
412
+ npm run build
413
+ npm test
414
+ npm run e2e:smoke -- --wizard
415
+ npm run e2e:smoke -- --profile YOUR_PROFILE
416
+ npm run e2e:smoke -- --profile YOUR_PROFILE --retailer YOUR_RETAILER_REF_OR_ID
417
+
418
+ # 4) Optional: run one smoke cycle per profile retailer
419
+ npm run e2e:smoke -- --profile YOUR_PROFILE --all-retailers
420
+ ```
421
+
422
+ This verifies both MCP servers are configured and that `fluent-mcp-extn` can execute real API smoke checks in profile mode.
423
+
424
+ Notes:
425
+ - `--wizard` is for interactive local runs (guided profile/account + retailer selection).
426
+ - `--retailer` accepts retailer ID or retailer ref.
427
+ - CI/non-interactive runs should use explicit flags (`--profile <name> --retailer <id|ref>` or `--profile <name> --all-retailers`).
428
+ - `flow-run` is diagnostics + optional guarded deploy; use `fluent-mcp-extn` smoke for runtime E2E checks.
429
+
430
+ ## CLI Reference
431
+
432
+ ```
433
+ npx @fluentcommerce/ai-skills <command> [--target <target>] [groups...]
434
+ ```
435
+
436
+ | Command | Description |
437
+ |---|---|
438
+ | `install [groups...]` | Install all groups (default) or selected groups |
439
+ | `uninstall [groups...]` | Uninstall all groups or selected groups |
440
+ | `status [groups...]` | Show install status |
441
+ | `list` | List available groups |
442
+ | `mcp-setup [options]` | Generate `.mcp.json` for official + extension MCP servers |
443
+ | `flow-run [options]` | Run diagnostics and optional guarded module deploy |
444
+ | `--version` | Show package version |
445
+ | `--help` | Show help |
446
+
447
+ ### `mcp-setup` Options
448
+
449
+ ```bash
450
+ # Basic — generates .mcp.json with both servers
451
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE
452
+
453
+ # Profile + retailer ref (for fluent-mcp-extn profile-scoped user overrides)
454
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE --profile-retailer YOUR_RETAILER_REF
455
+
456
+ # Clone and build extension source locally
457
+ npx @fluentcommerce/ai-skills mcp-setup --install-extn-source --profile YOUR_PROFILE
458
+
459
+ # Custom source location and repo
460
+ npx @fluentcommerce/ai-skills mcp-setup \
461
+ --install-extn-source \
462
+ --extn-dir tools/fluent-mcp-extn \
463
+ --extn-repo https://bitbucket.org/fluentcommerce/fluent-mcp-extn.git
464
+
465
+ # Custom server names
466
+ npx @fluentcommerce/ai-skills mcp-setup \
467
+ --official-server-name fluent-mcp \
468
+ --extn-server-name fluent-mcp-extn
469
+ ```
470
+
471
+ `--profile-retailer` expects a retailer **ref** (for example `RETAILER_REF`), not retailer ID.
472
+
473
+ ### `flow-run` Options
474
+
475
+ `flow-run` runs pre-deploy diagnostics and optionally deploys a module:
476
+
477
+ ```bash
478
+ # Diagnostics only (no deploy)
479
+ npx @fluentcommerce/ai-skills flow-run \
480
+ --profile YOUR_PROFILE \
481
+ --retailer YOUR_RETAILER \
482
+ --module dist/module.zip \
483
+ --config config/module.config.json
484
+
485
+ # Diagnostics + guarded deploy
486
+ npx @fluentcommerce/ai-skills flow-run \
487
+ --profile YOUR_PROFILE \
488
+ --retailer YOUR_RETAILER \
489
+ --module dist/module.zip \
490
+ --config config/module.config.json \
491
+ --deploy --yes --exclude-workflows
492
+ ```
493
+
494
+ Steps executed: config checks, CLI preflight, module/workflow listing, optional deploy, JSON report.
495
+
496
+ Report output: `./.fluent-ai-skills/flow-run-report-<timestamp>.json`
497
+
498
+ ## Usage Examples
499
+
500
+ ### Claude Code — full install + MCP
501
+
502
+ ```bash
503
+ npx @fluentcommerce/ai-skills install
504
+ npx @fluentcommerce/ai-skills mcp-setup --profile YOUR_PROFILE
505
+ npx @fluentcommerce/ai-skills status
506
+ ```
507
+
508
+ ### Cursor — operations focused
509
+
510
+ ```bash
511
+ cd your-project
512
+ npx @fluentcommerce/ai-skills install --target cursor cli mcp-extn
513
+ npx @fluentcommerce/ai-skills status --target cursor
514
+ ```
515
+
516
+ ### GitHub Copilot — shared repo instructions
517
+
518
+ ```bash
519
+ cd your-project
520
+ npx @fluentcommerce/ai-skills install --target copilot cli rfl
521
+ ```
522
+
523
+ ### Uninstall
524
+
525
+ ```bash
526
+ # Uninstall all groups from default target
527
+ npx @fluentcommerce/ai-skills uninstall
528
+
529
+ # Uninstall specific groups from specific target
530
+ npx @fluentcommerce/ai-skills uninstall --target windsurf cli
531
+ ```
532
+
533
+ ## Size Guidance
534
+
535
+ Single-file targets (`copilot`, `vscode`, `windsurf`, `codex`, `gemini`) concatenate all content into one file. If prompt size becomes a concern, install only the groups you need:
536
+
537
+ ```bash
538
+ npx @fluentcommerce/ai-skills install --target codex cli mcp-extn
539
+ ```
540
+
541
+ ## Advanced
542
+
543
+ ### Override install location
544
+
545
+ For Claude target, override the default `~/.claude/` location:
546
+
547
+ ```bash
548
+ FLUENT_AI_SKILLS_HOME=/custom/path npx @fluentcommerce/ai-skills install
549
+ ```
550
+
551
+ ```powershell
552
+ # PowerShell
553
+ $env:FLUENT_AI_SKILLS_HOME = "C:\custom\path"; npx @fluentcommerce/ai-skills install
554
+ ```
555
+
556
+ ```cmd
557
+ # Windows CMD
558
+ set FLUENT_AI_SKILLS_HOME=C:\custom\path && npx @fluentcommerce/ai-skills install
559
+ ```
560
+
561
+ ### MCP config locations by client
562
+
563
+ | Client | Where to put `.mcp.json` |
564
+ |---|---|
565
+ | Claude Code | Workspace root `.mcp.json` |
566
+ | Cursor | Workspace root `.mcp.json` or `.cursor/mcp.json` |
567
+ | VS Code Copilot | `.vscode/mcp.json` |
568
+ | Windsurf | Workspace/app MCP settings |
569
+
570
+ ## Diagrams
571
+
572
+ ### Install Flow
573
+
574
+ ```mermaid
575
+ flowchart TD
576
+ A["npx @fluentcommerce/ai-skills install"] --> B{"--target"}
577
+ B -->|"claude (default)"| C["~/.claude/agents + ~/.claude/skills"]
578
+ B -->|"cursor"| D[".cursor/rules/*.mdc"]
579
+ B -->|"copilot"| E[".github/copilot-instructions.md"]
580
+ B -->|"vscode"| F[".github/copilot-instructions.md"]
581
+ B -->|"windsurf"| G[".windsurfrules"]
582
+ B -->|"codex"| H["AGENTS.md"]
583
+ B -->|"gemini"| I["GEMINI.md"]
584
+ A --> J{"groups specified?"}
585
+ J -->|"no"| K["install all groups"]
586
+ J -->|"yes"| L["install selected groups only"]
587
+ ```
588
+
589
+ ### flow-run Execution
590
+
591
+ ```mermaid
592
+ flowchart LR
593
+ subgraph Local
594
+ A["Check .mcp.json"]
595
+ B["Scan config placeholders"]
596
+ end
597
+ subgraph CLI
598
+ C["fluent --version"]
599
+ D["fluent profile active"]
600
+ E["fluent module describe/list"]
601
+ F["fluent workflow list"]
602
+ end
603
+ subgraph Deploy
604
+ G{"--deploy --yes?"}
605
+ H["fluent module install"]
606
+ I["post-deploy verify"]
607
+ end
608
+ A --> B --> C --> D --> E --> F --> G
609
+ G -->|"yes"| H --> I
610
+ G -->|"no"| J["write diagnostics report only"]
611
+ ```
612
+
613
+ ## Companion Packages
614
+
615
+ | Package | Purpose |
616
+ |---|---|
617
+ | [`@fluentcommerce/fluent-mcp-extn`](https://www.npmjs.com/package/@fluentcommerce/fluent-mcp-extn) | MCP extension server (events, transitions, GraphQL, metrics, batch, webhooks) |
618
+ | Fluent CLI (`@fluentcommerce/cli`) | Official CLI and built-in MCP server |
619
+
620
+ ## License
621
+
622
+ MIT