@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.
- package/README.md +866 -616
- package/bin/cli.mjs +2112 -1973
- package/content/cli/agents/fluent-cli/agent.json +149 -149
- package/content/cli/agents/fluent-cli.md +132 -132
- package/content/cli/skills/fluent-bootstrap/SKILL.md +214 -190
- package/content/cli/skills/fluent-cli-index/SKILL.md +1 -1
- package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +117 -1
- package/content/cli/skills/fluent-cli-reference/SKILL.md +1040 -623
- package/content/cli/skills/fluent-cli-retailer/SKILL.md +27 -2
- package/content/cli/skills/fluent-cli-settings/SKILL.md +21 -1
- package/content/cli/skills/fluent-connect/SKILL.md +937 -886
- package/content/cli/skills/fluent-module-deploy/SKILL.md +181 -17
- package/content/cli/skills/fluent-profile/SKILL.md +73 -0
- package/content/cli/skills/fluent-workflow/SKILL.md +360 -310
- package/content/dev/agents/fluent-backend-dev/AGENT.md +58 -0
- package/content/dev/agents/fluent-backend-dev/agent.json +69 -0
- package/content/dev/agents/fluent-backend-dev.md +287 -0
- package/content/dev/agents/fluent-dev/AGENT.md +98 -76
- package/content/dev/agents/fluent-dev/agent.json +24 -2
- package/content/dev/agents/fluent-dev.md +194 -524
- package/content/dev/agents/fluent-frontend-dev/AGENT.md +63 -0
- package/content/dev/agents/fluent-frontend-dev/agent.json +52 -0
- package/content/dev/agents/fluent-frontend-dev.md +323 -0
- package/content/dev/skills/fluent-archive/SKILL.md +234 -0
- package/content/dev/skills/fluent-build/SKILL.md +312 -170
- package/content/dev/skills/fluent-connection-analysis/SKILL.md +422 -386
- package/content/dev/skills/fluent-custom-code/SKILL.md +15 -9
- package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +731 -0
- package/content/dev/skills/fluent-e2e-test/SKILL.md +501 -394
- package/content/dev/skills/fluent-event-api/SKILL.md +962 -945
- package/content/dev/skills/fluent-feature-explain/SKILL.md +680 -603
- package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +40 -11
- package/content/dev/skills/fluent-feature-plan/SKILL.md +478 -221
- package/content/dev/skills/fluent-feature-status/SKILL.md +335 -0
- package/content/dev/skills/fluent-feedback/SKILL.md +221 -0
- package/content/dev/skills/fluent-implementation-map/SKILL.md +644 -0
- package/content/dev/skills/fluent-job-batch/SKILL.md +10 -0
- package/content/dev/skills/fluent-module-scaffold/SKILL.md +134 -3
- package/content/dev/skills/fluent-module-validate/SKILL.md +778 -775
- package/content/dev/skills/fluent-mystique-analyze/SKILL.md +817 -0
- package/content/dev/skills/fluent-mystique-builder/COMPONENT_TEMPLATE.md +81 -0
- package/content/dev/skills/fluent-mystique-builder/README.md +63 -0
- package/content/dev/skills/fluent-mystique-builder/SKILL.md +1294 -0
- package/content/dev/skills/fluent-mystique-builder/components/INDEX.md +92 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.accordion.md +48 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.fulfilmentpack.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.multiparcel.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.returnitems.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.wavepick.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.action.inline.md +24 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.activity.entity.md +25 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.analytics.viz.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.column.md +111 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.json.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.jsoneditor.md +54 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.locationId.md +51 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.retailerId.md +52 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.bar.md +57 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.download.md +53 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.compatibility.md +60 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.md +53 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.md +24 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.pick.md +61 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.buttons.add.reject.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.attribute.md +73 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.attributes.grid.md +40 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.image.md +37 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.map.point.md +24 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.multi.md +79 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.card.product.md +27 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.md +34 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.wrapper.feed.md +98 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.md +52 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.wrapper.source.md +104 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.md +28 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.wrapper.threshold.md +118 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.chart.line.md +32 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.conditional.md +62 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.dashboard.threshold.md +65 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.daterange.wrapper.forwarder.md +56 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.drawer.button.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.event.detail.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.events.search.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.field.daterange.md +83 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.field.filterComplex.md +106 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.field.intrange.md +82 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.field.multistring.md +50 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.filterPanel.md +53 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.json.editor.md +22 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.json.viewer.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.list.customAction.md +79 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.list.md +116 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.bppmetrics.md +69 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.feed.md +65 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.source.md +64 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.addItem.md +60 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.mutation.inline.md +88 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.attributes.md +83 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.text.md +33 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.link.md +30 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.order.itemDetails.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.order.shipmentDetails.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.filter.select.md +87 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.md +64 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.refresh.md +48 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.column.md +71 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.header.md +61 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.md +59 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.md +45 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.summary.md +56 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.progress.circular.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.provider.graphql.md +71 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.quantity.list.md +87 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.repeater.md +56 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.reports.ipuipc.md +54 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.return.rowExpansion.md +19 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcode.md +21 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcodeFilter.md +72 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.camera.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.settingForm.md +64 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.drawer.button.md +19 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.modal.button.md +64 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.strategy.modal.button.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.stepper.md +20 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.tab.content.md +56 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.card.md +64 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.md +69 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.tile.metric.md +73 -0
- package/content/dev/skills/fluent-mystique-builder/components/fc.workflow.provider.md +77 -0
- package/content/dev/skills/fluent-mystique-builder/validate-docs.ps1 +260 -0
- package/content/dev/skills/fluent-mystique-scaffold/SKILL.md +1830 -0
- package/content/dev/skills/fluent-mystique-validate/SKILL.md +646 -0
- package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1144 -1090
- package/content/dev/skills/fluent-retailer-config/SKILL.md +1162 -1120
- package/content/dev/skills/fluent-rollback/SKILL.md +387 -0
- package/content/dev/skills/fluent-rule-scaffold/SKILL.md +515 -394
- package/content/dev/skills/fluent-scope-decompose/SKILL.md +1123 -1021
- package/content/dev/skills/fluent-session-audit-export/SKILL.md +880 -632
- package/content/dev/skills/fluent-session-summary/SKILL.md +320 -195
- package/content/dev/skills/fluent-settings/SKILL.md +151 -2
- package/content/dev/skills/fluent-source-onboard/SKILL.md +23 -4
- package/content/dev/skills/fluent-sourcing/SKILL.md +14 -0
- package/content/dev/skills/fluent-system-monitoring/SKILL.md +771 -767
- package/content/dev/skills/fluent-test-data/SKILL.md +514 -513
- package/content/dev/skills/fluent-trace/SKILL.md +1169 -1143
- package/content/dev/skills/fluent-transition-api/SKILL.md +364 -346
- package/content/dev/skills/fluent-use-case-discover/SKILL.md +593 -471
- package/content/dev/skills/fluent-use-case-discover/SPEC_TEMPLATE.md +22 -1
- package/content/dev/skills/fluent-version-manage/SKILL.md +44 -3
- package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +995 -959
- package/content/dev/skills/fluent-workflow-builder/SKILL.md +668 -326
- package/content/dev/skills/fluent-workflow-deploy/SKILL.md +480 -0
- package/content/dev/skills/fluent-workspace-tree/SKILL.md +281 -0
- package/content/mcp-extn/agents/fluent-mcp.md +133 -132
- package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +812 -800
- package/content/mcp-official/agents/fluent-mcp-core.md +91 -91
- package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -94
- package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -172
- package/docs/CAPABILITY_MAP.md +106 -73
- package/docs/DEPLOYMENT_PROMOTION_RUNBOOK.md +218 -0
- package/docs/DESIGN-implementation-map.md +698 -0
- package/docs/DEV_WORKFLOW.md +814 -802
- package/docs/FLOW_RUN.md +142 -142
- package/docs/GETTING_STARTED.md +427 -0
- package/docs/USE_CASES.md +906 -50
- package/metadata.json +184 -155
- package/package.json +7 -2
- package/docs/USE_CASES.pdf +0 -0
|
@@ -0,0 +1,817 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fluent-mystique-analyze
|
|
3
|
+
description: Analyze existing Mystique manifests for component usage patterns, complexity scoring, nesting depth, i18n coverage, query efficiency, and architectural health. Produces Mermaid diagrams and structured reports. Triggers on "analyze manifest", "mystique audit", "ui complexity", "manifest analysis", "component usage", "mystique health".
|
|
4
|
+
user-invocable: true
|
|
5
|
+
allowed-tools: Bash, Read, Write, Edit, Glob, Grep
|
|
6
|
+
argument-hint: <manifest-file-or-directory> [--deep] [--mermaid] [--deployed]
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# Mystique Manifest Analyzer
|
|
10
|
+
|
|
11
|
+
Analyze existing Mystique manifest JSON definitions to understand component composition, measure complexity, trace data flows, detect architectural patterns and anti-patterns, and generate visual reports with Mermaid diagrams. This skill examines the **UI layer** of a Fluent Commerce implementation — the declarative manifest files and plugin bundles that drive the OMX frontend.
|
|
12
|
+
|
|
13
|
+
## Context
|
|
14
|
+
|
|
15
|
+
Mystique manifests are the declarative configuration layer for the Fluent Commerce OMX UI. A manifest defines routes, pages, component trees, GraphQL data queries, template strings, role-based visibility, and plugin references. Over time, manifests grow organically:
|
|
16
|
+
|
|
17
|
+
- **Complexity creeps in.** Pages accumulate deeply nested component trees. Data providers nest inside conditionals inside repeaters. A single page can exceed 500 lines of JSON.
|
|
18
|
+
- **Dead components accumulate.** Pages are copied and modified, leaving orphaned data queries that no component consumes, or conditional branches that never match.
|
|
19
|
+
- **i18n coverage drifts.** New strings are added with hardcoded labels instead of `i18n:` keys. Translation files fall behind.
|
|
20
|
+
- **Query duplication spreads.** The same GraphQL query appears verbatim on multiple pages instead of being shared through data providers or fragments.
|
|
21
|
+
- **Plugin references go stale.** URLs point to localhost dev servers, CDN bundles that no longer exist, or bundles whose components are no longer referenced.
|
|
22
|
+
- **Role guards are missing.** Admin-only pages lack `roles` restrictions. Sensitive mutation actions have no role checks.
|
|
23
|
+
|
|
24
|
+
This skill systematically measures all of these dimensions and produces a structured report with scored metrics, enabling teams to prioritize UI technical debt.
|
|
25
|
+
|
|
26
|
+
## Ownership Boundary
|
|
27
|
+
|
|
28
|
+
This skill owns manifest structural analysis, component usage metrics, complexity scoring, pattern detection, and Mermaid diagram generation for manifests.
|
|
29
|
+
|
|
30
|
+
| This skill OWNS | Other skills OWN |
|
|
31
|
+
|-----------------|------------------|
|
|
32
|
+
| Manifest structural analysis | Schema validation, prop type checking -> `/fluent-mystique-validate` |
|
|
33
|
+
| Component usage metrics | Manifest creation/editing -> `/fluent-mystique-builder` |
|
|
34
|
+
| Complexity scoring | SDK project scaffolding -> `/fluent-mystique-scaffold` |
|
|
35
|
+
| Pattern and anti-pattern detection | Workflow analysis -> `/fluent-workflow-analyzer` |
|
|
36
|
+
| i18n coverage analysis | Settings management -> `/fluent-settings` |
|
|
37
|
+
| Data query duplication analysis | Backend rule analysis -> `/fluent-custom-code` |
|
|
38
|
+
| Plugin URL health assessment | Account-level feature inventory -> `/fluent-implementation-map` |
|
|
39
|
+
| Mermaid diagram generation | Live GraphQL execution -> MCP tools |
|
|
40
|
+
|
|
41
|
+
## No Planning Gate
|
|
42
|
+
|
|
43
|
+
This is a **read-only analysis skill**. It writes analysis artifacts to `accounts/<PROFILE>/analysis/mystique/` but does not modify manifests, settings, or entities. Same category as `/fluent-workflow-analyzer` and `/fluent-connection-analysis`.
|
|
44
|
+
|
|
45
|
+
## When to Use
|
|
46
|
+
|
|
47
|
+
- Auditing existing manifests before a major UI refactor
|
|
48
|
+
- Understanding an unfamiliar manifest's structure and page inventory
|
|
49
|
+
- Measuring UI complexity to set refactoring priorities
|
|
50
|
+
- Detecting i18n coverage gaps before a localization push
|
|
51
|
+
- Finding duplicate GraphQL queries across pages for consolidation
|
|
52
|
+
- Generating architecture diagrams for stakeholder walkthroughs
|
|
53
|
+
- Validating that plugin bundles are production-ready (not localhost)
|
|
54
|
+
- Assessing the custom-vs-OOTB component ratio for maintenance planning
|
|
55
|
+
- Pre-deployment health check on manifest quality
|
|
56
|
+
- Cross-manifest comparison when multiple manifests serve different contexts (admin, store, servicepoint)
|
|
57
|
+
|
|
58
|
+
## Invocation Examples
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
/fluent-mystique-analyze admin-manifest.json
|
|
62
|
+
/fluent-mystique-analyze admin-manifest.json --deep --mermaid
|
|
63
|
+
/fluent-mystique-analyze accounts/SAGIRISH/SOURCE/mystique-project/manifests/ --mermaid
|
|
64
|
+
/fluent-mystique-analyze --deployed --profile SAGIRISH --setting fc.mystique.manifest.admin
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Inputs
|
|
68
|
+
|
|
69
|
+
| Parameter | Required | Default | Description |
|
|
70
|
+
|-----------|----------|---------|-------------|
|
|
71
|
+
| `<manifest-file-or-directory>` | Yes (unless `--deployed`) | N/A | Path to a single manifest JSON file or directory containing multiple manifests |
|
|
72
|
+
| `--deep` | No | `false` | Enable all 7 analysis dimensions including i18n cross-reference, query deduplication, and pattern detection |
|
|
73
|
+
| `--mermaid` | No | `false` | Generate Mermaid diagrams (route graph, component trees, data flow) |
|
|
74
|
+
| `--deployed` | No | `false` | Fetch manifest from deployed Fluent settings via `graphql.query` instead of local file |
|
|
75
|
+
| `--profile` | No | Active profile | Fluent CLI profile (used with `--deployed`) |
|
|
76
|
+
| `--setting` | No | N/A | Setting name containing deployed manifest (used with `--deployed`, e.g., `fc.mystique.manifest.admin`) |
|
|
77
|
+
|
|
78
|
+
## Progress
|
|
79
|
+
|
|
80
|
+
Emit this block at each phase transition:
|
|
81
|
+
|
|
82
|
+
```
|
|
83
|
+
>> /fluent-mystique-analyze [1/7]
|
|
84
|
+
Done: Load manifests -> Component census
|
|
85
|
+
Pending: Route mapping Pending: Complexity scoring
|
|
86
|
+
Pending: Data query analysis Pending: i18n coverage
|
|
87
|
+
Pending: Pattern detection Pending: Diagrams & report
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Update the block as each phase completes.
|
|
91
|
+
|
|
92
|
+
## Source of Truth: Manifest v2.0 Schema
|
|
93
|
+
|
|
94
|
+
The skill analyzes manifests conforming to the Mystique v2.0 schema:
|
|
95
|
+
|
|
96
|
+
```
|
|
97
|
+
MystiqueManifest
|
|
98
|
+
+-- manifestVersion: "2.0"
|
|
99
|
+
+-- name: string # App identifier
|
|
100
|
+
+-- title: string | i18n:key # Display name
|
|
101
|
+
+-- context.level: account|retailer|location
|
|
102
|
+
+-- context.role: string|string[] # Role restriction
|
|
103
|
+
+-- plugins: [{name, src}] # CDN-hosted plugin bundles
|
|
104
|
+
+-- homePath: string # Landing route
|
|
105
|
+
+-- routes: Route[]
|
|
106
|
+
+-- Section {type:"section", nav{label,icon}, pages[]}
|
|
107
|
+
+-- Page {type:"page", path, component, data{query,variables}, props, descendants[], roles[]}
|
|
108
|
+
+-- Reference {type:"reference", settingName}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Each page contains a recursive component tree:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
MystiqueComponentInstance
|
|
115
|
+
+-- component: string # Registry alias (e.g., "fc.list", "fc.page")
|
|
116
|
+
+-- dataSource?: string # JSONPath scoping data context
|
|
117
|
+
+-- props?: Record<string,any> # Component-specific configuration
|
|
118
|
+
+-- descendants?: Instance[] # Nested child components
|
|
119
|
+
+-- roles?: string[] # Role-based visibility
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Analysis Dimensions
|
|
125
|
+
|
|
126
|
+
### Dimension 1: Component Census
|
|
127
|
+
|
|
128
|
+
Walk the entire manifest recursively, counting every component instance and tracking its nesting depth.
|
|
129
|
+
|
|
130
|
+
**Procedure:**
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
For each route in manifest.routes:
|
|
134
|
+
If route is a section:
|
|
135
|
+
For each page in section.pages:
|
|
136
|
+
Walk page.descendants recursively at depth 0
|
|
137
|
+
If route is a page:
|
|
138
|
+
Walk page.descendants recursively at depth 0
|
|
139
|
+
If route is a reference:
|
|
140
|
+
Record as fragment reference (settingName)
|
|
141
|
+
|
|
142
|
+
Walk function (instances[], depth):
|
|
143
|
+
For each instance:
|
|
144
|
+
Record: { alias: instance.component, depth: depth }
|
|
145
|
+
If instance.descendants:
|
|
146
|
+
Walk(instance.descendants, depth + 1)
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
**Output: Component Usage Summary Table**
|
|
150
|
+
|
|
151
|
+
```
|
|
152
|
+
Component Usage Summary
|
|
153
|
+
+--------------------------+-------+----------+----------+
|
|
154
|
+
| Component Alias | Count | Avg Depth| Max Depth|
|
|
155
|
+
+--------------------------+-------+----------+----------+
|
|
156
|
+
| fc.page | 47 | 0.0 | 0 |
|
|
157
|
+
| fc.list | 32 | 2.1 | 4 |
|
|
158
|
+
| fc.card.attribute | 24 | 2.8 | 5 |
|
|
159
|
+
| fc.grid | 18 | 1.2 | 3 |
|
|
160
|
+
| fc.column | 36 | 2.2 | 4 |
|
|
161
|
+
| fc.conditional | 12 | 3.2 | 6 |
|
|
162
|
+
| fc.tabs.card | 8 | 1.0 | 2 |
|
|
163
|
+
| fc.provider.graphql | 6 | 2.5 | 5 |
|
|
164
|
+
| fc.repeater | 4 | 2.0 | 3 |
|
|
165
|
+
| fc.filterPanel | 5 | 2.3 | 4 |
|
|
166
|
+
| fc.tile.metric | 8 | 3.0 | 4 |
|
|
167
|
+
| custom.order-tracker | 3 | 2.0 | 3 |
|
|
168
|
+
+--------------------------+-------+----------+----------+
|
|
169
|
+
| Total instances | 289 | | |
|
|
170
|
+
| Unique aliases | 34 | | |
|
|
171
|
+
| OOTB aliases (fc.*) | 29 | | |
|
|
172
|
+
| Custom aliases | 5 | | |
|
|
173
|
+
| Max nesting depth | 7 | | |
|
|
174
|
+
+--------------------------+-------+----------+----------+
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
**Category breakdown:** Classify each alias into one of the standard categories:
|
|
178
|
+
|
|
179
|
+
| Category | Aliases |
|
|
180
|
+
|----------|---------|
|
|
181
|
+
| Layout / Container | `fc.page`, `fc.grid`, `fc.column`, `fc.conditional`, `fc.repeater`, `fc.tabs.card`, `fc.accordion`, `fc.card`, `fc.provider.graphql`, `fc.provider.rest`, `fc.page.section`, `fc.page.section.header` |
|
|
182
|
+
| Content / Display | `fc.list`, `fc.card.attribute`, `fc.card.attributes.grid`, `fc.chart`, `fc.link`, `fc.image.card`, `fc.product.card`, `fc.json.viewer`, `fc.json.editor`, `fc.google.map.pin`, `fc.timeline`, `fc.stepper`, `fc.status.badge`, `fc.avatar`, `fc.badge`, `fc.chip`, `fc.divider`, `fc.text`, `fc.dynamic.value`, `fc.progress`, `fc.table`, `fc.tile.metric` |
|
|
183
|
+
| Form / Input | `fc.select`, `fc.input`, `fc.checkbox`, `fc.radio`, `fc.switch`, `fc.date.picker`, `fc.time.picker`, `fc.autocomplete`, `fc.slider`, `fc.file.upload`, `fc.quantity`, `fc.textarea`, `fc.color.picker`, `fc.filterPanel` |
|
|
184
|
+
| Action | `fc.button`, `fc.icon.button`, `fc.action.bar`, `fc.fab`, `fc.menu`, `fc.speed.dial` |
|
|
185
|
+
| Navigation | `fc.breadcrumb`, `fc.pagination`, `fc.drawer`, `fc.dialog`, `fc.popover`, `fc.tooltip` |
|
|
186
|
+
| Feedback | `fc.alert`, `fc.snackbar`, `fc.skeleton`, `fc.loading`, `fc.empty.state`, `fc.error.boundary` |
|
|
187
|
+
| Wizard | `fc.page.wizard`, `fc.page.wizard.action`, `fc.page.wizard.summary` |
|
|
188
|
+
| Custom | Any alias not starting with `fc.` or not in the known registry |
|
|
189
|
+
|
|
190
|
+
### Dimension 2: Route Map
|
|
191
|
+
|
|
192
|
+
Build a hierarchical map of all routes showing sections, pages, and their primary component.
|
|
193
|
+
|
|
194
|
+
**Procedure:**
|
|
195
|
+
|
|
196
|
+
```
|
|
197
|
+
For each route:
|
|
198
|
+
If section:
|
|
199
|
+
Print section label, icon, roles (if any)
|
|
200
|
+
For each page in section.pages:
|
|
201
|
+
Print path, primary component, descendant count, roles
|
|
202
|
+
If page (top-level):
|
|
203
|
+
Print path, primary component, descendant count, roles
|
|
204
|
+
If reference:
|
|
205
|
+
Print settingName (fragment)
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
**Output: Route Structure Tree**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Route Structure
|
|
212
|
+
+-- /orders (section: "Order Management", icon: shopping_cart)
|
|
213
|
+
| +-- /orders -- fc.list [12 columns, filter enabled]
|
|
214
|
+
| +-- /orders/:id -- fc.page [18 components, 3 levels deep]
|
|
215
|
+
| +-- /orders/:id/fulfilments -- fc.list [8 columns]
|
|
216
|
+
+-- /inventory (section: "Inventory", icon: inventory_2)
|
|
217
|
+
| +-- /inventory/positions -- fc.page [fc.filterPanel + fc.list]
|
|
218
|
+
| +-- /inventory/positions/:id -- fc.page [2 attribute cards]
|
|
219
|
+
+-- /settings (section: "Admin", icon: settings, roles: ["ADMIN"])
|
|
220
|
+
| +-- /settings/general -- fc.page
|
|
221
|
+
| +-- /settings/users -- fc.page [custom.user-management]
|
|
222
|
+
+-- [reference] fc.mystique.manifest.reporting (fragment)
|
|
223
|
+
|
|
224
|
+
Summary: 3 sections, 8 pages, 1 fragment reference
|
|
225
|
+
Home path: /orders (resolves to section "Order Management")
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
### Dimension 3: Complexity Scoring
|
|
229
|
+
|
|
230
|
+
Compute a weighted complexity score (0-100) for the overall manifest and per-page.
|
|
231
|
+
|
|
232
|
+
**Metric Weights:**
|
|
233
|
+
|
|
234
|
+
| Metric | Weight | Green (0-40) | Yellow (41-70) | Red (71-100) |
|
|
235
|
+
|--------|--------|-------------|----------------|--------------|
|
|
236
|
+
| Total component instances | 20% | <100 | 100-300 | >300 |
|
|
237
|
+
| Max nesting depth | 20% | <5 | 5-8 | >8 |
|
|
238
|
+
| Avg components per page | 15% | <5 | 5-15 | >15 |
|
|
239
|
+
| Custom component ratio | 15% | <10% | 10-30% | >30% |
|
|
240
|
+
| Data provider count | 15% | <5 | 5-15 | >15 |
|
|
241
|
+
| Conditional complexity | 15% | <3 nested | 3-6 nested | >6 nested |
|
|
242
|
+
|
|
243
|
+
**Scoring formula:**
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
For each metric:
|
|
247
|
+
raw_score = linear_interpolate(value, green_max, red_min, 0, 100)
|
|
248
|
+
clamped = clamp(raw_score, 0, 100)
|
|
249
|
+
|
|
250
|
+
overall_score = sum(metric_score * weight) for all metrics
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
**Output: Complexity Scorecard**
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
Manifest Complexity Scorecard
|
|
257
|
+
+------------------------------+--------+-------+--------+
|
|
258
|
+
| Metric | Value | Score | Rating |
|
|
259
|
+
+------------------------------+--------+-------+--------+
|
|
260
|
+
| Total component instances | 289 | 63 | YELLOW |
|
|
261
|
+
| Max nesting depth | 7 | 50 | YELLOW |
|
|
262
|
+
| Avg components per page | 8.2 | 32 | GREEN |
|
|
263
|
+
| Custom component ratio | 14.7% | 47 | YELLOW |
|
|
264
|
+
| Data provider count | 6 | 20 | GREEN |
|
|
265
|
+
| Conditional complexity | 4 | 50 | YELLOW |
|
|
266
|
+
+------------------------------+--------+-------+--------+
|
|
267
|
+
| OVERALL SCORE | | 44 | YELLOW |
|
|
268
|
+
+------------------------------+--------+-------+--------+
|
|
269
|
+
|
|
270
|
+
Per-Page Complexity (top 5):
|
|
271
|
+
/orders/:id 72 RED (18 components, depth 6, 2 providers)
|
|
272
|
+
/inventory/positions 58 YELLOW (12 components, depth 4, filterPanel)
|
|
273
|
+
/settings/users 55 YELLOW (custom.user-management, depth 5)
|
|
274
|
+
/orders 35 GREEN (fc.list, simple structure)
|
|
275
|
+
/settings/general 12 GREEN (2 attribute cards)
|
|
276
|
+
```
|
|
277
|
+
|
|
278
|
+
### Dimension 4: Data Query Analysis
|
|
279
|
+
|
|
280
|
+
Extract and analyze all GraphQL queries in the manifest — page-level `data.query` blocks and `fc.provider.graphql` query props.
|
|
281
|
+
|
|
282
|
+
**Procedure:**
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
1. Extract all queries:
|
|
286
|
+
- Page-level: route.data.query for each page
|
|
287
|
+
- Provider-level: descendants with component=="fc.provider.graphql", extract props.query
|
|
288
|
+
- Filter panel: fc.filterPanel with props.query
|
|
289
|
+
|
|
290
|
+
2. Normalize queries (strip whitespace, normalize field order)
|
|
291
|
+
|
|
292
|
+
3. Detect duplicates:
|
|
293
|
+
- Exact duplicates: identical normalized query text
|
|
294
|
+
- Near duplicates: same root query, different field selection
|
|
295
|
+
|
|
296
|
+
4. Analyze query complexity:
|
|
297
|
+
- Count fields per query
|
|
298
|
+
- Count nested connections (edges/node patterns)
|
|
299
|
+
- Flag queries with >10 top-level fields
|
|
300
|
+
- Flag queries with >3 nested connection levels
|
|
301
|
+
|
|
302
|
+
5. Map query-to-component consumption:
|
|
303
|
+
- Which components reference the query data via dataSource?
|
|
304
|
+
- Are there orphan queries (defined but no descendant references the data)?
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
**Output: Data Query Report**
|
|
308
|
+
|
|
309
|
+
```
|
|
310
|
+
Data Query Analysis
|
|
311
|
+
+---+-----------------------------------+--------+--------+-----------+----------+
|
|
312
|
+
| # | Root Query | Fields | Nesting| Pages | Status |
|
|
313
|
+
+---+-----------------------------------+--------+--------+-----------+----------+
|
|
314
|
+
| 1 | orders(first, after, retailerId) | 12 | 2 | /orders | OK |
|
|
315
|
+
| 2 | orderById(id) | 18 | 3 | /orders/:id| COMPLEX |
|
|
316
|
+
| 3 | orderById(id) | 8 | 2 | /orders/:id/ful | SIMILAR_TO_2 |
|
|
317
|
+
| 4 | inventoryPositions(first, after) | 6 | 1 | /inventory| OK |
|
|
318
|
+
| 5 | locationByRef(ref) | 5 | 1 | (provider)| OK |
|
|
319
|
+
| 6 | orders(first, after, retailerId) | 12 | 2 | /dashboard| DUPLICATE_OF_1|
|
|
320
|
+
+---+-----------------------------------+--------+--------+-----------+----------+
|
|
321
|
+
|
|
322
|
+
Unique queries: 5 (1 exact duplicate, 1 near-duplicate)
|
|
323
|
+
Orphan queries: 0 (all queries have consuming components)
|
|
324
|
+
Large queries: 1 (query #2 has 18 fields, 3 nesting levels)
|
|
325
|
+
Provider queries: 1 (fc.provider.graphql on /orders/:id)
|
|
326
|
+
|
|
327
|
+
Recommendation: Consolidate queries #1 and #6 into a shared fragment or data provider.
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
### Dimension 5: i18n Coverage
|
|
331
|
+
|
|
332
|
+
Extract all user-facing strings and classify them as internationalized or hardcoded.
|
|
333
|
+
|
|
334
|
+
**Procedure:**
|
|
335
|
+
|
|
336
|
+
```
|
|
337
|
+
1. Extract i18n strings:
|
|
338
|
+
- Strings starting with "i18n:" prefix (properly internationalized)
|
|
339
|
+
- Template strings using {{t "key"}} pattern
|
|
340
|
+
|
|
341
|
+
2. Extract hardcoded strings:
|
|
342
|
+
- Section nav.label values without i18n: prefix
|
|
343
|
+
- Page props.title values without i18n: prefix or template strings
|
|
344
|
+
- Component props with string values that appear to be user-facing labels
|
|
345
|
+
- List column labels, card titles, button labels
|
|
346
|
+
|
|
347
|
+
3. If translation files are available (i18n/locales/*/translation.json):
|
|
348
|
+
- Cross-reference extracted i18n: keys against translation files
|
|
349
|
+
- Report missing keys (referenced but not in translation file)
|
|
350
|
+
- Report unused keys (in translation file but not referenced in manifest)
|
|
351
|
+
- Report language coverage (which locales have complete translations)
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
**Output: i18n Coverage Report**
|
|
355
|
+
|
|
356
|
+
```
|
|
357
|
+
i18n Coverage Analysis
|
|
358
|
+
+----------------------------+-------+
|
|
359
|
+
| Metric | Value |
|
|
360
|
+
+----------------------------+-------+
|
|
361
|
+
| Total user-facing strings | 156 |
|
|
362
|
+
| i18n: prefixed | 112 |
|
|
363
|
+
| Template strings | 24 |
|
|
364
|
+
| Hardcoded strings | 20 |
|
|
365
|
+
| Coverage | 71.8% |
|
|
366
|
+
+----------------------------+-------+
|
|
367
|
+
|
|
368
|
+
Hardcoded Strings (fix these):
|
|
369
|
+
/orders -- page title "Orders" (should be i18n:fc.om.orders.title)
|
|
370
|
+
/orders/:id -- back button label "Back to Orders"
|
|
371
|
+
/settings/users -- nav label "Advanced User Management"
|
|
372
|
+
... (17 more)
|
|
373
|
+
|
|
374
|
+
Translation Cross-Reference (en):
|
|
375
|
+
Missing keys: 3 (referenced in manifest but not in translation.json)
|
|
376
|
+
Unused keys: 12 (in translation.json but not referenced)
|
|
377
|
+
Locales found: en, de, fr, ja, zh
|
|
378
|
+
Complete locales: en (100%), de (94%), fr (91%), ja (87%), zh (82%)
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Dimension 6: Pattern Detection
|
|
382
|
+
|
|
383
|
+
Scan the manifest for known good patterns and anti-patterns.
|
|
384
|
+
|
|
385
|
+
| Pattern | Type | Detection | Severity |
|
|
386
|
+
|---------|------|-----------|----------|
|
|
387
|
+
| **Consistent layouts** | Good | Same component hierarchy across entity detail pages (fc.page -> fc.grid -> fc.column -> fc.card.attribute) | INFO |
|
|
388
|
+
| **Deep nesting** | Warning | Components nested >6 levels deep | MEDIUM |
|
|
389
|
+
| **Orphan data** | Warning | Page `data.query` defined but no descendant uses `dataSource` referencing it | MEDIUM |
|
|
390
|
+
| **Duplicate pages** | Refactor | Near-identical page structures (>80% component overlap) that could share a fragment | LOW |
|
|
391
|
+
| **Missing actions** | Gap | Detail pages (entity by ID) without `actions` prop on fc.page — no workflow integration | MEDIUM |
|
|
392
|
+
| **No role guards** | Security | Pages under admin/settings sections without `roles` restriction | HIGH |
|
|
393
|
+
| **Fragment opportunity** | Optimization | Repeated section/page structures across multiple manifests in the same directory | LOW |
|
|
394
|
+
| **Localhost plugins** | Error | Plugin `src` URLs containing `localhost`, `127.0.0.1`, or non-HTTPS URLs | HIGH |
|
|
395
|
+
| **Dead plugins** | Warning | Plugin `name` registered but no component in the manifest uses an alias from that plugin | MEDIUM |
|
|
396
|
+
| **Provider inside list** | Warning | `fc.provider.graphql` nested inside `fc.list` — known compatibility issue per Fluent docs | HIGH |
|
|
397
|
+
| **Missing page titles** | Warning | `fc.page` components without `title` prop — poor UX for browser tabs and breadcrumbs | LOW |
|
|
398
|
+
| **Excessive list columns** | Warning | `fc.list` with >12 attribute columns — renders poorly on smaller screens | LOW |
|
|
399
|
+
| **Deeply nested conditionals** | Warning | `fc.conditional` nested inside another `fc.conditional` >2 levels — hard to maintain | MEDIUM |
|
|
400
|
+
| **Missing filter** | Gap | `fc.list` with large data sets but no `filter` prop enabled | LOW |
|
|
401
|
+
| **Wizard step count** | Warning | `fc.page.wizard` with >6 steps — violates recommended practices | MEDIUM |
|
|
402
|
+
|
|
403
|
+
**Output: Pattern Detection Report**
|
|
404
|
+
|
|
405
|
+
```
|
|
406
|
+
Pattern Detection
|
|
407
|
+
+-+------+-----------------------------+-----------------------------------+
|
|
408
|
+
|#| Sev | Pattern | Location |
|
|
409
|
+
+-+------+-----------------------------+-----------------------------------+
|
|
410
|
+
|1| HIGH | No role guards | /settings/general (no roles[]) |
|
|
411
|
+
|2| HIGH | Localhost plugin | plugin "dev-components" src=http://localhost:3001/bundle.js |
|
|
412
|
+
|3| HIGH | Provider inside list | /orders/:id -> fc.list -> fc.provider.graphql |
|
|
413
|
+
|4| MED | Deep nesting (7 levels) | /orders/:id -> grid -> column -> tabs -> ... |
|
|
414
|
+
|5| MED | Orphan data query | /dashboard has query but no dataSource consumers |
|
|
415
|
+
|6| MED | Missing actions | /inventory/positions/:id has no actions prop |
|
|
416
|
+
|7| LOW | Duplicate page structure | /orders and /fulfilments share 85% component overlap |
|
|
417
|
+
|8| LOW | Missing page title | /settings/general has no title prop |
|
|
418
|
+
|9| INFO | Consistent layout detected | 5 detail pages use fc.page -> fc.grid -> fc.column pattern |
|
|
419
|
+
+-+------+-----------------------------+-----------------------------------+
|
|
420
|
+
|
|
421
|
+
Summary: 3 HIGH, 3 MEDIUM, 2 LOW, 1 INFO
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
### Dimension 7: Mermaid Diagrams (--mermaid)
|
|
425
|
+
|
|
426
|
+
Generate copy-pasteable Mermaid diagram blocks for visual architecture documentation.
|
|
427
|
+
|
|
428
|
+
#### Diagram 1: Route Graph
|
|
429
|
+
|
|
430
|
+
Shows the hierarchical route structure with sections as containers and pages as nodes.
|
|
431
|
+
|
|
432
|
+
**Template:**
|
|
433
|
+
|
|
434
|
+
````markdown
|
|
435
|
+
```mermaid
|
|
436
|
+
flowchart TD
|
|
437
|
+
subgraph SEC_OM["Order Management"]
|
|
438
|
+
ORDERS["/orders<br/><small>fc.list</small>"]
|
|
439
|
+
ORDER_DET["/orders/:id<br/><small>fc.page 18 components</small>"]
|
|
440
|
+
ORDER_FUL["/orders/:id/fulfilments<br/><small>fc.list</small>"]
|
|
441
|
+
ORDERS --> ORDER_DET
|
|
442
|
+
ORDER_DET --> ORDER_FUL
|
|
443
|
+
end
|
|
444
|
+
|
|
445
|
+
subgraph SEC_INV["Inventory"]
|
|
446
|
+
INV_POS["/inventory/positions<br/><small>fc.page + filterPanel</small>"]
|
|
447
|
+
INV_DET["/inventory/positions/:id<br/><small>fc.page</small>"]
|
|
448
|
+
INV_POS --> INV_DET
|
|
449
|
+
end
|
|
450
|
+
|
|
451
|
+
subgraph SEC_ADMIN["Admin (ADMIN role)"]
|
|
452
|
+
SET_GEN["/settings/general<br/><small>fc.page</small>"]
|
|
453
|
+
SET_USR["/settings/users<br/><small>custom.user-mgmt</small>"]
|
|
454
|
+
end
|
|
455
|
+
|
|
456
|
+
HOME(("homePath")) --> ORDERS
|
|
457
|
+
|
|
458
|
+
style SEC_ADMIN fill:#fff3cd,stroke:#856404
|
|
459
|
+
style HOME fill:#d4edda
|
|
460
|
+
```
|
|
461
|
+
````
|
|
462
|
+
|
|
463
|
+
**Generation algorithm:**
|
|
464
|
+
|
|
465
|
+
```
|
|
466
|
+
1. For each section, create a subgraph with the section label
|
|
467
|
+
2. For each page in the section, create a node with path and primary component
|
|
468
|
+
3. Draw edges between list pages and their detail pages (matching /:id patterns)
|
|
469
|
+
4. Mark homePath with a special node pointing to its target
|
|
470
|
+
5. Highlight role-restricted sections with warning colors
|
|
471
|
+
6. Mark pages with custom components using distinct styling
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
#### Diagram 2: Component Tree (per page)
|
|
475
|
+
|
|
476
|
+
Shows the component hierarchy for a specific page — useful for understanding complex pages.
|
|
477
|
+
|
|
478
|
+
**Template:**
|
|
479
|
+
|
|
480
|
+
````markdown
|
|
481
|
+
```mermaid
|
|
482
|
+
graph TD
|
|
483
|
+
PAGE["fc.page<br/>title: Order Detail"]
|
|
484
|
+
PAGE --> GRID["fc.grid"]
|
|
485
|
+
GRID --> COL1["fc.column md:8"]
|
|
486
|
+
GRID --> COL2["fc.column md:4"]
|
|
487
|
+
COL1 --> TABS["fc.tabs.card"]
|
|
488
|
+
TABS --> TAB1_LIST["fc.list<br/>dataSource: items"]
|
|
489
|
+
TABS --> TAB2_CARD["fc.card.attribute<br/>Fulfilment Details"]
|
|
490
|
+
COL2 --> ATTR["fc.card.attribute<br/>Order Summary"]
|
|
491
|
+
COL2 --> ACTIONS["fc.page (actions)"]
|
|
492
|
+
COL2 --> COND["fc.conditional<br/>status==ACTIVE"]
|
|
493
|
+
COND --> ALERT["fc.alert<br/>Active Order"]
|
|
494
|
+
|
|
495
|
+
style PAGE fill:#e3f2fd
|
|
496
|
+
style COND fill:#fff3cd
|
|
497
|
+
style ACTIONS fill:#d4edda
|
|
498
|
+
```
|
|
499
|
+
````
|
|
500
|
+
|
|
501
|
+
**Generation algorithm:**
|
|
502
|
+
|
|
503
|
+
```
|
|
504
|
+
For a given page:
|
|
505
|
+
1. Create root node for the page component with title
|
|
506
|
+
2. Recursively walk descendants:
|
|
507
|
+
a. Create node for each component (alias + key props summary)
|
|
508
|
+
b. Draw edge from parent to child
|
|
509
|
+
c. For fc.conditional, add condition text to node
|
|
510
|
+
d. For fc.provider.graphql, add query summary to node
|
|
511
|
+
e. For fc.list, add dataSource and column count
|
|
512
|
+
f. For fc.repeater, add dataSource
|
|
513
|
+
3. Color-code by category:
|
|
514
|
+
- Layout: light blue
|
|
515
|
+
- Data providers: light purple
|
|
516
|
+
- Conditionals: light yellow
|
|
517
|
+
- Actions: light green
|
|
518
|
+
- Custom: light orange
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
#### Diagram 3: Data Flow (per page)
|
|
522
|
+
|
|
523
|
+
Shows how data moves from GraphQL queries through the component tree.
|
|
524
|
+
|
|
525
|
+
**Template:**
|
|
526
|
+
|
|
527
|
+
````markdown
|
|
528
|
+
```mermaid
|
|
529
|
+
sequenceDiagram
|
|
530
|
+
participant Browser as Browser
|
|
531
|
+
participant Page as Page /orders/:id
|
|
532
|
+
participant GQL as GraphQL API
|
|
533
|
+
participant Comp as Components
|
|
534
|
+
|
|
535
|
+
Browser->>Page: Navigate to /orders/123
|
|
536
|
+
Page->>GQL: orderById(id: 123)
|
|
537
|
+
GQL-->>Page: order data (18 fields)
|
|
538
|
+
Page->>Comp: fc.page receives order data
|
|
539
|
+
Comp->>Comp: fc.list uses dataSource=items
|
|
540
|
+
Comp->>Comp: fc.card.attribute uses order fields
|
|
541
|
+
Note over Comp: fc.provider.graphql triggers
|
|
542
|
+
Comp->>GQL: locationByRef(ref: locationRef)
|
|
543
|
+
GQL-->>Comp: location data
|
|
544
|
+
Comp->>Comp: fc.card.attribute uses location fields
|
|
545
|
+
```
|
|
546
|
+
````
|
|
547
|
+
|
|
548
|
+
**Generation algorithm:**
|
|
549
|
+
|
|
550
|
+
```
|
|
551
|
+
For a given page:
|
|
552
|
+
1. Start with browser navigation to the page path
|
|
553
|
+
2. If page has data.query, show the page-level GraphQL call
|
|
554
|
+
3. Show data flowing to child components via dataSource paths
|
|
555
|
+
4. For each fc.provider.graphql descendant:
|
|
556
|
+
a. Show a secondary GraphQL call
|
|
557
|
+
b. Show data flowing to the provider's descendants
|
|
558
|
+
5. For fc.repeater, show iteration over the data array
|
|
559
|
+
6. For fc.conditional, show branch decision
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
---
|
|
563
|
+
|
|
564
|
+
## Execution Flow
|
|
565
|
+
|
|
566
|
+
### Step 1: Load Manifests
|
|
567
|
+
|
|
568
|
+
```
|
|
569
|
+
1. If --deployed:
|
|
570
|
+
a. Query settings API for the manifest setting (fc.mystique.manifest.*)
|
|
571
|
+
b. Parse the lobValue as JSON
|
|
572
|
+
c. Handle fragment references (type:"reference") by fetching the referenced settings
|
|
573
|
+
2. If file path provided:
|
|
574
|
+
a. If file: read and parse single manifest JSON
|
|
575
|
+
b. If directory: glob for *.json, parse each, filter by manifestVersion:"2.0"
|
|
576
|
+
3. Validate each loaded manifest has manifestVersion and routes
|
|
577
|
+
4. Report: N manifests loaded, M total routes, K total pages
|
|
578
|
+
```
|
|
579
|
+
|
|
580
|
+
### Step 2: Component Census (Dimension 1)
|
|
581
|
+
|
|
582
|
+
Walk all manifests recursively. Produce the component usage summary table with counts, average depth, max depth, and category breakdown.
|
|
583
|
+
|
|
584
|
+
### Step 3: Route Map (Dimension 2)
|
|
585
|
+
|
|
586
|
+
Build the hierarchical route tree. Identify sections, pages, fragment references. Map homePath to its target. Flag any route path duplicates.
|
|
587
|
+
|
|
588
|
+
### Step 4: Complexity Scoring (Dimension 3)
|
|
589
|
+
|
|
590
|
+
Compute the weighted complexity score for the overall manifest and per-page. Generate the scorecard with Green/Yellow/Red ratings.
|
|
591
|
+
|
|
592
|
+
### Step 5: Data Query Analysis (Dimension 4)
|
|
593
|
+
|
|
594
|
+
Extract all GraphQL queries. Normalize, deduplicate, compute field counts. Map query-to-component consumption chains. Flag orphan queries and large queries.
|
|
595
|
+
|
|
596
|
+
### Step 6: i18n Coverage (Dimension 5, --deep only)
|
|
597
|
+
|
|
598
|
+
Extract all user-facing strings. Classify as i18n-prefixed, template, or hardcoded. If translation files are available, cross-reference for missing and unused keys.
|
|
599
|
+
|
|
600
|
+
### Step 7: Pattern Detection (Dimension 6)
|
|
601
|
+
|
|
602
|
+
Run the pattern detection rules against the analyzed manifest. Produce findings sorted by severity.
|
|
603
|
+
|
|
604
|
+
### Step 8: Plugin Analysis
|
|
605
|
+
|
|
606
|
+
```
|
|
607
|
+
1. Extract all plugins[] entries from manifests
|
|
608
|
+
2. Classify each plugin URL:
|
|
609
|
+
- localhost / 127.0.0.1 / 0.0.0.0 -> DEV (flag as error for production)
|
|
610
|
+
- CDN URL (https://*.cdn.*, *.vercel.app, *.cloudfront.net) -> PROD
|
|
611
|
+
- HTTP (not HTTPS) -> INSECURE (flag as warning)
|
|
612
|
+
- Broken/empty URL -> BROKEN (flag as error)
|
|
613
|
+
3. Cross-reference plugin names against component aliases in the manifest:
|
|
614
|
+
- If a plugin is declared but no custom alias from that plugin is used -> DEAD PLUGIN
|
|
615
|
+
4. Compute custom vs OOTB ratio:
|
|
616
|
+
- OOTB: aliases matching fc.* from the known registry
|
|
617
|
+
- Custom: all other aliases
|
|
618
|
+
- Report: N custom / M total = X% custom
|
|
619
|
+
```
|
|
620
|
+
|
|
621
|
+
**Output: Plugin Analysis**
|
|
622
|
+
|
|
623
|
+
```
|
|
624
|
+
Plugin Analysis
|
|
625
|
+
+---+---------------------+-------------------------------------------+--------+--------+
|
|
626
|
+
| # | Plugin Name | Source URL | Status | Used |
|
|
627
|
+
+---+---------------------+-------------------------------------------+--------+--------+
|
|
628
|
+
| 1 | omx-components | https://cdn.fluent.com/omx/bundle.js | PROD | Yes(3) |
|
|
629
|
+
| 2 | dev-widgets | http://localhost:3001/bundle.js | DEV | Yes(1) |
|
|
630
|
+
| 3 | analytics-plugin | https://analytics.vercel.app/bundle.js | PROD | No |
|
|
631
|
+
+---+---------------------+-------------------------------------------+--------+--------+
|
|
632
|
+
|
|
633
|
+
Custom vs OOTB: 5 custom / 34 total = 14.7% custom ratio
|
|
634
|
+
Bundle dependencies: custom.order-tracker (omx-components), custom.user-management (omx-components)
|
|
635
|
+
```
|
|
636
|
+
|
|
637
|
+
### Step 9: Mermaid Diagrams (--mermaid)
|
|
638
|
+
|
|
639
|
+
Generate all three diagram types. For the component tree and data flow diagrams, generate for the top 3 most complex pages (by per-page complexity score).
|
|
640
|
+
|
|
641
|
+
### Step 10: Cross-Manifest Analysis
|
|
642
|
+
|
|
643
|
+
When multiple manifests are loaded (directory mode), run additional cross-manifest checks:
|
|
644
|
+
|
|
645
|
+
```
|
|
646
|
+
1. Shared component aliases across manifests:
|
|
647
|
+
- Which aliases appear in all manifests?
|
|
648
|
+
- Are there inconsistent prop shapes for the same alias?
|
|
649
|
+
|
|
650
|
+
2. Route path collisions:
|
|
651
|
+
- Do any manifests define the same route path?
|
|
652
|
+
|
|
653
|
+
3. Fragment reuse opportunities:
|
|
654
|
+
- Which page structures are repeated across manifests?
|
|
655
|
+
- Could they be extracted into shared fragments (type:"reference")?
|
|
656
|
+
|
|
657
|
+
4. Plugin consistency:
|
|
658
|
+
- Do all manifests reference the same plugin versions?
|
|
659
|
+
- Are there version mismatches?
|
|
660
|
+
|
|
661
|
+
5. Context comparison:
|
|
662
|
+
- Compare context.level across manifests (admin=account, store=location, etc.)
|
|
663
|
+
- Compare role restrictions
|
|
664
|
+
```
|
|
665
|
+
|
|
666
|
+
### Step 11: Write Report
|
|
667
|
+
|
|
668
|
+
Compile all dimensions into a structured markdown report and write artifacts.
|
|
669
|
+
|
|
670
|
+
---
|
|
671
|
+
|
|
672
|
+
## Output Location
|
|
673
|
+
|
|
674
|
+
All generated artifacts are written to:
|
|
675
|
+
|
|
676
|
+
```
|
|
677
|
+
accounts/<PROFILE>/analysis/mystique/
|
|
678
|
+
+-- manifest-analysis.md # Human-readable report with all dimensions
|
|
679
|
+
+-- component-census.json # Machine-readable component usage metrics
|
|
680
|
+
+-- diagrams/ # Mermaid diagram source files
|
|
681
|
+
| +-- route-graph.mmd # Route structure flowchart
|
|
682
|
+
| +-- <page-path>-tree.mmd # Component tree per complex page
|
|
683
|
+
| +-- <page-path>-flow.mmd # Data flow per complex page
|
|
684
|
+
+-- cross-manifest.md # Cross-manifest comparison (directory mode only)
|
|
685
|
+
```
|
|
686
|
+
|
|
687
|
+
When a single file is analyzed outside an accounts directory, write to the same directory as the manifest file with an `analysis/` subdirectory.
|
|
688
|
+
|
|
689
|
+
---
|
|
690
|
+
|
|
691
|
+
## Frontend Development Context
|
|
692
|
+
|
|
693
|
+
This skill analyzes the **UI layer** of a Fluent Commerce implementation. Key distinctions:
|
|
694
|
+
|
|
695
|
+
### Manifest vs Backend
|
|
696
|
+
|
|
697
|
+
- **Manifests** define what the user sees: routes, pages, component trees, data queries, labels, actions, role guards. They are declarative JSON deployed as Fluent settings.
|
|
698
|
+
- **Workflows** define what happens on the backend: entity state machines, rule execution, event chains. Analyzed by `/fluent-workflow-analyzer`.
|
|
699
|
+
- **The bridge** between them is user actions: the manifest's `actions` prop on `fc.page` connects to workflow-defined user actions. Missing actions in the manifest means the UI does not expose backend capabilities.
|
|
700
|
+
|
|
701
|
+
### Local vs Deployed Analysis
|
|
702
|
+
|
|
703
|
+
- **Local files**: Read manifest JSON from the filesystem. Useful during development before deployment.
|
|
704
|
+
- **Deployed manifests**: Fetch from Fluent settings API via `graphql.query`. Setting names follow the convention `fc.mystique.manifest.<app-name>`. The setting value is the full manifest JSON stored as a LOB (Large Object). Fragment references (`type:"reference"`) point to additional settings that must be fetched separately.
|
|
705
|
+
|
|
706
|
+
### Plugin URL Health
|
|
707
|
+
|
|
708
|
+
Plugin bundles are external JavaScript files loaded at runtime. The `plugins[]` array in a manifest specifies CDN URLs. This skill classifies plugin URLs:
|
|
709
|
+
|
|
710
|
+
| URL Pattern | Classification | Action |
|
|
711
|
+
|-------------|---------------|--------|
|
|
712
|
+
| `http://localhost:*` | DEV | Must replace before deployment |
|
|
713
|
+
| `http://127.0.0.1:*` | DEV | Must replace before deployment |
|
|
714
|
+
| `http://*` (non-HTTPS) | INSECURE | Upgrade to HTTPS |
|
|
715
|
+
| `https://*.cdn.*`, `*.vercel.app`, `*.cloudfront.net` | PROD | OK for production |
|
|
716
|
+
| Empty or malformed URL | BROKEN | Fix immediately |
|
|
717
|
+
|
|
718
|
+
### Custom vs OOTB Component Ratio
|
|
719
|
+
|
|
720
|
+
The ratio of custom components to OOTB (out-of-the-box) `fc.*` components indicates maintenance burden:
|
|
721
|
+
|
|
722
|
+
- **<10% custom**: Mostly standard UI. Low maintenance. Upgrades are straightforward.
|
|
723
|
+
- **10-30% custom**: Extended UI. Moderate maintenance. Plugin bundles must be versioned.
|
|
724
|
+
- **>30% custom**: Heavily customized. High maintenance. Plugin compatibility with platform upgrades is a risk.
|
|
725
|
+
|
|
726
|
+
### Bundle Dependency Mapping
|
|
727
|
+
|
|
728
|
+
For each custom component alias, trace it back to the plugin that provides it. Report which plugins are actually consumed vs declared-but-unused. This helps identify dead plugin dependencies that increase bundle size without benefit.
|
|
729
|
+
|
|
730
|
+
### Custom Component Cataloging
|
|
731
|
+
|
|
732
|
+
When custom components are found, catalog them as individual `.md` files following the template in `fluent-mystique-builder/COMPONENT_TEMPLATE.md`. For each custom alias:
|
|
733
|
+
|
|
734
|
+
1. Find the SDK project in `accounts/<PROFILE>/SOURCE/*/src/index.tsx` — locate `ComponentRegistry.register('<alias>', Component)` calls
|
|
735
|
+
2. Read the component's TypeScript props interface
|
|
736
|
+
3. Check Storybook stories and usage in manifests
|
|
737
|
+
4. Create a component file (e.g., `custom.order-tracker.md`) using the `COMPONENT_TEMPLATE.md` format with `module: Custom`
|
|
738
|
+
5. Write to `fluent-mystique-builder/components/` (OOTB companion) or `accounts/<PROFILE>/analysis/mystique/components/` (per-account)
|
|
739
|
+
|
|
740
|
+
This structured catalog enables `/fluent-mystique-builder` to grep `components/*.md` and make informed Build vs Configure decisions that account for BOTH OOTB and existing client custom components — avoiding duplicate implementations.
|
|
741
|
+
|
|
742
|
+
---
|
|
743
|
+
|
|
744
|
+
## Integration with Other Skills
|
|
745
|
+
|
|
746
|
+
| User Request After Analysis | Skill to Invoke |
|
|
747
|
+
|-----------------------------|-----------------|
|
|
748
|
+
| "Fix the issues found" | `/fluent-mystique-validate` (for schema validation), then `/fluent-mystique-builder` (for edits) |
|
|
749
|
+
| "Scaffold a new component to replace the custom one" | `/fluent-mystique-scaffold` |
|
|
750
|
+
| "Deploy the manifest" | `/fluent-mystique-validate` -> `/fluent-settings` (upload as setting) |
|
|
751
|
+
| "Map the full implementation" | `/fluent-implementation-map` (discovers manifests as part of account onboarding) |
|
|
752
|
+
| "Analyze the backend workflows" | `/fluent-workflow-analyzer` |
|
|
753
|
+
| "Check cross-entity connections" | `/fluent-connection-analysis` |
|
|
754
|
+
| "What custom rules power the user actions?" | `/fluent-custom-code` |
|
|
755
|
+
|
|
756
|
+
### Integration with /fluent-implementation-map
|
|
757
|
+
|
|
758
|
+
When `/fluent-implementation-map` discovers deployed Mystique manifests during account onboarding (settings with `fc.mystique.manifest.*` keys), it can invoke this skill to produce the UI layer analysis as part of the full implementation map. The manifest analysis report is referenced from the implementation map's UI section.
|
|
759
|
+
|
|
760
|
+
### Integration with /fluent-mystique-validate
|
|
761
|
+
|
|
762
|
+
This skill and `/fluent-mystique-validate` are complementary:
|
|
763
|
+
|
|
764
|
+
- **validate** answers: "Is this manifest structurally correct?" (schema compliance, prop types, cross-references)
|
|
765
|
+
- **analyze** answers: "Is this manifest well-architected?" (complexity, patterns, coverage, health)
|
|
766
|
+
|
|
767
|
+
After running analyze, recommend validate for any manifests with HIGH severity findings.
|
|
768
|
+
|
|
769
|
+
---
|
|
770
|
+
|
|
771
|
+
## Graceful Degradation
|
|
772
|
+
|
|
773
|
+
| Input Source | Available | Fallback |
|
|
774
|
+
|-------------|-----------|----------|
|
|
775
|
+
| Local manifest files | Always | N/A (primary input) |
|
|
776
|
+
| Deployed manifests (`--deployed`) | Requires MCP `graphql.query` | Ask user to export manifest JSON from settings and provide as local file |
|
|
777
|
+
| Translation files (i18n/) | Optional | Skip i18n cross-reference; report only i18n: prefix coverage from manifest strings |
|
|
778
|
+
| Plugin URL validation | Requires network | Classify by URL pattern only; skip HTTP HEAD checks |
|
|
779
|
+
| Source code (SDK projects) | Optional | Skip bundle dependency mapping; report custom aliases as "origin unknown" |
|
|
780
|
+
|
|
781
|
+
---
|
|
782
|
+
|
|
783
|
+
## Handoff Protocol
|
|
784
|
+
|
|
785
|
+
On completion:
|
|
786
|
+
|
|
787
|
+
```
|
|
788
|
+
-> REVIEW: accounts/<PROFILE>/analysis/mystique/manifest-analysis.md
|
|
789
|
+
-> NEXT: /fluent-mystique-validate (validate manifests with HIGH findings)
|
|
790
|
+
-> NEXT: /fluent-mystique-builder (fix issues, refactor duplicate pages, add fragments)
|
|
791
|
+
-> NEXT: /fluent-implementation-map (include UI analysis in full account map)
|
|
792
|
+
-> BLOCKED: No manifest files found at the specified path
|
|
793
|
+
-> BLOCKED: --deployed requires MCP graphql.query tool (not available)
|
|
794
|
+
```
|
|
795
|
+
|
|
796
|
+
## Error Reporting
|
|
797
|
+
|
|
798
|
+
| Error Type | Phase | Severity | Recovery |
|
|
799
|
+
|------------|-------|----------|----------|
|
|
800
|
+
| `PREREQ_MISSING` | Step 1 | CRITICAL | No manifest files found at specified path |
|
|
801
|
+
| `VALIDATION_FAILED` | Step 1 | MEDIUM | JSON parse error on manifest file -- skip file, continue with others |
|
|
802
|
+
| `ENV_UNREACHABLE` | Step 1 | HIGH | MCP unavailable for --deployed mode -- fall back to local files |
|
|
803
|
+
| `PREREQ_MISSING` | Step 6 | LOW | No translation files found -- skip i18n cross-reference |
|
|
804
|
+
|
|
805
|
+
## Session Tracking
|
|
806
|
+
|
|
807
|
+
Track: files written (`manifest-analysis.md`, `component-census.json`, `diagrams/*.mmd`), manifests analyzed (count, paths), MCP tools called (`graphql.query` if `--deployed`). No environment mutations -- this is a read-only skill.
|
|
808
|
+
|
|
809
|
+
## Tips
|
|
810
|
+
|
|
811
|
+
- **Start without --deep** for a quick overview. Add --deep when you need the full i18n cross-reference and pattern detection.
|
|
812
|
+
- **Use --mermaid** to generate diagrams for architecture reviews and stakeholder walkthroughs.
|
|
813
|
+
- **Point at a directory** to compare multiple manifests (admin, store, servicepoint) and find fragment opportunities.
|
|
814
|
+
- **Combine with --deployed** to analyze the live production manifest rather than a potentially stale local copy.
|
|
815
|
+
- **Large manifests** (>1000 lines): the skill processes by section/page rather than loading the entire manifest into context at once. Per-page analysis is streamed.
|
|
816
|
+
- **Fragment references** (`type:"reference"`, `settingName`): these point to separately deployed manifest fragments. When analyzing locally, the skill reports them as unresolved references. When analyzing with `--deployed`, the skill fetches and inlines them.
|
|
817
|
+
- **Custom component aliases** cannot be validated against a registry since they are defined in plugin bundles. The skill flags them as "custom" in the census but does not treat unknown aliases as errors (that is the validator's job).
|