@fluentcommerce/ai-skills 0.1.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 -622
- 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 -181
- 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 -1031
- 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 +63 -5
- 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 -0
- package/content/dev/agents/fluent-dev/agent.json +14 -2
- package/content/dev/agents/fluent-dev.md +194 -525
- 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 -192
- 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 +19 -2
- 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 +27 -2
- package/content/dev/skills/fluent-feature-plan/SKILL.md +478 -227
- 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 +64 -2
- 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 -1108
- package/content/dev/skills/fluent-retailer-config/SKILL.md +1162 -1111
- package/content/dev/skills/fluent-rollback/SKILL.md +387 -0
- package/content/dev/skills/fluent-rule-scaffold/SKILL.md +515 -385
- 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 +160 -1
- package/content/dev/skills/fluent-source-onboard/SKILL.md +31 -3
- package/content/dev/skills/fluent-sourcing/SKILL.md +1185 -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 -0
- package/content/dev/skills/fluent-use-case-discover/SPEC_TEMPLATE.md +281 -0
- package/content/dev/skills/fluent-version-manage/SKILL.md +53 -2
- package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +995 -959
- package/content/dev/skills/fluent-workflow-builder/SKILL.md +668 -319
- package/content/dev/skills/fluent-workflow-deploy/SKILL.md +480 -267
- package/content/dev/skills/fluent-workspace-tree/SKILL.md +281 -0
- package/content/mcp-extn/agents/fluent-mcp.md +133 -69
- package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +812 -461
- 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 -77
- 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 +909 -52
- package/metadata.json +184 -156
- package/package.json +3 -2
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
---
|
|
2
|
+
alias: "fc.workflow.provider"
|
|
3
|
+
aliases:
|
|
4
|
+
- fc.workflow.provider
|
|
5
|
+
category: layout
|
|
6
|
+
module: Core
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
# fc.workflow.provider
|
|
10
|
+
|
|
11
|
+
Data provider that fetches all workflows across all retailers and passes them as data context to its first descendant.
|
|
12
|
+
|
|
13
|
+
## When to Use
|
|
14
|
+
- Build a workflow management or listing page that needs access to all workflows in the account
|
|
15
|
+
- Provide workflow data context to downstream components like `fc.list` or `fc.card.attribute`
|
|
16
|
+
- Create a workflow explorer or configuration page
|
|
17
|
+
|
|
18
|
+
## Key Props
|
|
19
|
+
|
|
20
|
+
This component has no props. It fetches workflow data automatically on mount.
|
|
21
|
+
|
|
22
|
+
## Data Binding
|
|
23
|
+
Fetches workflows via the Fluent REST API (`/api/v4.1/workflow`) for each retailer the user has access to. The workflow data includes:
|
|
24
|
+
- `name` -- workflow name
|
|
25
|
+
- `version` -- workflow version string
|
|
26
|
+
- `entityType` -- target entity type (e.g. ORDER, FULFILMENT)
|
|
27
|
+
- `entitySubtype` -- entity subtype (e.g. HD, CC)
|
|
28
|
+
- `description` -- workflow description
|
|
29
|
+
- `createdBy` -- creator username
|
|
30
|
+
- `createdOn` -- creation timestamp
|
|
31
|
+
- `retailer` -- retailer ID
|
|
32
|
+
- `versionComment` -- optional version comment
|
|
33
|
+
|
|
34
|
+
The fetched workflows are passed to the first descendant via `dataOverride`.
|
|
35
|
+
|
|
36
|
+
## Descendants
|
|
37
|
+
Yes -- renders its first descendant (`index={0}`) with the workflow data injected as `dataOverride`. Shows a loading spinner while data is being fetched. Displays an error message if the fetch fails.
|
|
38
|
+
|
|
39
|
+
## Composition Patterns
|
|
40
|
+
- `fc.page` > `fc.workflow.provider` > `fc.list` for a workflow listing page
|
|
41
|
+
- `fc.page` > `fc.workflow.provider` > `fc.tabs.card` > workflow category tabs
|
|
42
|
+
|
|
43
|
+
## Gotchas
|
|
44
|
+
- Only the first descendant (`index={0}`) receives the data -- additional descendants are ignored.
|
|
45
|
+
- Fetches workflows for ALL retailers the user has access to, not just the active retailer. This can be slow on accounts with many retailers.
|
|
46
|
+
- Uses `@tanstack/react-query` for caching -- subsequent renders may use cached data.
|
|
47
|
+
- The REST API call uses `latest=true&count=100` -- only the latest version of each workflow is returned, up to 100 per retailer.
|
|
48
|
+
- Shows a loading spinner during fetch and an error message on failure -- no descendant is rendered until data is available.
|
|
49
|
+
- Registered with category `content` in the component registry.
|
|
50
|
+
|
|
51
|
+
## Manifest Example
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"component": "fc.workflow.provider",
|
|
55
|
+
"descendants": [
|
|
56
|
+
{
|
|
57
|
+
"component": "fc.list",
|
|
58
|
+
"props": {
|
|
59
|
+
"attributes": [
|
|
60
|
+
{ "label": "Name", "value": "{{name}}" },
|
|
61
|
+
{ "label": "Entity Type", "value": "{{entityType}}" },
|
|
62
|
+
{ "label": "Subtype", "value": "{{entitySubtype}}" },
|
|
63
|
+
{ "label": "Version", "value": "{{version}}" },
|
|
64
|
+
{ "label": "Retailer", "value": "{{retailer}}" }
|
|
65
|
+
],
|
|
66
|
+
"defaultPageSize": 25
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
]
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## AI Parse Notes
|
|
74
|
+
- **Primary intent:** Declarative Mystique component definition for manifests.
|
|
75
|
+
- **Selection signals:** Match by `alias`, category, and required `Key Props`.
|
|
76
|
+
- **Assembly hints:** Combine with compatible parent/child components listed in `Composition Patterns`.
|
|
77
|
+
- **Safety checks:** Validate required props and data bindings before manifest generation.
|
|
@@ -0,0 +1,260 @@
|
|
|
1
|
+
[CmdletBinding()]
|
|
2
|
+
param(
|
|
3
|
+
[switch]$Json
|
|
4
|
+
)
|
|
5
|
+
|
|
6
|
+
Set-StrictMode -Version Latest
|
|
7
|
+
$ErrorActionPreference = "Stop"
|
|
8
|
+
|
|
9
|
+
function Clean-Alias {
|
|
10
|
+
param(
|
|
11
|
+
[Parameter(Mandatory = $false)]
|
|
12
|
+
[string]$Value
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
if ([string]::IsNullOrWhiteSpace($Value)) {
|
|
16
|
+
return ""
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
$alias = ($Value -replace [char]7, "").Trim()
|
|
20
|
+
$match = [regex]::Match($alias, 'fc\.[A-Za-z0-9_.-]+')
|
|
21
|
+
if ($match.Success) {
|
|
22
|
+
return $match.Value
|
|
23
|
+
}
|
|
24
|
+
return ""
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function Get-UniqueAliases {
|
|
28
|
+
param(
|
|
29
|
+
[string[]]$Items
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
if ($null -eq $Items -or $Items.Count -eq 0) {
|
|
33
|
+
return @()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
$set = New-Object 'System.Collections.Generic.HashSet[string]'
|
|
37
|
+
foreach ($item in $Items) {
|
|
38
|
+
if (-not [string]::IsNullOrWhiteSpace($item)) {
|
|
39
|
+
[void]$set.Add($item)
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
$output = New-Object string[] $set.Count
|
|
43
|
+
$set.CopyTo($output)
|
|
44
|
+
return $output
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function Get-DocsAliases {
|
|
48
|
+
param(
|
|
49
|
+
[Parameter(Mandatory = $true)]
|
|
50
|
+
[string]$ComponentsDir
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
$docs = Get-ChildItem -Path $ComponentsDir -File -Filter "*.md" | Where-Object { $_.Name -ne "INDEX.md" }
|
|
54
|
+
$bell = [char]7
|
|
55
|
+
|
|
56
|
+
$aliases = @()
|
|
57
|
+
$docsWithAiParseNotes = 0
|
|
58
|
+
$docsWithBellChar = 0
|
|
59
|
+
$docsWithAliasFrontmatter = 0
|
|
60
|
+
|
|
61
|
+
foreach ($doc in $docs) {
|
|
62
|
+
$content = Get-Content -Path $doc.FullName -Raw
|
|
63
|
+
|
|
64
|
+
if ($content -match '(?m)^##\s+AI Parse Notes\b') {
|
|
65
|
+
$docsWithAiParseNotes++
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if ($content.Contains($bell)) {
|
|
69
|
+
$docsWithBellChar++
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
$frontmatter = [regex]::Match($content, '(?ms)^---\r?\n(.*?)\r?\n---')
|
|
73
|
+
if ($frontmatter.Success) {
|
|
74
|
+
$aliasMatch = [regex]::Match($frontmatter.Groups[1].Value, '(?m)^\s*alias\s*:\s*(.+?)\s*$')
|
|
75
|
+
if ($aliasMatch.Success) {
|
|
76
|
+
$docsWithAliasFrontmatter++
|
|
77
|
+
$alias = Clean-Alias -Value $aliasMatch.Groups[1].Value
|
|
78
|
+
if ($alias -like "fc.*") {
|
|
79
|
+
$aliases += $alias
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
return [pscustomobject]@{
|
|
86
|
+
Docs = $docs
|
|
87
|
+
Aliases = @(Get-UniqueAliases -Items $aliases)
|
|
88
|
+
DocsWithAiParseNotes = $docsWithAiParseNotes
|
|
89
|
+
DocsWithBellChar = $docsWithBellChar
|
|
90
|
+
DocsWithAliasFrontmatter = $docsWithAliasFrontmatter
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
function Get-RegistryAliases {
|
|
95
|
+
param(
|
|
96
|
+
[Parameter(Mandatory = $true)]
|
|
97
|
+
[string]$RegistryFile
|
|
98
|
+
)
|
|
99
|
+
|
|
100
|
+
$content = Get-Content -Path $RegistryFile -Raw
|
|
101
|
+
$sectionStart = [regex]::Match($content, '(?m)^##\s+Component Alias Registry\s*$')
|
|
102
|
+
if (-not $sectionStart.Success) {
|
|
103
|
+
return @()
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
$rest = $content.Substring($sectionStart.Index + $sectionStart.Length)
|
|
107
|
+
$nextSection = [regex]::Match($rest, '(?m)^##\s+')
|
|
108
|
+
if ($nextSection.Success) {
|
|
109
|
+
$rest = $rest.Substring(0, $nextSection.Index)
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
$aliases = @()
|
|
113
|
+
$lines = $rest -split "\r?\n"
|
|
114
|
+
foreach ($line in $lines) {
|
|
115
|
+
if (-not $line.Trim().StartsWith("|")) { continue }
|
|
116
|
+
if ($line -notmatch "fc\.") { continue }
|
|
117
|
+
|
|
118
|
+
$cells = $line -split "\|"
|
|
119
|
+
if ($cells.Length -lt 2) { continue }
|
|
120
|
+
$firstCell = $cells[1].Trim()
|
|
121
|
+
$aliasMatch = [regex]::Match($firstCell, 'fc\.[A-Za-z0-9_.-]+')
|
|
122
|
+
if ($aliasMatch.Success) {
|
|
123
|
+
$aliases += $aliasMatch.Value
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if ($aliases.Count -eq 0) {
|
|
128
|
+
return @()
|
|
129
|
+
}
|
|
130
|
+
return @(Get-UniqueAliases -Items $aliases)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
function Get-IndexAliases {
|
|
134
|
+
param(
|
|
135
|
+
[Parameter(Mandatory = $true)]
|
|
136
|
+
[string]$IndexFile
|
|
137
|
+
)
|
|
138
|
+
|
|
139
|
+
if (-not (Test-Path -Path $IndexFile)) {
|
|
140
|
+
return @()
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
$lines = Get-Content -Path $IndexFile
|
|
144
|
+
$aliases = @()
|
|
145
|
+
foreach ($line in $lines) {
|
|
146
|
+
if (-not $line.Trim().StartsWith("|")) { continue }
|
|
147
|
+
if ($line -notmatch "fc\.") { continue }
|
|
148
|
+
$cells = $line -split "\|"
|
|
149
|
+
if ($cells.Length -lt 2) { continue }
|
|
150
|
+
$aliasMatch = [regex]::Match($cells[1], 'fc\.[A-Za-z0-9_.-]+')
|
|
151
|
+
if ($aliasMatch.Success) {
|
|
152
|
+
$aliases += $aliasMatch.Value
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
if ($aliases.Count -eq 0) {
|
|
157
|
+
return @()
|
|
158
|
+
}
|
|
159
|
+
return @(Get-UniqueAliases -Items $aliases)
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
$scriptDir = Split-Path -Path $MyInvocation.MyCommand.Path -Parent
|
|
163
|
+
$componentsDir = Join-Path -Path $scriptDir -ChildPath "components"
|
|
164
|
+
$indexFile = Join-Path -Path $componentsDir -ChildPath "INDEX.md"
|
|
165
|
+
$registryFile = [System.IO.Path]::GetFullPath((Join-Path -Path $scriptDir -ChildPath "..\fluent-mystique-validate\SKILL.md"))
|
|
166
|
+
|
|
167
|
+
if (-not (Test-Path -Path $componentsDir)) {
|
|
168
|
+
throw "Components directory not found: $componentsDir"
|
|
169
|
+
}
|
|
170
|
+
if (-not (Test-Path -Path $registryFile)) {
|
|
171
|
+
throw "Registry file not found: $registryFile"
|
|
172
|
+
}
|
|
173
|
+
if (-not (Test-Path -Path $indexFile)) {
|
|
174
|
+
throw "Index file not found: $indexFile"
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
$docsData = Get-DocsAliases -ComponentsDir $componentsDir
|
|
178
|
+
$registryAliases = @(Get-RegistryAliases -RegistryFile $registryFile)
|
|
179
|
+
$indexAliases = @(Get-IndexAliases -IndexFile $indexFile)
|
|
180
|
+
|
|
181
|
+
$registryOnly = @($registryAliases | Where-Object { $_ -notin $docsData.Aliases } | Sort-Object)
|
|
182
|
+
$docsOnly = @($docsData.Aliases | Where-Object { $_ -notin $registryAliases } | Sort-Object)
|
|
183
|
+
$indexOnly = @($indexAliases | Where-Object { $_ -notin $docsData.Aliases } | Sort-Object)
|
|
184
|
+
$docsMissingInIndex = @($docsData.Aliases | Where-Object { $_ -notin $indexAliases } | Sort-Object)
|
|
185
|
+
|
|
186
|
+
$summary = [pscustomobject]@{
|
|
187
|
+
componentDocs = $docsData.Docs.Count
|
|
188
|
+
docsWithAiParseNotes = $docsData.DocsWithAiParseNotes
|
|
189
|
+
docsWithBellChar = $docsData.DocsWithBellChar
|
|
190
|
+
docsWithAliasFrontmatter = $docsData.DocsWithAliasFrontmatter
|
|
191
|
+
indexRows = $indexAliases.Count
|
|
192
|
+
registryAliases = $registryAliases.Count
|
|
193
|
+
documentedAliases = $docsData.Aliases.Count
|
|
194
|
+
missingInDocsCount = $registryOnly.Count
|
|
195
|
+
extraInDocsCount = $docsOnly.Count
|
|
196
|
+
indexOnlyCount = $indexOnly.Count
|
|
197
|
+
docsMissingInIndexCount = $docsMissingInIndex.Count
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
$report = [pscustomobject]@{
|
|
201
|
+
summary = $summary
|
|
202
|
+
missingInDocs = $registryOnly
|
|
203
|
+
extraInDocs = $docsOnly
|
|
204
|
+
indexOnly = $indexOnly
|
|
205
|
+
docsMissingInIndex = $docsMissingInIndex
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if ($Json) {
|
|
209
|
+
$report | ConvertTo-Json -Depth 5
|
|
210
|
+
} else {
|
|
211
|
+
Write-Host "Mystique Docs Validation"
|
|
212
|
+
Write-Host "========================"
|
|
213
|
+
Write-Host ("componentDocs : {0}" -f $summary.componentDocs)
|
|
214
|
+
Write-Host ("docsWithAiParseNotes : {0}" -f $summary.docsWithAiParseNotes)
|
|
215
|
+
Write-Host ("docsWithBellChar : {0}" -f $summary.docsWithBellChar)
|
|
216
|
+
Write-Host ("docsWithAliasFrontmatter : {0}" -f $summary.docsWithAliasFrontmatter)
|
|
217
|
+
Write-Host ("indexRows : {0}" -f $summary.indexRows)
|
|
218
|
+
Write-Host ("registryAliases : {0}" -f $summary.registryAliases)
|
|
219
|
+
Write-Host ("documentedAliases : {0}" -f $summary.documentedAliases)
|
|
220
|
+
Write-Host ("missingInDocsCount : {0}" -f $summary.missingInDocsCount)
|
|
221
|
+
Write-Host ("extraInDocsCount : {0}" -f $summary.extraInDocsCount)
|
|
222
|
+
Write-Host ("indexOnlyCount : {0}" -f $summary.indexOnlyCount)
|
|
223
|
+
Write-Host ("docsMissingInIndexCount : {0}" -f $summary.docsMissingInIndexCount)
|
|
224
|
+
|
|
225
|
+
if ($registryOnly.Count -gt 0) {
|
|
226
|
+
Write-Host ""
|
|
227
|
+
Write-Host "Missing in docs:"
|
|
228
|
+
$registryOnly | ForEach-Object { Write-Host (" - {0}" -f $_) }
|
|
229
|
+
}
|
|
230
|
+
if ($docsOnly.Count -gt 0) {
|
|
231
|
+
Write-Host ""
|
|
232
|
+
Write-Host "Extra in docs (not in registry):"
|
|
233
|
+
$docsOnly | ForEach-Object { Write-Host (" - {0}" -f $_) }
|
|
234
|
+
}
|
|
235
|
+
if ($indexOnly.Count -gt 0) {
|
|
236
|
+
Write-Host ""
|
|
237
|
+
Write-Host "Index-only aliases:"
|
|
238
|
+
$indexOnly | ForEach-Object { Write-Host (" - {0}" -f $_) }
|
|
239
|
+
}
|
|
240
|
+
if ($docsMissingInIndex.Count -gt 0) {
|
|
241
|
+
Write-Host ""
|
|
242
|
+
Write-Host "Docs missing from index:"
|
|
243
|
+
$docsMissingInIndex | ForEach-Object { Write-Host (" - {0}" -f $_) }
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
$failed = $false
|
|
248
|
+
if ($summary.componentDocs -ne $summary.docsWithAiParseNotes) { $failed = $true }
|
|
249
|
+
if ($summary.docsWithBellChar -gt 0) { $failed = $true }
|
|
250
|
+
if ($summary.componentDocs -ne $summary.docsWithAliasFrontmatter) { $failed = $true }
|
|
251
|
+
if ($summary.missingInDocsCount -gt 0) { $failed = $true }
|
|
252
|
+
if ($summary.extraInDocsCount -gt 0) { $failed = $true }
|
|
253
|
+
if ($summary.indexOnlyCount -gt 0) { $failed = $true }
|
|
254
|
+
if ($summary.docsMissingInIndexCount -gt 0) { $failed = $true }
|
|
255
|
+
|
|
256
|
+
if ($failed) {
|
|
257
|
+
exit 1
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
exit 0
|