@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.

Files changed (168) hide show
  1. package/README.md +866 -622
  2. package/bin/cli.mjs +2112 -1973
  3. package/content/cli/agents/fluent-cli/agent.json +149 -149
  4. package/content/cli/agents/fluent-cli.md +132 -132
  5. package/content/cli/skills/fluent-bootstrap/SKILL.md +214 -181
  6. package/content/cli/skills/fluent-cli-index/SKILL.md +1 -1
  7. package/content/cli/skills/fluent-cli-mcp-cicd/SKILL.md +117 -1
  8. package/content/cli/skills/fluent-cli-reference/SKILL.md +1040 -1031
  9. package/content/cli/skills/fluent-cli-retailer/SKILL.md +27 -2
  10. package/content/cli/skills/fluent-cli-settings/SKILL.md +21 -1
  11. package/content/cli/skills/fluent-connect/SKILL.md +937 -886
  12. package/content/cli/skills/fluent-module-deploy/SKILL.md +63 -5
  13. package/content/cli/skills/fluent-profile/SKILL.md +73 -0
  14. package/content/cli/skills/fluent-workflow/SKILL.md +360 -310
  15. package/content/dev/agents/fluent-backend-dev/AGENT.md +58 -0
  16. package/content/dev/agents/fluent-backend-dev/agent.json +69 -0
  17. package/content/dev/agents/fluent-backend-dev.md +287 -0
  18. package/content/dev/agents/fluent-dev/AGENT.md +98 -0
  19. package/content/dev/agents/fluent-dev/agent.json +14 -2
  20. package/content/dev/agents/fluent-dev.md +194 -525
  21. package/content/dev/agents/fluent-frontend-dev/AGENT.md +63 -0
  22. package/content/dev/agents/fluent-frontend-dev/agent.json +52 -0
  23. package/content/dev/agents/fluent-frontend-dev.md +323 -0
  24. package/content/dev/skills/fluent-archive/SKILL.md +234 -0
  25. package/content/dev/skills/fluent-build/SKILL.md +312 -192
  26. package/content/dev/skills/fluent-connection-analysis/SKILL.md +422 -386
  27. package/content/dev/skills/fluent-custom-code/SKILL.md +15 -9
  28. package/content/dev/skills/fluent-data-module-scaffold/SKILL.md +19 -2
  29. package/content/dev/skills/fluent-e2e-test/SKILL.md +501 -394
  30. package/content/dev/skills/fluent-event-api/SKILL.md +962 -945
  31. package/content/dev/skills/fluent-feature-explain/SKILL.md +680 -603
  32. package/content/dev/skills/fluent-feature-plan/PLAN_TEMPLATE.md +27 -2
  33. package/content/dev/skills/fluent-feature-plan/SKILL.md +478 -227
  34. package/content/dev/skills/fluent-feature-status/SKILL.md +335 -0
  35. package/content/dev/skills/fluent-feedback/SKILL.md +221 -0
  36. package/content/dev/skills/fluent-implementation-map/SKILL.md +644 -0
  37. package/content/dev/skills/fluent-job-batch/SKILL.md +10 -0
  38. package/content/dev/skills/fluent-module-scaffold/SKILL.md +64 -2
  39. package/content/dev/skills/fluent-module-validate/SKILL.md +778 -775
  40. package/content/dev/skills/fluent-mystique-analyze/SKILL.md +817 -0
  41. package/content/dev/skills/fluent-mystique-builder/COMPONENT_TEMPLATE.md +81 -0
  42. package/content/dev/skills/fluent-mystique-builder/README.md +63 -0
  43. package/content/dev/skills/fluent-mystique-builder/SKILL.md +1294 -0
  44. package/content/dev/skills/fluent-mystique-builder/components/INDEX.md +92 -0
  45. package/content/dev/skills/fluent-mystique-builder/components/fc.accordion.md +48 -0
  46. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.fulfilmentpack.md +20 -0
  47. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.multiparcel.md +21 -0
  48. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.returnitems.md +21 -0
  49. package/content/dev/skills/fluent-mystique-builder/components/fc.action.field.wavepick.md +21 -0
  50. package/content/dev/skills/fluent-mystique-builder/components/fc.action.inline.md +24 -0
  51. package/content/dev/skills/fluent-mystique-builder/components/fc.activity.entity.md +25 -0
  52. package/content/dev/skills/fluent-mystique-builder/components/fc.analytics.viz.md +20 -0
  53. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.column.md +111 -0
  54. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.json.md +20 -0
  55. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.jsoneditor.md +54 -0
  56. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.locationId.md +51 -0
  57. package/content/dev/skills/fluent-mystique-builder/components/fc.attribute.retailerId.md +52 -0
  58. package/content/dev/skills/fluent-mystique-builder/components/fc.button.bar.md +57 -0
  59. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.download.md +53 -0
  60. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.compatibility.md +60 -0
  61. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.inline.md +53 -0
  62. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.md +24 -0
  63. package/content/dev/skills/fluent-mystique-builder/components/fc.button.print.pick.md +61 -0
  64. package/content/dev/skills/fluent-mystique-builder/components/fc.buttons.add.reject.md +20 -0
  65. package/content/dev/skills/fluent-mystique-builder/components/fc.card.attribute.md +73 -0
  66. package/content/dev/skills/fluent-mystique-builder/components/fc.card.attributes.grid.md +40 -0
  67. package/content/dev/skills/fluent-mystique-builder/components/fc.card.image.md +37 -0
  68. package/content/dev/skills/fluent-mystique-builder/components/fc.card.map.point.md +24 -0
  69. package/content/dev/skills/fluent-mystique-builder/components/fc.card.multi.md +79 -0
  70. package/content/dev/skills/fluent-mystique-builder/components/fc.card.product.md +27 -0
  71. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.md +34 -0
  72. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.area.wrapper.feed.md +98 -0
  73. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.md +52 -0
  74. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.bar.wrapper.source.md +104 -0
  75. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.md +28 -0
  76. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.gauge.wrapper.threshold.md +118 -0
  77. package/content/dev/skills/fluent-mystique-builder/components/fc.chart.line.md +32 -0
  78. package/content/dev/skills/fluent-mystique-builder/components/fc.conditional.md +62 -0
  79. package/content/dev/skills/fluent-mystique-builder/components/fc.dashboard.threshold.md +65 -0
  80. package/content/dev/skills/fluent-mystique-builder/components/fc.daterange.wrapper.forwarder.md +56 -0
  81. package/content/dev/skills/fluent-mystique-builder/components/fc.drawer.button.md +21 -0
  82. package/content/dev/skills/fluent-mystique-builder/components/fc.event.detail.md +20 -0
  83. package/content/dev/skills/fluent-mystique-builder/components/fc.events.search.md +21 -0
  84. package/content/dev/skills/fluent-mystique-builder/components/fc.field.daterange.md +83 -0
  85. package/content/dev/skills/fluent-mystique-builder/components/fc.field.filterComplex.md +106 -0
  86. package/content/dev/skills/fluent-mystique-builder/components/fc.field.intrange.md +82 -0
  87. package/content/dev/skills/fluent-mystique-builder/components/fc.field.multistring.md +50 -0
  88. package/content/dev/skills/fluent-mystique-builder/components/fc.filterPanel.md +53 -0
  89. package/content/dev/skills/fluent-mystique-builder/components/fc.json.editor.md +22 -0
  90. package/content/dev/skills/fluent-mystique-builder/components/fc.json.viewer.md +21 -0
  91. package/content/dev/skills/fluent-mystique-builder/components/fc.list.customAction.md +79 -0
  92. package/content/dev/skills/fluent-mystique-builder/components/fc.list.md +116 -0
  93. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.bppmetrics.md +69 -0
  94. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.feed.md +65 -0
  95. package/content/dev/skills/fluent-mystique-builder/components/fc.list.wrapper.source.md +64 -0
  96. package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.addItem.md +60 -0
  97. package/content/dev/skills/fluent-mystique-builder/components/fc.modal.button.md +21 -0
  98. package/content/dev/skills/fluent-mystique-builder/components/fc.mutation.inline.md +88 -0
  99. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.attributes.md +83 -0
  100. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.collapsible.text.md +33 -0
  101. package/content/dev/skills/fluent-mystique-builder/components/fc.mystique.link.md +30 -0
  102. package/content/dev/skills/fluent-mystique-builder/components/fc.order.itemDetails.md +20 -0
  103. package/content/dev/skills/fluent-mystique-builder/components/fc.order.shipmentDetails.md +20 -0
  104. package/content/dev/skills/fluent-mystique-builder/components/fc.page.filter.select.md +87 -0
  105. package/content/dev/skills/fluent-mystique-builder/components/fc.page.md +64 -0
  106. package/content/dev/skills/fluent-mystique-builder/components/fc.page.refresh.md +48 -0
  107. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.column.md +71 -0
  108. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.header.md +61 -0
  109. package/content/dev/skills/fluent-mystique-builder/components/fc.page.section.md +59 -0
  110. package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.md +45 -0
  111. package/content/dev/skills/fluent-mystique-builder/components/fc.page.wizard.summary.md +56 -0
  112. package/content/dev/skills/fluent-mystique-builder/components/fc.progress.circular.md +20 -0
  113. package/content/dev/skills/fluent-mystique-builder/components/fc.provider.graphql.md +71 -0
  114. package/content/dev/skills/fluent-mystique-builder/components/fc.quantity.list.md +87 -0
  115. package/content/dev/skills/fluent-mystique-builder/components/fc.repeater.md +56 -0
  116. package/content/dev/skills/fluent-mystique-builder/components/fc.reports.ipuipc.md +54 -0
  117. package/content/dev/skills/fluent-mystique-builder/components/fc.return.rowExpansion.md +19 -0
  118. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcode.md +21 -0
  119. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.barcodeFilter.md +72 -0
  120. package/content/dev/skills/fluent-mystique-builder/components/fc.scanner.camera.md +20 -0
  121. package/content/dev/skills/fluent-mystique-builder/components/fc.settingForm.md +64 -0
  122. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.drawer.button.md +19 -0
  123. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.profile.modal.button.md +64 -0
  124. package/content/dev/skills/fluent-mystique-builder/components/fc.sourcing.strategy.modal.button.md +20 -0
  125. package/content/dev/skills/fluent-mystique-builder/components/fc.stepper.md +20 -0
  126. package/content/dev/skills/fluent-mystique-builder/components/fc.tab.content.md +56 -0
  127. package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.card.md +64 -0
  128. package/content/dev/skills/fluent-mystique-builder/components/fc.tabs.md +69 -0
  129. package/content/dev/skills/fluent-mystique-builder/components/fc.tile.metric.md +73 -0
  130. package/content/dev/skills/fluent-mystique-builder/components/fc.workflow.provider.md +77 -0
  131. package/content/dev/skills/fluent-mystique-builder/validate-docs.ps1 +260 -0
  132. package/content/dev/skills/fluent-mystique-scaffold/SKILL.md +1830 -0
  133. package/content/dev/skills/fluent-mystique-validate/SKILL.md +646 -0
  134. package/content/dev/skills/fluent-pre-deploy-check/SKILL.md +1144 -1108
  135. package/content/dev/skills/fluent-retailer-config/SKILL.md +1162 -1111
  136. package/content/dev/skills/fluent-rollback/SKILL.md +387 -0
  137. package/content/dev/skills/fluent-rule-scaffold/SKILL.md +515 -385
  138. package/content/dev/skills/fluent-scope-decompose/SKILL.md +1123 -1021
  139. package/content/dev/skills/fluent-session-audit-export/SKILL.md +880 -632
  140. package/content/dev/skills/fluent-session-summary/SKILL.md +320 -195
  141. package/content/dev/skills/fluent-settings/SKILL.md +160 -1
  142. package/content/dev/skills/fluent-source-onboard/SKILL.md +31 -3
  143. package/content/dev/skills/fluent-sourcing/SKILL.md +1185 -0
  144. package/content/dev/skills/fluent-system-monitoring/SKILL.md +771 -767
  145. package/content/dev/skills/fluent-test-data/SKILL.md +514 -513
  146. package/content/dev/skills/fluent-trace/SKILL.md +1169 -1143
  147. package/content/dev/skills/fluent-transition-api/SKILL.md +364 -346
  148. package/content/dev/skills/fluent-use-case-discover/SKILL.md +593 -0
  149. package/content/dev/skills/fluent-use-case-discover/SPEC_TEMPLATE.md +281 -0
  150. package/content/dev/skills/fluent-version-manage/SKILL.md +53 -2
  151. package/content/dev/skills/fluent-workflow-analyzer/SKILL.md +995 -959
  152. package/content/dev/skills/fluent-workflow-builder/SKILL.md +668 -319
  153. package/content/dev/skills/fluent-workflow-deploy/SKILL.md +480 -267
  154. package/content/dev/skills/fluent-workspace-tree/SKILL.md +281 -0
  155. package/content/mcp-extn/agents/fluent-mcp.md +133 -69
  156. package/content/mcp-extn/skills/fluent-mcp-tools/SKILL.md +812 -461
  157. package/content/mcp-official/agents/fluent-mcp-core.md +91 -91
  158. package/content/mcp-official/skills/fluent-mcp-core/SKILL.md +94 -94
  159. package/content/rfl/skills/fluent-rfl-assess/SKILL.md +172 -172
  160. package/docs/CAPABILITY_MAP.md +106 -77
  161. package/docs/DEPLOYMENT_PROMOTION_RUNBOOK.md +218 -0
  162. package/docs/DESIGN-implementation-map.md +698 -0
  163. package/docs/DEV_WORKFLOW.md +814 -802
  164. package/docs/FLOW_RUN.md +142 -142
  165. package/docs/GETTING_STARTED.md +427 -0
  166. package/docs/USE_CASES.md +909 -52
  167. package/metadata.json +184 -156
  168. package/package.json +3 -2
@@ -1,1021 +1,1123 @@
1
- ---
2
- name: fluent-scope-decompose
3
- description: Decompose a structured scope document into an ordered task list with dependencies, skill mappings, and ambiguity detection. Converts ADD scope packs into executable agent work plans. Triggers on "decompose scope", "plan from scope", "task breakdown", "scope to tasks", "parse scope document".
4
- user-invocable: true
5
- allowed-tools: Bash, Read, Write, Edit, Glob, Grep
6
- argument-hint: <scope-file-path> [--output-format json|markdown] [--validate-only]
7
- ---
8
-
9
- # Scope-to-Task Decomposition
10
-
11
- Parse a structured scope document (Markdown following the ADD template) and produce a JSON task list with dependency ordering, skill mappings, and ambiguity flags. This bridges the gap between human-authored scope and agent-executable work — ADD Phase 2: Agent Planning.
12
-
13
- ## Ownership Boundary
14
-
15
- This skill owns scope document parsing, task generation, dependency DAG construction, ambiguity detection, and the output task list artifact.
16
-
17
- Other skills own:
18
- - Module scaffolding execution --> `/fluent-module-scaffold`
19
- - Rule scaffolding execution --> `/fluent-rule-scaffold`
20
- - Workflow editing --> `/fluent-workflow-builder`
21
- - Build orchestration --> `/fluent-build`
22
- - Deployment --> `/fluent-module-deploy`
23
- - Session orchestration across tasks --> `/fluent-dev` agent
24
-
25
- This skill produces the plan; other skills execute it.
26
-
27
- ## When to Use
28
-
29
- - A structured scope document (ADD template) exists and needs to be converted into an actionable work plan
30
- - Starting a new module development cycle and need to know what tasks are required
31
- - Validating a scope document for completeness before agent work begins
32
- - Generating a traceability matrix from stories to tasks
33
- - Identifying ambiguities or gaps in a scope document that need human resolution before agents can proceed
34
-
35
- ## Inputs
36
-
37
- | Parameter | Required | Default | Description |
38
- |-----------|----------|---------|-------------|
39
- | `scope-file-path` | Yes | -- | Path to the scope document (Markdown) |
40
- | `--output-format` | No | `json` | Output format: `json` (machine-readable) or `markdown` (human-readable) |
41
- | `--validate-only` | No | `false` | Only validate the scope document structure without generating tasks |
42
- | `--profile` | No | Active profile | Target Fluent profile for environment-aware decomposition |
43
-
44
- ## Scope Document Format
45
-
46
- The skill expects a Markdown document with sections following the ADD template. All section headings are case-insensitive. Sections may appear in any order. The `Module` and `Objective` sections are required; all others are optional but recommended.
47
-
48
- ```markdown
49
- # Module
50
- <module-identifier>
51
-
52
- ## Objective
53
- <business context and goal>
54
-
55
- ## User stories
56
- - [US-NNN] As a <role>, I can <action>
57
- - [US-NNN] As a <role>, I can <action>
58
-
59
- ## Acceptance criteria
60
- - Given <condition>, when <trigger>, then <outcome>
61
- - Given <condition>, when <trigger>, then <outcome>
62
-
63
- ## Non-functional requirements
64
- - <requirement with measurable threshold>
65
-
66
- ## Constraints
67
- - <constraint_keyword>
68
-
69
- ## Interfaces
70
- - <system/module name> (<details>)
71
-
72
- ## Conventions
73
- - <convention>
74
-
75
- ## Artifacts requested
76
- - <artifact-type> (<details>)
77
-
78
- ## Deployment targets
79
- - <target-account/retailer>
80
- - feature flag: <flag.name>
81
- ```
82
-
83
- ### Section Extraction Rules
84
-
85
- Each section maps to specific task properties during decomposition:
86
-
87
- | Section | Extraction Logic | Maps To |
88
- |---------|-----------------|---------|
89
- | `Module` | First non-empty line after heading | `task.module` for all generated tasks; used as directory/file name stem |
90
- | `Objective` | All text until next heading | `task.context` injected as business context into every generated task description |
91
- | `User stories` | Parse lines matching `[US-NNN]` pattern; extract identifier + role + action | Individual task groups each story generates one or more tasks |
92
- | `Acceptance criteria` | Parse Given/When/Then triples (single-line or multi-line Gherkin) | `task.acceptanceCriteria[]` on the corresponding TEST tasks |
93
- | `Non-functional requirements` | Parse as constraint list; extract numeric thresholds where present | Quality gate parameters on BUILD, TEST_E2E, and CHECKLIST tasks |
94
- | `Constraints` | Keyword extraction (`backward_compatible`, `no_pii_in_logs`, etc.) | `constraints` object applied as guard rails across all generated tasks |
95
- | `Interfaces` | System/module names with optional details | Dependency declarations; flag as ambiguity if no skill mapping exists |
96
- | `Conventions` | Free text conventions | Injected into SCAFFOLD and BUILD task descriptions |
97
- | `Artifacts requested` | Artifact type keywords (Code, Workflow, Tests, Docs, etc.) | Drive task type assignments each artifact maps to one or more task types |
98
- | `Deployment targets` | Account/retailer refs and feature flags | DEPLOY and CONFIG task targets |
99
-
100
- ### Story Identifier Parsing
101
-
102
- Story identifiers follow the pattern `[US-NNN]` where NNN is any alphanumeric sequence. The parser:
103
-
104
- 1. Scans each bullet line under `## User stories` for a `[` prefix
105
- 2. Extracts the identifier between `[` and `]`
106
- 3. Extracts the description after the `]` (trimmed)
107
- 4. Deduplicates by identifier if the same ID appears twice, flag as ambiguity
108
-
109
- ### Acceptance Criteria Parsing
110
-
111
- Acceptance criteria follow Given/When/Then structure. The parser supports:
112
-
113
- - **Single-line:** `Given X, when Y, then Z`
114
- - **Multi-line Gherkin:**
115
- ```
116
- - Given multiple profile variants and a traffic split
117
- When requests are routed
118
- Then variants receive traffic according to the split within +/-1% error
119
- ```
120
- - **Free-form:** Lines not matching Given/When/Then are treated as unstructured criteria and attached verbatim
121
-
122
- Criteria are linked to stories by proximity or explicit `[US-NNN]` references within the criteria text.
123
-
124
- ## Task List JSON Schema
125
-
126
- The output is a JSON document containing the full decomposition:
127
-
128
- ```json
129
- {
130
- "schema": "scope-decomposition-v1",
131
- "scopeDocument": "path/to/scope.md",
132
- "module": "fcx.sourcing.abtesting",
133
- "generatedAt": "2026-02-23T10:00:00Z",
134
- "profile": "HMDEV",
135
- "tasks": [
136
- {
137
- "id": "T-001",
138
- "type": "SCAFFOLD",
139
- "title": "Scaffold module fcx.sourcing.abtesting",
140
- "description": "Create module skeleton with entity types ORDER, FULFILMENT",
141
- "skill": "fluent-module-scaffold",
142
- "dependsOn": [],
143
- "storyRef": null,
144
- "inputs": {
145
- "module-name": "sourcing-abtesting",
146
- "entity-types": ["ORDER"]
147
- },
148
- "acceptanceCriteria": [],
149
- "priority": 1,
150
- "status": "pending"
151
- }
152
- ],
153
- "ambiguities": [],
154
- "constraints": {},
155
- "traceabilityMatrix": {},
156
- "nfrs": [],
157
- "deploymentTargets": []
158
- }
159
- ```
160
-
161
- ### Task Fields
162
-
163
- | Field | Type | Description |
164
- |-------|------|-------------|
165
- | `id` | string | Unique identifier, pattern `T-NNN` (zero-padded, assigned in topological order) |
166
- | `type` | string | One of the task types from the Task Types table below |
167
- | `title` | string | Human-readable summary of what this task does |
168
- | `description` | string | Detailed description including business context from Objective |
169
- | `skill` | string | The exact skill name to invoke for execution (e.g., `fluent-rule-scaffold`) |
170
- | `dependsOn` | string[] | Array of task IDs that must complete before this task can start |
171
- | `storyRef` | string or null | The `[US-NNN]` identifier this task traces to, or null for infrastructure tasks |
172
- | `inputs` | object | Key-value pairs passed to the skill at execution time |
173
- | `acceptanceCriteria` | string[] | Given/When/Then triples that define done for this task |
174
- | `priority` | number | Execution order (1 = first); derived from topological sort position |
175
- | `status` | string | Always `"pending"` at generation time |
176
-
177
- ## Task Types
178
-
179
- Every task has a type that determines which skill executes it and what its default dependencies are.
180
-
181
- | Type | Skill Mapping | Description | Typical Dependencies |
182
- |------|--------------|-------------|---------------------|
183
- | `SCAFFOLD` | `fluent-module-scaffold` | Create new module skeleton with Maven structure, module.json, build scripts | None (always first for new modules) |
184
- | `EXTEND` | `fluent-rule-scaffold` | Add rules/functionality to an existing module whose source is already in `SOURCE/` | SOURCE_ONBOARD (if source was missing) or none (if source already present) |
185
- | `SOURCE_ONBOARD` | `fluent-custom-code` | Clone repo or obtain source code for an existing deployed module into `accounts/<PROFILE>/SOURCE/` and analyze it | None (always first for extending existing modules) |
186
- | `RULE` | `fluent-rule-scaffold` | Scaffold a new Rubix rule class with @RuleInfo, parameters, and test skeleton | SCAFFOLD or EXTEND |
187
- | `WORKFLOW` | `fluent-workflow-builder` | Create or modify workflow JSON add rulesets, statuses, triggers | RULE (rules must exist before wiring into rulesets) |
188
- | `SETTING` | `fluent-settings` | Create or update retailer/account settings required by rules | SCAFFOLD or EXTEND |
189
- | `TEST_UNIT` | `fluent-build` | Write or run unit tests for rule classes | RULE |
190
- | `TEST_E2E` | `fluent-e2e-test` | Run end-to-end test sequences against deployed workflows | WORKFLOW_DEPLOY, DEPLOY |
191
- | `BUILD` | `fluent-build` | Compile, package, and produce deployable ZIP artifact | RULE, WORKFLOW (all code changes must be complete) |
192
- | `DEPLOY` | `fluent-module-deploy` | Deploy module ZIP to target Fluent account/retailer | BUILD, VALIDATE |
193
- | `WORKFLOW_DEPLOY` | `fluent-workflow` | Upload workflow JSON to target retailer | WORKFLOW |
194
- | `CONFIG` | `fluent-retailer-config` | Configure retailer-level settings, feature flags, and sample data | DEPLOY (retailer must have module installed) |
195
- | `VALIDATE` | `fluent-module-validate` | Run structural validation on the module before deployment | BUILD |
196
- | `ANALYZE` | `fluent-connection-analysis` | Analyze workflow connection topology and cross-entity event flows | WORKFLOW_DEPLOY |
197
- | `DOC` | Manual / agent | Generate README, Confluence pages, or other documentation | BUILD |
198
- | `VERSION` | `fluent-version-manage` | Bump semver version, update CHANGELOG, sync all version files | BUILD passes |
199
- | `CHECKLIST` | `fluent-pre-deploy-check` | Run full pre-deployment checklist across all gates | All prior tasks |
200
-
201
- ## Dependency Resolution Algorithm
202
-
203
- The skill constructs a directed acyclic graph (DAG) of task dependencies and produces a topologically sorted execution order.
204
-
205
- ### Step 1: Environment-Aware Module Decision
206
-
207
- **Before generating any tasks, determine whether this is a new module or an extension of an existing one.**
208
-
209
- ```
210
- 1. Extract module name from scope document's ## Module section
211
-
212
- 2. Search local workspace for existing source:
213
- Glob: accounts/<PROFILE>/SOURCE/*/resources/module.json
214
- Parse each module.json → build list of local modules with their rule names
215
-
216
- 3. Query deployed modules in live environment:
217
- MCP tool: plugin.list (compact: true)
218
- Parse rule keys → extract module names (group by ACCOUNT prefix)
219
-
220
- 4. Decision tree:
221
- ├── Module source found in accounts/<PROFILE>/SOURCE/?
222
- │ └── YES EXTEND path
223
- │ - Generate EXTEND task (not SCAFFOLD)
224
- │ - RULE tasks depend on EXTEND
225
- │ - inputs.existingModulePath = path to source directory
226
-
227
- ├── Module deployed (rules in plugin.list) but NO source in SOURCE/?
228
- └── SOURCE_ONBOARD path
229
- │ - Generate SOURCE_ONBOARD task first (clone repo / obtain source)
230
- │ - Generate EXTEND task (depends on SOURCE_ONBOARD)
231
- - RULE tasks depend on EXTEND
232
- │ - Flag ambiguity if repo URL is unknown
233
-
234
- └── Module NOT found anywhere?
235
- └── SCAFFOLD path (new module)
236
- - Generate SCAFFOLD task
237
- - RULE tasks depend on SCAFFOLD
238
- ```
239
-
240
- ### Step 2: Generate Tasks from Scope Sections
241
-
242
- ```
243
- For each section in the scope document:
244
- Module -> generate 1 SCAFFOLD, EXTEND, or SOURCE_ONBOARD+EXTEND task (per Step 1 decision)
245
- User stories -> for each story, generate RULE and/or WORKFLOW tasks based on story content
246
- Acceptance criteria -> generate TEST_UNIT and TEST_E2E tasks
247
- Artifacts requested -> generate task types matching the artifact keyword:
248
- "Code" -> RULE (if not already generated from stories)
249
- "Workflow" -> WORKFLOW
250
- "Tests" -> TEST_UNIT + TEST_E2E
251
- "Docs" -> DOC
252
- "Settings" -> SETTING
253
- "OMX Components" -> flag as ambiguity (no skill mapping)
254
- Deployment targets -> generate DEPLOY, WORKFLOW_DEPLOY, CONFIG tasks
255
- Always generate: BUILD, VALIDATE, VERSION, CHECKLIST (infrastructure tasks)
256
- ```
257
-
258
- ### Step 3: Build Dependency Edges
259
-
260
- Apply these rules to construct edges in the DAG:
261
-
262
- ```
263
- SCAFFOLD -> no dependencies (new module path)
264
- SOURCE_ONBOARD -> no dependencies (extend-without-source path)
265
- EXTEND -> depends on SOURCE_ONBOARD if source was missing; else no dependencies
266
- RULE -> depends on SCAFFOLD (new) or EXTEND (existing)
267
- WORKFLOW -> depends on all RULE tasks that the workflow references
268
- SETTING -> depends on SCAFFOLD or EXTEND
269
- TEST_UNIT -> depends on the RULE task it tests
270
- BUILD -> depends on all RULE + WORKFLOW + SETTING tasks
271
- VALIDATE -> depends on BUILD
272
- DEPLOY -> depends on BUILD + VALIDATE
273
- WORKFLOW_DEPLOY -> depends on all WORKFLOW tasks
274
- TEST_E2E -> depends on DEPLOY + WORKFLOW_DEPLOY
275
- CONFIG -> depends on DEPLOY
276
- DOC -> depends on BUILD
277
- VERSION -> depends on BUILD (build must pass before version bump)
278
- CHECKLIST -> depends on all other tasks (always last)
279
- ```
280
-
281
- ### Step 4: Cycle Detection
282
-
283
- Run a depth-first search on the DAG. If a back edge is found, report the cycle and abort with an error:
284
-
285
- ```
286
- ERROR: Circular dependency detected: T-003 -> T-005 -> T-008 -> T-003
287
- Resolve the cycle in the scope document before decomposition can proceed.
288
- ```
289
-
290
- ### Step 5: Topological Sort
291
-
292
- Perform Kahn's algorithm (BFS-based topological sort) on the validated DAG:
293
-
294
- ```
295
- 1. Compute in-degree for each task node
296
- 2. Enqueue all nodes with in-degree 0
297
- 3. While queue is not empty:
298
- a. Dequeue node, assign next priority number
299
- b. For each outgoing edge, decrement target in-degree
300
- c. If target in-degree reaches 0, enqueue it
301
- 4. If processed count < total tasks -> cycle exists (caught in Step 3)
302
- ```
303
-
304
- The priority field on each task reflects its position in the topological order.
305
-
306
- ## Ambiguity Detection
307
-
308
- The skill flags ambiguities that require human resolution before agents can execute the task list.
309
-
310
- | Condition | Severity | Detection Rule | Example |
311
- |-----------|----------|---------------|---------|
312
- | Interface has no skill mapping | HIGH | Interface name does not match any known skill or MCP tool | "Fluent Analytics (Google Looker)" -- no skill covers Looker dashboard creation |
313
- | Acceptance criteria references unmeasurable metric | MEDIUM | Criteria contains percentage, statistical term, or threshold that cannot be verified by existing test tools | "within +/-1% error over sufficient volume" -- needs statistical validation |
314
- | User story lacks acceptance criteria | HIGH | Story ID from `## User stories` has no matching criteria in `## Acceptance criteria` | Story [US-203] exists but no Given/When/Then references it |
315
- | Artifact type has no skill mapping | MEDIUM | Artifact keyword does not match any known task type | "OMX Components" -- no skill covers OMX creation |
316
- | Constraint keyword is unknown | LOW | Keyword not in known set: `backward_compatible`, `no_pii_in_logs`, `no_breaking_changes`, `idempotent`, `audit_trail` | "gdpr_compliant" -- recognized but no automated enforcement |
317
- | Non-functional requirement lacks threshold | MEDIUM | NFR line has no numeric value or measurable bound | "high availability" without an SLA percentage |
318
- | Duplicate story identifiers | HIGH | Two or more stories share the same `[US-NNN]` identifier | `[US-201]` appears twice with different descriptions |
319
- | Deployment target unresolvable | MEDIUM | Target does not match known profile/retailer pattern | "fluent:account/retailer-demo" when no matching profile exists |
320
-
321
- ### Ambiguity Output Format
322
-
323
- ```json
324
- {
325
- "section": "Interfaces",
326
- "item": "Fluent Analytics (Google Looker)",
327
- "issue": "No skill or MCP tool covers Looker dashboard creation. Requires manual implementation or external tooling.",
328
- "severity": "HIGH"
329
- }
330
- ```
331
-
332
- ## Traceability Matrix
333
-
334
- The skill produces a mapping from every user story to the tasks generated from it, enabling end-to-end traceability from requirement to implementation:
335
-
336
- ```json
337
- {
338
- "US-201": ["T-002", "T-003", "T-007", "T-012"],
339
- "US-202": ["T-004", "T-005", "T-008"],
340
- "US-203": ["T-006", "T-009"]
341
- }
342
- ```
343
-
344
- **Coverage validation:** After building the matrix, check that:
345
- 1. Every story has at least one task -> if not, flag as ambiguity (story with no work)
346
- 2. Every task with a `storyRef` maps back to a valid story -> if not, flag as orphaned task
347
- 3. Every story has at least one TEST task -> if not, flag as untested story (severity: HIGH)
348
-
349
- ## Execution Flow
350
-
351
- ```
352
- 1. READ scope document from file path
353
- - Validate file exists and is readable
354
- - Parse as Markdown (split by heading levels)
355
-
356
- 2. VALIDATE structure:
357
- a. Check required sections present (Module, Objective)
358
- b. Check recommended sections present (User stories, Acceptance criteria, Artifacts)
359
- c. Parse user story identifiers [US-NNN] — validate uniqueness
360
- d. Parse acceptance criteria — extract Given/When/Then triples
361
- e. Parse constraints — extract known keywords
362
- f. If --validate-only:
363
- - Report section presence/absence table
364
- - Report parsed story count, criteria count, constraint count
365
- - Report any structural issues found
366
- - STOP (do not generate tasks)
367
-
368
- 3. DECOMPOSE into tasks:
369
- a. Run environment-aware module decision (see Dependency Resolution Step 1):
370
- - Search accounts/<PROFILE>/SOURCE/ for existing module source
371
- - Query plugin.list for deployed custom rules
372
- - Decision: SCAFFOLD (new) / EXTEND (source available) / SOURCE_ONBOARD+EXTEND (deployed but no source)
373
- - Extract module name, derive entity types from stories/interfaces
374
- b. For each user story, generate RULE and/or WORKFLOW tasks
375
- - Analyze story text for rule-like behavior ("route", "allocate", "validate")
376
- - Analyze story text for workflow-like behavior ("status", "transition", "flow")
377
- c. For each acceptance criterion, generate TEST tasks
378
- - Unit test tasks for rule-level criteria
379
- - E2E test tasks for workflow-level criteria
380
- d. For each artifact requested, generate corresponding task type
381
- - Map artifact keywords to task types (see Task Types table)
382
- e. Generate infrastructure tasks: BUILD, VALIDATE, DEPLOY, VERSION, CHECKLIST
383
- f. Generate SETTING tasks for any rule that references settings
384
- g. Generate CONFIG tasks for deployment targets with feature flags
385
-
386
- 4. RESOLVE dependencies:
387
- a. Build adjacency list from dependency rules
388
- b. Run cycle detection (DFS)
389
- c. Run topological sort (Kahn's algorithm)
390
- d. Assign priority numbers from sort order
391
-
392
- 5. DETECT ambiguities:
393
- a. Check all interfaces against known skill mappings
394
- b. Check all acceptance criteria for measurability
395
- c. Check all stories for criteria coverage
396
- d. Check all artifact types for skill mappings
397
- e. Check all constraints for known keywords
398
- f. Check all NFRs for numeric thresholds
399
- g. Check deployment targets for resolvability
400
-
401
- 6. BUILD traceability matrix:
402
- a. Map each story ID to its generated task IDs
403
- b. Validate coverage (every story has tasks, every story has tests)
404
-
405
- 7. WRITE output:
406
- a. JSON task list to:
407
- accounts/<PROFILE>/analysis/scope-decomposition/<module>.tasks.json
408
- b. If --output-format markdown, also write human-readable table to:
409
- accounts/<PROFILE>/analysis/scope-decomposition/<module>.tasks.md
410
-
411
- 8. REPORT summary:
412
- - Total tasks generated (by type)
413
- - Ambiguities found (by severity)
414
- - Coverage: stories with tasks, stories with tests
415
- - Dependency chain depth (longest path in DAG)
416
- - Output file paths
417
- ```
418
-
419
- ## Output Paths
420
-
421
- Task list artifacts are written to the analysis directory scoped by profile:
422
-
423
- ```
424
- accounts/<PROFILE>/analysis/scope-decomposition/
425
- <module>.tasks.json <- Machine-readable task list (primary output)
426
- <module>.tasks.md <- Human-readable table (when --output-format markdown)
427
- ```
428
-
429
- The `<module>` stem is derived from the scope document's `# Module` section with dots replaced by dashes and lowercased (e.g., `fcx.sourcing.abtesting` becomes `fcx-sourcing-abtesting`).
430
-
431
- ## Integration with fluent-dev Agent
432
-
433
- The task list produced by this skill is consumed by the `/fluent-dev` orchestration agent:
434
-
435
- 1. `/fluent-dev` reads `<module>.tasks.json` from the analysis directory
436
- 2. For each task in priority order:
437
- a. Check `dependsOn` — all dependencies must have `status: "completed"`
438
- b. Invoke the skill named in `task.skill` with `task.inputs` as arguments
439
- c. On success: update `task.status` to `"completed"`
440
- d. On failure: update `task.status` to `"failed"`, log error, assess whether to continue or abort
441
- 3. After all tasks complete, update the traceability matrix with completion status
442
- 4. If any ambiguities have severity HIGH, pause and request human resolution before proceeding past the affected tasks
443
-
444
- The task list is a living document — `/fluent-dev` updates it in-place as work progresses.
445
-
446
- ## Edge Cases
447
-
448
- ### Module Already Exists
449
-
450
- If the environment-aware check (Step 1) finds the module already deployed or has local source:
451
-
452
- | State | First Task(s) | Subsequent RULE depends on |
453
- |-------|--------------|---------------------------|
454
- | Source in `SOURCE/` with `module.json` | `EXTEND` (no dependencies) | `EXTEND` |
455
- | Deployed but no source in `SOURCE/` | `SOURCE_ONBOARD` → `EXTEND` | `EXTEND` |
456
- | Not found anywhere | `SCAFFOLD` (classic new module) | `SCAFFOLD` |
457
- | Source exists but repo URL unknown | `SOURCE_ONBOARD` with ambiguity flag | `EXTEND` |
458
-
459
- **When extending:** The EXTEND task's `inputs.existing-module-path` tells downstream skills where to find the existing POM, `module.json`, and package structure. The `/fluent-rule-scaffold` skill uses this to wire new rules into the correct package and registration.
460
-
461
- ### Missing Sections
462
-
463
- If optional sections are missing, the skill generates a minimal task list:
464
-
465
- | Missing Section | Behavior |
466
- |----------------|----------|
467
- | `User stories` | Generate only SCAFFOLD/EXTEND + BUILD + VALIDATE tasks; flag as ambiguity: "No user stories — task list is infrastructure-only" |
468
- | `Acceptance criteria` | Generate all tasks but no TEST tasks; flag each story as untested (HIGH severity) |
469
- | `Artifacts requested` | Infer artifact types from user stories (Code implies RULE, Workflow implies WORKFLOW) |
470
- | `Deployment targets` | Skip DEPLOY, WORKFLOW_DEPLOY, CONFIG, CHECKLIST tasks; flag as ambiguity |
471
- | `Constraints` | Empty constraints object; no guard rails applied |
472
- | `Interfaces` | No interface-related ambiguity checks |
473
- | `Non-functional requirements` | No NFR-related ambiguity checks |
474
-
475
- ### Duplicate Story IDs
476
-
477
- If two stories share the same `[US-NNN]` identifier:
478
-
479
- 1. Flag as HIGH severity ambiguity
480
- 2. Keep the first occurrence and rename the second to `[US-NNN-DUP]`
481
- 3. Generate tasks for both but mark the duplicate's tasks with a warning
482
-
483
- ### Circular Dependencies
484
-
485
- If the dependency resolution algorithm detects a cycle:
486
-
487
- 1. Report the cycle path: `T-003 -> T-005 -> T-008 -> T-003`
488
- 2. Identify the likely cause (usually a WORKFLOW depending on a TEST that depends on the WORKFLOW)
489
- 3. Suggest resolution: break the cycle by removing the weakest dependency edge
490
- 4. Abort task list generation a valid DAG is required
491
-
492
- ### Unknown Artifact Types
493
-
494
- If an artifact type in `## Artifacts requested` does not match any known mapping:
495
-
496
- 1. Flag as MEDIUM severity ambiguity
497
- 2. Generate a DOC-type task as a placeholder with the description: "Manual: create <artifact-type>"
498
- 3. The placeholder task has no skill mapping (`skill: null`)
499
-
500
- ### Empty Scope Document
501
-
502
- If the file is empty or contains only headings with no content:
503
-
504
- 1. Return a validation error: "Scope document is empty or contains no actionable content"
505
- 2. List which sections were found (headings only) vs which had content
506
- 3. Do not generate any tasks
507
-
508
- ## Example
509
-
510
- ### Input: Scope Document
511
-
512
- ```markdown
513
- # Module
514
- fcx.sourcing.abtesting
515
-
516
- ## Objective
517
- Extend sourcing profiles to support A/B testing so we can compare profile
518
- variants on conversion, latency, and cost in demo scenarios.
519
-
520
- ## User stories
521
- - [US-201] As a merchandiser, I can define two or more sourcing profile
522
- variants (A/B/...) for an experiment.
523
- - [US-202] As a merchandiser, I can allocate traffic splits (e.g., 50/50,
524
- 10/90) across variants.
525
- - [US-203] As an analyst, I can view experiment results with metrics per
526
- variant in Fluent Analytics.
527
-
528
- ## Acceptance criteria
529
- - Given multiple profile variants and a traffic split, when requests are
530
- routed, then variants receive traffic according to the split within
531
- +/-1% error over sufficient volume.
532
- - Given an active experiment, when a variant underperforms thresholds,
533
- then the system can pause/adjust the split via config without redeploy.
534
- - Given experiment data, when results are requested, then metrics
535
- (conversion, p95 latency, cost per order) are reported per variant.
536
-
537
- ## Non-functional requirements
538
- - p95 latency: +<5 ms overhead from routing logic.
539
- - Availability: 99.9%.
540
- - Auditability: experiment definitions and changes are versioned.
541
-
542
- ## Constraints
543
- - backward_compatible
544
- - no_pii_in_logs
545
-
546
- ## Interfaces
547
- - Fluent AI Skills (Fluent CLI, Fluent MCP)
548
- - Fluent Analytics (Google Looker)
549
-
550
- ## Conventions
551
- - Testing: unit (routing), contract (Profile APIs), smoke (experiment
552
- start/stop), golden (metrics aggregation).
553
- - Versioning: semver
554
-
555
- ## Artifacts requested
556
- - Code (new or updated orchestration rules)
557
- - Orchestration Workflow (updated orchestration workflow)
558
- - Tests (unit / orchestration / end to end)
559
- - Docs (README, Confluence)
560
-
561
- ## Deployment targets
562
- - fluent:account/retailer-demo
563
- - feature flag: sourcing.abtest.enabled
564
- ```
565
-
566
- ### Output: Task List (JSON)
567
-
568
- ```json
569
- {
570
- "schema": "scope-decomposition-v1",
571
- "scopeDocument": "scope/sourcing-abtesting.md",
572
- "module": "fcx.sourcing.abtesting",
573
- "generatedAt": "2026-02-23T10:00:00Z",
574
- "profile": "HMDEV",
575
- "tasks": [
576
- {
577
- "id": "T-001",
578
- "type": "SCAFFOLD",
579
- "title": "Scaffold module fcx.sourcing.abtesting",
580
- "description": "Create module skeleton for sourcing A/B testing. Entity type: ORDER. Includes Maven structure, module.json, build scripts, and test harness.",
581
- "skill": "fluent-module-scaffold",
582
- "dependsOn": [],
583
- "storyRef": null,
584
- "inputs": {
585
- "module-name": "sourcing-abtesting",
586
- "entity-types": ["ORDER"],
587
- "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator", "ExperimentConfigReader"]
588
- },
589
- "acceptanceCriteria": [],
590
- "priority": 1,
591
- "status": "pending"
592
- },
593
- {
594
- "id": "T-002",
595
- "type": "RULE",
596
- "title": "Implement experiment variant definition rule",
597
- "description": "Rule to allow defining two or more sourcing profile variants (A/B/...) for an experiment. Reads experiment config from settings, registers variants on the entity.",
598
- "skill": "fluent-rule-scaffold",
599
- "dependsOn": ["T-001"],
600
- "storyRef": "US-201",
601
- "inputs": {
602
- "rule-name": "ExperimentVariantRouter",
603
- "entity-type": "ORDER"
604
- },
605
- "acceptanceCriteria": [],
606
- "priority": 2,
607
- "status": "pending"
608
- },
609
- {
610
- "id": "T-003",
611
- "type": "RULE",
612
- "title": "Implement traffic split allocation rule",
613
- "description": "Rule to allocate traffic across sourcing profile variants based on configured percentage splits (e.g., 50/50, 10/90).",
614
- "skill": "fluent-rule-scaffold",
615
- "dependsOn": ["T-001"],
616
- "storyRef": "US-202",
617
- "inputs": {
618
- "rule-name": "TrafficSplitAllocator",
619
- "entity-type": "ORDER"
620
- },
621
- "acceptanceCriteria": [
622
- "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume."
623
- ],
624
- "priority": 3,
625
- "status": "pending"
626
- },
627
- {
628
- "id": "T-004",
629
- "type": "RULE",
630
- "title": "Implement experiment config reader rule",
631
- "description": "Rule to read experiment configuration (variant definitions, split ratios, pause/adjust state) from retailer settings without requiring redeploy.",
632
- "skill": "fluent-rule-scaffold",
633
- "dependsOn": ["T-001"],
634
- "storyRef": "US-202",
635
- "inputs": {
636
- "rule-name": "ExperimentConfigReader",
637
- "entity-type": "ORDER"
638
- },
639
- "acceptanceCriteria": [
640
- "Given an active experiment, when a variant underperforms thresholds, then the system can pause/adjust the split via config without redeploy."
641
- ],
642
- "priority": 4,
643
- "status": "pending"
644
- },
645
- {
646
- "id": "T-005",
647
- "type": "SETTING",
648
- "title": "Create experiment configuration settings",
649
- "description": "Create retailer-scoped settings for experiment definitions, variant splits, and threshold configuration. Settings must be updatable without module redeploy.",
650
- "skill": "fluent-settings",
651
- "dependsOn": ["T-001"],
652
- "storyRef": "US-202",
653
- "inputs": {
654
- "settings": [
655
- { "name": "sourcing.experiment.config", "context": "RETAILER" },
656
- { "name": "sourcing.experiment.thresholds", "context": "RETAILER" }
657
- ]
658
- },
659
- "acceptanceCriteria": [],
660
- "priority": 5,
661
- "status": "pending"
662
- },
663
- {
664
- "id": "T-006",
665
- "type": "WORKFLOW",
666
- "title": "Add A/B test rulesets to ORDER sourcing workflow",
667
- "description": "Extend the ORDER workflow with rulesets for experiment routing: insert ExperimentVariantRouter and TrafficSplitAllocator into the sourcing event chain. Add statuses if needed for experiment branching.",
668
- "skill": "fluent-workflow-builder",
669
- "dependsOn": ["T-002", "T-003", "T-004"],
670
- "storyRef": "US-201",
671
- "inputs": {
672
- "workflow-type": "ORDER",
673
- "rulesets-to-add": ["ExperimentRouting"]
674
- },
675
- "acceptanceCriteria": [],
676
- "priority": 6,
677
- "status": "pending"
678
- },
679
- {
680
- "id": "T-007",
681
- "type": "TEST_UNIT",
682
- "title": "Write unit tests for routing and split rules",
683
- "description": "Unit tests for ExperimentVariantRouter, TrafficSplitAllocator, and ExperimentConfigReader. Cover: correct split distribution, config read/parse, edge cases (0% split, 100% split, missing config).",
684
- "skill": "fluent-build",
685
- "dependsOn": ["T-002", "T-003", "T-004"],
686
- "storyRef": "US-201",
687
- "inputs": {},
688
- "acceptanceCriteria": [
689
- "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume."
690
- ],
691
- "priority": 7,
692
- "status": "pending"
693
- },
694
- {
695
- "id": "T-008",
696
- "type": "BUILD",
697
- "title": "Build module fcx.sourcing.abtesting",
698
- "description": "Compile all rule classes, run unit tests, and package into deployable ZIP artifact.",
699
- "skill": "fluent-build",
700
- "dependsOn": ["T-002", "T-003", "T-004", "T-005", "T-006", "T-007"],
701
- "storyRef": null,
702
- "inputs": {},
703
- "acceptanceCriteria": [],
704
- "priority": 8,
705
- "status": "pending"
706
- },
707
- {
708
- "id": "T-009",
709
- "type": "VALIDATE",
710
- "title": "Validate module structure",
711
- "description": "Run /fluent-module-validate to confirm module.json, Maven structure, rule wiring, test coverage, and version consistency.",
712
- "skill": "fluent-module-validate",
713
- "dependsOn": ["T-008"],
714
- "storyRef": null,
715
- "inputs": {},
716
- "acceptanceCriteria": [],
717
- "priority": 9,
718
- "status": "pending"
719
- },
720
- {
721
- "id": "T-010",
722
- "type": "VERSION",
723
- "title": "Bump version to 1.0.0",
724
- "description": "Set initial release version across module.json, all POMs, and CHANGELOG.md. Tag as v1.0.0.",
725
- "skill": "fluent-version-manage",
726
- "dependsOn": ["T-008"],
727
- "storyRef": null,
728
- "inputs": {
729
- "command": "bump",
730
- "level": "minor"
731
- },
732
- "acceptanceCriteria": [],
733
- "priority": 10,
734
- "status": "pending"
735
- },
736
- {
737
- "id": "T-011",
738
- "type": "DEPLOY",
739
- "title": "Deploy module to retailer-demo",
740
- "description": "Deploy fc-module-sourcing-abtesting ZIP to fluent:account/retailer-demo.",
741
- "skill": "fluent-module-deploy",
742
- "dependsOn": ["T-008", "T-009"],
743
- "storyRef": null,
744
- "inputs": {
745
- "target": "fluent:account/retailer-demo"
746
- },
747
- "acceptanceCriteria": [],
748
- "priority": 11,
749
- "status": "pending"
750
- },
751
- {
752
- "id": "T-012",
753
- "type": "WORKFLOW_DEPLOY",
754
- "title": "Deploy updated ORDER workflow",
755
- "description": "Upload the modified ORDER workflow with A/B test rulesets to the target retailer.",
756
- "skill": "fluent-workflow",
757
- "dependsOn": ["T-006"],
758
- "storyRef": null,
759
- "inputs": {},
760
- "acceptanceCriteria": [],
761
- "priority": 12,
762
- "status": "pending"
763
- },
764
- {
765
- "id": "T-013",
766
- "type": "CONFIG",
767
- "title": "Configure feature flag and experiment settings",
768
- "description": "Enable feature flag sourcing.abtest.enabled on target retailer. Populate initial experiment configuration settings.",
769
- "skill": "fluent-retailer-config",
770
- "dependsOn": ["T-011"],
771
- "storyRef": null,
772
- "inputs": {
773
- "feature-flag": "sourcing.abtest.enabled"
774
- },
775
- "acceptanceCriteria": [],
776
- "priority": 13,
777
- "status": "pending"
778
- },
779
- {
780
- "id": "T-014",
781
- "type": "TEST_E2E",
782
- "title": "Run end-to-end experiment routing test",
783
- "description": "Create orders against the deployed workflow and verify traffic is split across variants. Confirm experiment config changes take effect without redeploy.",
784
- "skill": "fluent-e2e-test",
785
- "dependsOn": ["T-011", "T-012", "T-013"],
786
- "storyRef": "US-201",
787
- "inputs": {},
788
- "acceptanceCriteria": [
789
- "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume.",
790
- "Given an active experiment, when a variant underperforms thresholds, then the system can pause/adjust the split via config without redeploy."
791
- ],
792
- "priority": 14,
793
- "status": "pending"
794
- },
795
- {
796
- "id": "T-015",
797
- "type": "DOC",
798
- "title": "Generate module documentation",
799
- "description": "Create README.md with module overview, rule descriptions, configuration guide, and deployment instructions.",
800
- "skill": null,
801
- "dependsOn": ["T-008"],
802
- "storyRef": null,
803
- "inputs": {},
804
- "acceptanceCriteria": [],
805
- "priority": 15,
806
- "status": "pending"
807
- },
808
- {
809
- "id": "T-016",
810
- "type": "CHECKLIST",
811
- "title": "Run pre-deployment checklist",
812
- "description": "Execute full pre-deploy validation: environment readiness, module integrity, workflow validity, settings completeness, and risk assessment.",
813
- "skill": "fluent-pre-deploy-check",
814
- "dependsOn": ["T-008", "T-009", "T-010", "T-011", "T-012", "T-013", "T-014", "T-015"],
815
- "storyRef": null,
816
- "inputs": {},
817
- "acceptanceCriteria": [],
818
- "priority": 16,
819
- "status": "pending"
820
- }
821
- ],
822
- "ambiguities": [
823
- {
824
- "section": "Interfaces",
825
- "item": "Fluent Analytics (Google Looker)",
826
- "issue": "No skill or MCP tool covers Looker dashboard creation. Story US-203 requires metrics visualization in Fluent Analytics, which is outside agent tooling scope. Requires manual implementation or external tooling.",
827
- "severity": "HIGH"
828
- },
829
- {
830
- "section": "Acceptance criteria",
831
- "item": "within +/-1% error over sufficient volume",
832
- "issue": "Statistical validation of traffic distribution requires volume thresholds and statistical testing that existing E2E test tools cannot automate. Manual verification or custom test harness needed.",
833
- "severity": "MEDIUM"
834
- },
835
- {
836
- "section": "User stories",
837
- "item": "[US-203] view experiment results with metrics per variant",
838
- "issue": "Story requires Fluent Analytics dashboard work. No tasks generated for Looker integration — only data-side tasks can be automated.",
839
- "severity": "HIGH"
840
- }
841
- ],
842
- "constraints": {
843
- "backward_compatible": true,
844
- "no_pii_in_logs": true
845
- },
846
- "traceabilityMatrix": {
847
- "US-201": ["T-002", "T-006", "T-007", "T-014"],
848
- "US-202": ["T-003", "T-004", "T-005", "T-014"],
849
- "US-203": []
850
- },
851
- "nfrs": [
852
- { "requirement": "p95 latency: +<5 ms overhead from routing logic", "threshold": "5ms", "appliesTo": ["T-002", "T-003"] },
853
- { "requirement": "Availability: 99.9%", "threshold": "99.9%", "appliesTo": ["T-014"] },
854
- { "requirement": "Auditability: experiment definitions and changes are versioned", "threshold": null, "appliesTo": ["T-004", "T-005"] }
855
- ],
856
- "deploymentTargets": [
857
- { "target": "fluent:account/retailer-demo", "featureFlag": "sourcing.abtest.enabled" }
858
- ]
859
- }
860
- ```
861
-
862
- ### Variation: EXTEND Path (Existing Module)
863
-
864
- If the scope document's module matches an existing deployed module with source in `SOURCE/`, the first task changes from SCAFFOLD to EXTEND:
865
-
866
- ```json
867
- {
868
- "id": "T-001",
869
- "type": "EXTEND",
870
- "title": "Extend existing module hm-extensions with A/B testing rules",
871
- "description": "Module hm-extensions already exists in accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/. Add new rules for A/B testing. Source analyzed — existing rules: SendWebhook, ValidateOrder, ...",
872
- "skill": "fluent-rule-scaffold",
873
- "dependsOn": [],
874
- "storyRef": null,
875
- "inputs": {
876
- "existing-module-path": "accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/",
877
- "entity-types": ["ORDER"],
878
- "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator", "ExperimentConfigReader"]
879
- },
880
- "acceptanceCriteria": [],
881
- "priority": 1,
882
- "status": "pending"
883
- }
884
- ```
885
-
886
- If the module is deployed but source is **not** in `SOURCE/`, a SOURCE_ONBOARD task precedes EXTEND:
887
-
888
- ```json
889
- {
890
- "id": "T-001",
891
- "type": "SOURCE_ONBOARD",
892
- "title": "Obtain source code for module hm-extensions",
893
- "description": "Module hm-extensions is deployed (rules found via plugin.list) but no source in accounts/HMDEV/SOURCE/. Clone the repository or decompile the deployed JAR to obtain source before extending.",
894
- "skill": "fluent-custom-code",
895
- "dependsOn": [],
896
- "storyRef": null,
897
- "inputs": {
898
- "module-name": "hm-extensions",
899
- "profile": "HMDEV"
900
- },
901
- "acceptanceCriteria": [],
902
- "priority": 1,
903
- "status": "pending"
904
- },
905
- {
906
- "id": "T-002",
907
- "type": "EXTEND",
908
- "title": "Extend module hm-extensions with A/B testing rules",
909
- "description": "Add new rules to hm-extensions after source onboarding completes.",
910
- "skill": "fluent-rule-scaffold",
911
- "dependsOn": ["T-001"],
912
- "storyRef": null,
913
- "inputs": {
914
- "entity-types": ["ORDER"],
915
- "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator"]
916
- },
917
- "acceptanceCriteria": [],
918
- "priority": 2,
919
- "status": "pending"
920
- }
921
- ```
922
-
923
- **Key difference:** When extending, all RULE tasks depend on EXTEND (not SCAFFOLD), and the EXTEND task's inputs include the existing module path so the rule scaffolder knows where to add files.
924
-
925
- ### Output: Traceability Gaps
926
-
927
- From the example above, `US-203` has an empty task array in the traceability matrix. The skill reports this prominently:
928
-
929
- ```
930
- TRACEABILITY GAPS
931
- [HIGH] US-203 "view experiment results with metrics per variant"
932
- -> 0 tasks generated (Fluent Analytics integration outside agent scope)
933
- -> Recommend: assign to human for manual Looker dashboard creation
934
- ```
935
-
936
- ## Console Output Format
937
-
938
- After generating the task list, print a human-readable summary:
939
-
940
- ```
941
- === Scope Decomposition: fcx.sourcing.abtesting ===
942
-
943
- Source: scope/sourcing-abtesting.md
944
- Module: fcx.sourcing.abtesting
945
- Profile: HMDEV
946
-
947
- Tasks Generated: 16
948
- SCAFFOLD: 1
949
- RULE: 3
950
- WORKFLOW: 1
951
- SETTING: 1
952
- TEST_UNIT: 1
953
- BUILD: 1
954
- VALIDATE: 1
955
- VERSION: 1
956
- DEPLOY: 1
957
- WORKFLOW_DEPLOY: 1
958
- CONFIG: 1
959
- TEST_E2E: 1
960
- DOC: 1
961
- CHECKLIST: 1
962
-
963
- Dependency Chain Depth: 5 (SCAFFOLD -> RULE -> WORKFLOW -> BUILD -> DEPLOY -> TEST_E2E)
964
-
965
- Ambiguities: 3 (2 HIGH, 1 MEDIUM, 0 LOW)
966
- [HIGH] Fluent Analytics (Google Looker) — no skill mapping
967
- [HIGH] US-203 — no tasks generated (Looker integration)
968
- [MEDIUM] +/-1% error — unmeasurable by existing test tools
969
-
970
- Traceability:
971
- US-201: 4 tasks (covered)
972
- US-202: 4 tasks (covered)
973
- US-203: 0 tasks (GAP — requires human action)
974
-
975
- Constraints Applied: backward_compatible, no_pii_in_logs
976
-
977
- Output:
978
- accounts/HMDEV/analysis/scope-decomposition/fcx-sourcing-abtesting.tasks.json
979
- ```
980
-
981
- ## Markdown Output Format (--output-format markdown)
982
-
983
- When markdown output is requested, produce a table-based summary alongside the JSON:
984
-
985
- ```markdown
986
- # Task List: fcx.sourcing.abtesting
987
-
988
- | ID | Type | Title | Skill | Depends On | Story | Priority |
989
- |----|------|-------|-------|-----------|-------|----------|
990
- | T-001 | SCAFFOLD | Scaffold module fcx.sourcing.abtesting | fluent-module-scaffold | -- | -- | 1 |
991
- | T-002 | RULE | Implement experiment variant definition rule | fluent-rule-scaffold | T-001 | US-201 | 2 |
992
- | T-003 | RULE | Implement traffic split allocation rule | fluent-rule-scaffold | T-001 | US-202 | 3 |
993
- | ... | ... | ... | ... | ... | ... | ... |
994
-
995
- ## Ambiguities
996
-
997
- | Severity | Section | Item | Issue |
998
- |----------|---------|------|-------|
999
- | HIGH | Interfaces | Fluent Analytics (Google Looker) | No skill mapping |
1000
- | HIGH | User stories | US-203 | No tasks generated |
1001
- | MEDIUM | Acceptance criteria | +/-1% error | Unmeasurable |
1002
-
1003
- ## Traceability
1004
-
1005
- | Story | Tasks | Coverage |
1006
- |-------|-------|----------|
1007
- | US-201 | T-002, T-006, T-007, T-014 | Covered |
1008
- | US-202 | T-003, T-004, T-005, T-014 | Covered |
1009
- | US-203 | (none) | GAP |
1010
- ```
1011
-
1012
- ## Tips
1013
-
1014
- - **Run `--validate-only` first** to check the scope document structure before generating a full task list. This catches missing sections and structural issues early.
1015
- - **Scope documents should be machine-parseable** — use consistent heading levels, bullet lists with identifiers, and Given/When/Then format for criteria. The ADD template enforces this.
1016
- - **One module per scope document** if the scope covers multiple modules, split it into separate documents and run decomposition on each.
1017
- - **Review ambiguities before executing tasks** — HIGH severity ambiguities often indicate scope gaps that need human resolution. Running tasks against an ambiguous scope wastes agent cycles.
1018
- - **The task list is a living document** `/fluent-dev` updates task statuses in-place as work progresses. Re-running decomposition overwrites the file, so back up if in-progress work exists.
1019
- - **Custom task types** if a scope requires work outside the standard type table (e.g., database migration, external API setup), generate a DOC-type placeholder with `skill: null` and flag as ambiguity.
1020
- - **Story-to-criteria linking** if criteria do not explicitly reference story IDs, the skill links them by order of appearance. For precise linking, include `[US-NNN]` references in criteria text.
1021
- - **Large scope documents** — for scopes with 20+ stories, the task list can exceed 50 tasks. Review the dependency DAG visualization to identify parallelizable task groups.
1
+ ---
2
+ name: fluent-scope-decompose
3
+ description: Decompose a structured scope document into an ordered task list with dependencies, skill mappings, and ambiguity detection. Converts ADD scope packs into executable agent work plans. Triggers on "decompose scope", "plan from scope", "task breakdown", "scope to tasks", "parse scope document".
4
+ user-invocable: true
5
+ allowed-tools: Bash, Read, Write, Edit, Glob, Grep
6
+ argument-hint: <scope-file-path> [--output-format json|markdown] [--validate-only] [--batch-features]
7
+ ---
8
+
9
+ # Scope-to-Task Decomposition
10
+
11
+ Parse a structured scope document (Markdown following the ADD template) and produce a JSON task list with dependency ordering, skill mappings, and ambiguity flags. This bridges the gap between human-authored scope and agent-executable work — ADD Phase 2: Agent Planning.
12
+
13
+ ## Ownership Boundary
14
+
15
+ This skill owns scope document parsing, task generation, dependency DAG construction, ambiguity detection, and the output task list artifact.
16
+
17
+ Other skills own:
18
+ - Module scaffolding execution --> `/fluent-module-scaffold`
19
+ - Rule scaffolding execution --> `/fluent-rule-scaffold`
20
+ - Workflow editing --> `/fluent-workflow-builder`
21
+ - Build orchestration --> `/fluent-build`
22
+ - Deployment --> `/fluent-module-deploy`
23
+ - Session orchestration across tasks --> `fluent-dev` orchestrator (routes to backend/frontend agents)
24
+
25
+ This skill produces the plan; other skills execute it.
26
+
27
+ ## When to Use
28
+
29
+ - A structured scope document (ADD template) exists and needs to be converted into an actionable work plan
30
+ - Starting a new module development cycle and need to know what tasks are required
31
+ - Validating a scope document for completeness before agent work begins
32
+ - Generating a traceability matrix from stories to tasks
33
+ - Identifying ambiguities or gaps in a scope document that need human resolution before agents can proceed
34
+
35
+ ## Inputs
36
+
37
+ | Parameter | Required | Default | Description |
38
+ |-----------|----------|---------|-------------|
39
+ | `scope-file-path` | Yes | -- | Path to the scope document (Markdown) |
40
+ | `--output-format` | No | `json` | Output format: `json` (machine-readable) or `markdown` (human-readable) |
41
+ | `--validate-only` | No | `false` | Only validate the scope document structure without generating tasks |
42
+ | `--profile` | No | Active profile | Target Fluent profile for environment-aware decomposition |
43
+ | `--batch-features` | No | `false` | When the scope contains multiple features/capabilities, stub out `features/<slug>/` directories with skeleton `status.json` files. This eliminates the need to run `/fluent-use-case-discover` separately for each feature |
44
+
45
+ ## Scope Document Format
46
+
47
+ The skill expects a Markdown document with sections following the ADD template. All section headings are case-insensitive. Sections may appear in any order. The `Module` and `Objective` sections are required; all others are optional but recommended.
48
+
49
+ ```markdown
50
+ # Module
51
+ <module-identifier>
52
+
53
+ ## Objective
54
+ <business context and goal>
55
+
56
+ ## User stories
57
+ - [US-NNN] As a <role>, I can <action>
58
+ - [US-NNN] As a <role>, I can <action>
59
+
60
+ ## Acceptance criteria
61
+ - Given <condition>, when <trigger>, then <outcome>
62
+ - Given <condition>, when <trigger>, then <outcome>
63
+
64
+ ## Non-functional requirements
65
+ - <requirement with measurable threshold>
66
+
67
+ ## Constraints
68
+ - <constraint_keyword>
69
+
70
+ ## Interfaces
71
+ - <system/module name> (<details>)
72
+
73
+ ## Conventions
74
+ - <convention>
75
+
76
+ ## Artifacts requested
77
+ - <artifact-type> (<details>)
78
+
79
+ ## Deployment targets
80
+ - <target-account/retailer>
81
+ - feature flag: <flag.name>
82
+ ```
83
+
84
+ ### Section Extraction Rules
85
+
86
+ Each section maps to specific task properties during decomposition:
87
+
88
+ | Section | Extraction Logic | Maps To |
89
+ |---------|-----------------|---------|
90
+ | `Module` | First non-empty line after heading | `task.module` for all generated tasks; used as directory/file name stem |
91
+ | `Objective` | All text until next heading | `task.context`injected as business context into every generated task description |
92
+ | `User stories` | Parse lines matching `[US-NNN]` pattern; extract identifier + role + action | Individual task groups each story generates one or more tasks |
93
+ | `Acceptance criteria` | Parse Given/When/Then triples (single-line or multi-line Gherkin) | `task.acceptanceCriteria[]` on the corresponding TEST tasks |
94
+ | `Non-functional requirements` | Parse as constraint list; extract numeric thresholds where present | Quality gate parameters on BUILD, TEST_E2E, and CHECKLIST tasks |
95
+ | `Constraints` | Keyword extraction (`backward_compatible`, `no_pii_in_logs`, etc.) | `constraints` object applied as guard rails across all generated tasks |
96
+ | `Interfaces` | System/module names with optional details | Dependency declarations; flag as ambiguity if no skill mapping exists |
97
+ | `Conventions` | Free text conventions | Injected into SCAFFOLD and BUILD task descriptions |
98
+ | `Artifacts requested` | Artifact type keywords (Code, Workflow, Tests, Docs, etc.) | Drive task type assignments — each artifact maps to one or more task types |
99
+ | `Deployment targets` | Account/retailer refs and feature flags | DEPLOY and CONFIG task targets |
100
+
101
+ ### Story Identifier Parsing
102
+
103
+ Story identifiers follow the pattern `[US-NNN]` where NNN is any alphanumeric sequence. The parser:
104
+
105
+ 1. Scans each bullet line under `## User stories` for a `[` prefix
106
+ 2. Extracts the identifier between `[` and `]`
107
+ 3. Extracts the description after the `]` (trimmed)
108
+ 4. Deduplicates by identifier — if the same ID appears twice, flag as ambiguity
109
+
110
+ ### Acceptance Criteria Parsing
111
+
112
+ Acceptance criteria follow Given/When/Then structure. The parser supports:
113
+
114
+ - **Single-line:** `Given X, when Y, then Z`
115
+ - **Multi-line Gherkin:**
116
+ ```
117
+ - Given multiple profile variants and a traffic split
118
+ When requests are routed
119
+ Then variants receive traffic according to the split within +/-1% error
120
+ ```
121
+ - **Free-form:** Lines not matching Given/When/Then are treated as unstructured criteria and attached verbatim
122
+
123
+ Criteria are linked to stories by proximity or explicit `[US-NNN]` references within the criteria text.
124
+
125
+ ## Task List JSON Schema
126
+
127
+ The output is a JSON document containing the full decomposition:
128
+
129
+ ```json
130
+ {
131
+ "schema": "scope-decomposition-v1",
132
+ "scopeDocument": "path/to/scope.md",
133
+ "module": "fcx.sourcing.abtesting",
134
+ "generatedAt": "2026-02-23T10:00:00Z",
135
+ "profile": "HMDEV",
136
+ "tasks": [
137
+ {
138
+ "id": "T-001",
139
+ "type": "SCAFFOLD",
140
+ "title": "Scaffold module fcx.sourcing.abtesting",
141
+ "description": "Create module skeleton with entity types ORDER, FULFILMENT",
142
+ "skill": "fluent-module-scaffold",
143
+ "dependsOn": [],
144
+ "storyRef": null,
145
+ "inputs": {
146
+ "module-name": "sourcing-abtesting",
147
+ "entity-types": ["ORDER"]
148
+ },
149
+ "acceptanceCriteria": [],
150
+ "priority": 1,
151
+ "status": "pending"
152
+ }
153
+ ],
154
+ "ambiguities": [],
155
+ "constraints": {},
156
+ "traceabilityMatrix": {},
157
+ "nfrs": [],
158
+ "deploymentTargets": [],
159
+ "validationErrors": []
160
+ }
161
+ ```
162
+
163
+ ### Task Fields
164
+
165
+ | Field | Type | Description |
166
+ |-------|------|-------------|
167
+ | `id` | string | Unique identifier, pattern `T-NNN` (zero-padded, assigned in topological order) |
168
+ | `type` | string | One of the task types from the Task Types table below |
169
+ | `title` | string | Human-readable summary of what this task does |
170
+ | `description` | string | Detailed description including business context from Objective |
171
+ | `skill` | string | The exact skill name to invoke for execution (e.g., `fluent-rule-scaffold`) |
172
+ | `dependsOn` | string[] | Array of task IDs that must complete before this task can start |
173
+ | `storyRef` | string or null | The `[US-NNN]` identifier this task traces to, or null for infrastructure tasks |
174
+ | `inputs` | object | Key-value pairs passed to the skill at execution time |
175
+ | `acceptanceCriteria` | string[] | Given/When/Then triples that define done for this task |
176
+ | `priority` | number | Execution order (1 = first); derived from topological sort position |
177
+ | `status` | string | Always `"pending"` at generation time |
178
+
179
+ ## Task Types
180
+
181
+ Every task has a type that determines which skill executes it and what its default dependencies are.
182
+
183
+ | Type | Skill Mapping | Description | Typical Dependencies |
184
+ |------|--------------|-------------|---------------------|
185
+ | `SCAFFOLD` | `fluent-module-scaffold` | Create new module skeleton with Maven structure, module.json, build scripts | None (always first for new modules) |
186
+ | `EXTEND` | `fluent-rule-scaffold` | Add rules/functionality to an existing module whose source is already in `SOURCE/` | SOURCE_ONBOARD (if source was missing) or none (if source already present) |
187
+ | `SOURCE_ONBOARD` | `fluent-custom-code` | Clone repo or obtain source code for an existing deployed module into `accounts/<PROFILE>/SOURCE/` and analyze it | None (always first for extending existing modules) |
188
+ | `RULE` | `fluent-rule-scaffold` | Scaffold a new Rubix rule class with @RuleInfo, parameters, and test skeleton | SCAFFOLD or EXTEND |
189
+ | `WORKFLOW` | `fluent-workflow-builder` | Create or modify workflow JSON add rulesets, statuses, triggers | RULE (rules must exist before wiring into rulesets) |
190
+ | `SETTING` | `fluent-settings` | Create or update retailer/account settings required by rules | SCAFFOLD or EXTEND |
191
+ | `TEST_UNIT` | `fluent-build` | Write or run unit tests for rule classes | RULE |
192
+ | `TEST_E2E` | `fluent-e2e-test` | Run end-to-end test sequences against deployed workflows | WORKFLOW_DEPLOY, DEPLOY |
193
+ | `BUILD` | `fluent-build` | Compile, package, and produce deployable ZIP artifact | RULE, WORKFLOW (all code changes must be complete) |
194
+ | `DEPLOY` | `fluent-module-deploy` | Deploy module ZIP to target Fluent account/retailer | BUILD, VALIDATE |
195
+ | `WORKFLOW_DEPLOY` | `fluent-workflow-deploy` | Upload workflow JSON to target retailer | WORKFLOW |
196
+ | `CONFIG` | `fluent-retailer-config` | Configure retailer-level settings, feature flags, and sample data | DEPLOY (retailer must have module installed) |
197
+ | `VALIDATE` | `fluent-module-validate` | Run structural validation on the module before deployment | BUILD |
198
+ | `ANALYZE` | `fluent-connection-analysis` | Analyze workflow connection topology and cross-entity event flows | WORKFLOW_DEPLOY |
199
+ | `DOC` | Manual / agent | Generate README, Confluence pages, or other documentation | BUILD |
200
+ | `VERSION` | `fluent-version-manage` | Bump semver version, update CHANGELOG, sync all version files | BUILD passes |
201
+ | `CHECKLIST` | `fluent-pre-deploy-check` | Run full pre-deployment checklist across all gates | All prior tasks |
202
+ | `FEATURE_SPEC` | `fluent-use-case-discover` | Write a Business Spec for a feature identified during scope decomposition | None (always first when batch-features is used) |
203
+
204
+ **Skill existence validation:** After mapping tasks to skills, verify each referenced skill name is valid. The canonical skill list is maintained in `fluent-ai-skills/content/` — each subdirectory under `*/skills/` is a valid skill name. If a task references a non-existent skill (e.g., typo or deprecated name), flag it as `UNMAPPED` and suggest the closest valid skill name.
205
+
206
+ ## Dependency Resolution Algorithm
207
+
208
+ The skill constructs a directed acyclic graph (DAG) of task dependencies and produces a topologically sorted execution order.
209
+
210
+ ### Step 1: Environment-Aware Module Decision
211
+
212
+ **Before generating any tasks, determine whether this is a new module or an extension of an existing one.**
213
+
214
+ ```
215
+ 1. Extract module name from scope document's ## Module section
216
+
217
+ 2. Search local workspace for existing source:
218
+ Glob: accounts/<PROFILE>/SOURCE/*/resources/module.json
219
+ Parse each module.json → build list of local modules with their rule names
220
+
221
+ 3. Query deployed modules in live environment:
222
+ MCP tool: plugin.list (compact: true)
223
+ Parse rule keys extract module names (group by ACCOUNT prefix)
224
+
225
+ 4. Decision tree:
226
+ ├── Module source found in accounts/<PROFILE>/SOURCE/?
227
+ │ └── YES EXTEND path
228
+ - Generate EXTEND task (not SCAFFOLD)
229
+ │ - RULE tasks depend on EXTEND
230
+ │ - inputs.existingModulePath = path to source directory
231
+
232
+ ├── Module deployed (rules in plugin.list) but NO source in SOURCE/?
233
+ └── SOURCE_ONBOARD path
234
+ │ - Generate SOURCE_ONBOARD task first (clone repo / obtain source)
235
+ - Generate EXTEND task (depends on SOURCE_ONBOARD)
236
+ - RULE tasks depend on EXTEND
237
+ - Flag ambiguity if repo URL is unknown
238
+
239
+ └── Module NOT found anywhere?
240
+ └── SCAFFOLD path (new module)
241
+ - Generate SCAFFOLD task
242
+ - RULE tasks depend on SCAFFOLD
243
+ ```
244
+
245
+ ### Step 2: Generate Tasks from Scope Sections
246
+
247
+ ```
248
+ For each section in the scope document:
249
+ Module -> generate 1 SCAFFOLD, EXTEND, or SOURCE_ONBOARD+EXTEND task (per Step 1 decision)
250
+ User stories -> for each story, generate RULE and/or WORKFLOW tasks based on story content
251
+ Acceptance criteria -> generate TEST_UNIT and TEST_E2E tasks
252
+ Artifacts requested -> generate task types matching the artifact keyword:
253
+ "Code" -> RULE (if not already generated from stories)
254
+ "Workflow" -> WORKFLOW
255
+ "Tests" -> TEST_UNIT + TEST_E2E
256
+ "Docs" -> DOC
257
+ "Settings" -> SETTING
258
+ "OMX Components" -> flag as ambiguity (no skill mapping)
259
+ Deployment targets -> generate DEPLOY, WORKFLOW_DEPLOY, CONFIG tasks
260
+ Always generate: BUILD, VALIDATE, VERSION, CHECKLIST (infrastructure tasks)
261
+ ```
262
+
263
+ ### Step 3: Build Dependency Edges
264
+
265
+ Apply these rules to construct edges in the DAG:
266
+
267
+ ```
268
+ SCAFFOLD -> no dependencies (new module path)
269
+ SOURCE_ONBOARD -> no dependencies (extend-without-source path)
270
+ EXTEND -> depends on SOURCE_ONBOARD if source was missing; else no dependencies
271
+ RULE -> depends on SCAFFOLD (new) or EXTEND (existing)
272
+ WORKFLOW -> depends on all RULE tasks that the workflow references
273
+ SETTING -> depends on SCAFFOLD or EXTEND
274
+ TEST_UNIT -> depends on the RULE task it tests
275
+ BUILD -> depends on all RULE + WORKFLOW + SETTING tasks
276
+ VALIDATE -> depends on BUILD
277
+ DEPLOY -> depends on BUILD + VALIDATE
278
+ WORKFLOW_DEPLOY -> depends on all WORKFLOW tasks
279
+ TEST_E2E -> depends on DEPLOY + WORKFLOW_DEPLOY
280
+ CONFIG -> depends on DEPLOY
281
+ DOC -> depends on BUILD
282
+ VERSION -> depends on BUILD (build must pass before version bump)
283
+ CHECKLIST -> depends on all other tasks (always last)
284
+ ```
285
+
286
+ ### Step 4: Cycle Detection
287
+
288
+ Run a depth-first search on the DAG. If a back edge is found, report the cycle and abort with an error:
289
+
290
+ ```
291
+ ERROR: Circular dependency detected: T-003 -> T-005 -> T-008 -> T-003
292
+ Resolve the cycle in the scope document before decomposition can proceed.
293
+ ```
294
+
295
+ ### Step 5: Topological Sort
296
+
297
+ Perform Kahn's algorithm (BFS-based topological sort) on the validated DAG:
298
+
299
+ ```
300
+ 1. Compute in-degree for each task node
301
+ 2. Enqueue all nodes with in-degree 0
302
+ 3. While queue is not empty:
303
+ a. Dequeue node, assign next priority number
304
+ b. For each outgoing edge, decrement target in-degree
305
+ c. If target in-degree reaches 0, enqueue it
306
+ 4. If processed count < total tasks -> cycle exists (caught in Step 3)
307
+ ```
308
+
309
+ The priority field on each task reflects its position in the topological order.
310
+
311
+ ### Skill Existence Validation
312
+
313
+ After generating the task list, validate that every `skill` field references a real skill:
314
+
315
+ **Known valid skills:**
316
+ `fluent-module-scaffold`, `fluent-rule-scaffold`, `fluent-workflow-builder`, `fluent-build`, `fluent-settings`, `fluent-module-deploy`, `fluent-workflow-deploy`, `fluent-e2e-test`, `fluent-version-manage`, `fluent-pre-deploy-check`, `fluent-custom-code`, `fluent-feature-plan`, `fluent-retailer-config`, `fluent-data-module-scaffold`, `fluent-source-onboard`, `fluent-test-data`, `fluent-job-batch`, `fluent-use-case-discover`, `fluent-module-validate`, `fluent-connection-analysis`
317
+
318
+ If a generated task references a skill not in this list, add a `validationErrors` entry:
319
+ ```json
320
+ { "taskId": "T-003", "field": "skill", "value": "fluent-unknown-skill", "error": "Referenced skill does not exist" }
321
+ ```
322
+
323
+ This prevents the agent from attempting to invoke non-existent skills during execution.
324
+
325
+ ## Ambiguity Detection
326
+
327
+ The skill flags ambiguities that require human resolution before agents can execute the task list.
328
+
329
+ | Condition | Severity | Detection Rule | Example |
330
+ |-----------|----------|---------------|---------|
331
+ | Interface has no skill mapping | HIGH | Interface name does not match any known skill or MCP tool | "Fluent Analytics (Google Looker)" -- no skill covers Looker dashboard creation |
332
+ | Acceptance criteria references unmeasurable metric | MEDIUM | Criteria contains percentage, statistical term, or threshold that cannot be verified by existing test tools | "within +/-1% error over sufficient volume" -- needs statistical validation |
333
+ | User story lacks acceptance criteria | HIGH | Story ID from `## User stories` has no matching criteria in `## Acceptance criteria` | Story [US-203] exists but no Given/When/Then references it |
334
+ | Artifact type has no skill mapping | MEDIUM | Artifact keyword does not match any known task type | "OMX Components" -- no skill covers OMX creation |
335
+ | Constraint keyword is unknown | LOW | Keyword not in known set: `backward_compatible`, `no_pii_in_logs`, `no_breaking_changes`, `idempotent`, `audit_trail` | "gdpr_compliant" -- recognized but no automated enforcement |
336
+ | Non-functional requirement lacks threshold | MEDIUM | NFR line has no numeric value or measurable bound | "high availability" without an SLA percentage |
337
+ | Duplicate story identifiers | HIGH | Two or more stories share the same `[US-NNN]` identifier | `[US-201]` appears twice with different descriptions |
338
+ | Deployment target unresolvable | MEDIUM | Target does not match known profile/retailer pattern | "fluent:account/retailer-demo" when no matching profile exists |
339
+
340
+ ### Ambiguity Output Format
341
+
342
+ ```json
343
+ {
344
+ "section": "Interfaces",
345
+ "item": "Fluent Analytics (Google Looker)",
346
+ "issue": "No skill or MCP tool covers Looker dashboard creation. Requires manual implementation or external tooling.",
347
+ "severity": "HIGH"
348
+ }
349
+ ```
350
+
351
+ ## Traceability Matrix
352
+
353
+ The skill produces a mapping from every user story to the tasks generated from it, enabling end-to-end traceability from requirement to implementation:
354
+
355
+ ```json
356
+ {
357
+ "US-201": ["T-002", "T-003", "T-007", "T-012"],
358
+ "US-202": ["T-004", "T-005", "T-008"],
359
+ "US-203": ["T-006", "T-009"]
360
+ }
361
+ ```
362
+
363
+ **Coverage validation:** After building the matrix, check that:
364
+ 1. Every story has at least one task -> if not, flag as ambiguity (story with no work)
365
+ 2. Every task with a `storyRef` maps back to a valid story -> if not, flag as orphaned task
366
+ 3. Every story has at least one TEST task -> if not, flag as untested story (severity: HIGH)
367
+
368
+ ## Execution Flow
369
+
370
+ ```
371
+ 1. READ scope document from file path
372
+ - Validate file exists and is readable
373
+ - Parse as Markdown (split by heading levels)
374
+
375
+ 2. VALIDATE structure:
376
+ a. Check required sections present (Module, Objective)
377
+ b. Check recommended sections present (User stories, Acceptance criteria, Artifacts)
378
+ c. Parse user story identifiers [US-NNN] — validate uniqueness
379
+ d. Parse acceptance criteria extract Given/When/Then triples
380
+ e. Parse constraints extract known keywords
381
+ f. If --validate-only:
382
+ - Report section presence/absence table
383
+ - Report parsed story count, criteria count, constraint count
384
+ - Report any structural issues found
385
+ - STOP (do not generate tasks)
386
+
387
+ 3. DECOMPOSE into tasks:
388
+ a. Run environment-aware module decision (see Dependency Resolution Step 1):
389
+ - Search accounts/<PROFILE>/SOURCE/ for existing module source
390
+ - Query plugin.list for deployed custom rules
391
+ - Decision: SCAFFOLD (new) / EXTEND (source available) / SOURCE_ONBOARD+EXTEND (deployed but no source)
392
+ - Extract module name, derive entity types from stories/interfaces
393
+ b. For each user story, generate RULE and/or WORKFLOW tasks
394
+ - Analyze story text for rule-like behavior ("route", "allocate", "validate")
395
+ - Analyze story text for workflow-like behavior ("status", "transition", "flow")
396
+ c. For each acceptance criterion, generate TEST tasks
397
+ - Unit test tasks for rule-level criteria
398
+ - E2E test tasks for workflow-level criteria
399
+ d. For each artifact requested, generate corresponding task type
400
+ - Map artifact keywords to task types (see Task Types table)
401
+ e. Generate infrastructure tasks: BUILD, VALIDATE, DEPLOY, VERSION, CHECKLIST
402
+ f. Generate SETTING tasks for any rule that references settings
403
+ g. Generate CONFIG tasks for deployment targets with feature flags
404
+
405
+ 4. RESOLVE dependencies:
406
+ a. Build adjacency list from dependency rules
407
+ b. Run cycle detection (DFS)
408
+ c. Run topological sort (Kahn's algorithm)
409
+ d. Assign priority numbers from sort order
410
+
411
+ 5. DETECT ambiguities:
412
+ a. Check all interfaces against known skill mappings
413
+ b. Check all acceptance criteria for measurability
414
+ c. Check all stories for criteria coverage
415
+ d. Check all artifact types for skill mappings
416
+ e. Check all constraints for known keywords
417
+ f. Check all NFRs for numeric thresholds
418
+ g. Check deployment targets for resolvability
419
+
420
+ 6. BUILD traceability matrix:
421
+ a. Map each story ID to its generated task IDs
422
+ b. Validate coverage (every story has tasks, every story has tests)
423
+
424
+ 7. WRITE output:
425
+ a. JSON task list to:
426
+ accounts/<PROFILE>/analysis/scope/<module>.tasks.json
427
+ b. If --output-format markdown, also write human-readable table to:
428
+ accounts/<PROFILE>/analysis/scope/<module>.tasks.md
429
+
430
+ 8. REPORT summary:
431
+ - Total tasks generated (by type)
432
+ - Ambiguities found (by severity)
433
+ - Coverage: stories with tasks, stories with tests
434
+ - Dependency chain depth (longest path in DAG)
435
+ - Output file paths
436
+ ```
437
+
438
+ ## Output Paths
439
+
440
+ Task list artifacts are written to the analysis directory scoped by profile:
441
+
442
+ ```
443
+ accounts/<PROFILE>/analysis/scope/
444
+ <module>.tasks.json <- Machine-readable task list (primary output)
445
+ <module>.tasks.md <- Human-readable table (when --output-format markdown)
446
+ ```
447
+
448
+ The `<module>` stem is derived from the scope document's `# Module` section with dots replaced by dashes and lowercased (e.g., `fcx.sourcing.abtesting` becomes `fcx-sourcing-abtesting`).
449
+
450
+ ## Integration with Development Agents
451
+
452
+ The task list produced by this skill is consumed by the development agents:
453
+
454
+ 1. The `fluent-dev` orchestrator reads `<module>.tasks.json` from the analysis directory and routes tasks to the appropriate domain agent (`fluent-backend-dev` for workflow/rule/module tasks, `fluent-frontend-dev` for manifest/component tasks)
455
+ 2. For each task in priority order:
456
+ a. Check `dependsOn` all dependencies must have `status: "completed"`
457
+ b. Invoke the skill named in `task.skill` with `task.inputs` as arguments
458
+ c. On success: update `task.status` to `"completed"`
459
+ d. On failure: update `task.status` to `"failed"`, log error, assess whether to continue or abort
460
+ 3. After all tasks complete, update the traceability matrix with completion status
461
+ 4. If any ambiguities have severity HIGH, pause and request human resolution before proceeding past the affected tasks
462
+
463
+ The task list is a living document — the orchestrator updates it in-place as work progresses.
464
+
465
+ ## Edge Cases
466
+
467
+ ### Module Already Exists
468
+
469
+ If the environment-aware check (Step 1) finds the module already deployed or has local source:
470
+
471
+ | State | First Task(s) | Subsequent RULE depends on |
472
+ |-------|--------------|---------------------------|
473
+ | Source in `SOURCE/` with `module.json` | `EXTEND` (no dependencies) | `EXTEND` |
474
+ | Deployed but no source in `SOURCE/` | `SOURCE_ONBOARD` → `EXTEND` | `EXTEND` |
475
+ | Not found anywhere | `SCAFFOLD` (classic new module) | `SCAFFOLD` |
476
+ | Source exists but repo URL unknown | `SOURCE_ONBOARD` with ambiguity flag | `EXTEND` |
477
+
478
+ **When extending:** The EXTEND task's `inputs.existing-module-path` tells downstream skills where to find the existing POM, `module.json`, and package structure. The `/fluent-rule-scaffold` skill uses this to wire new rules into the correct package and registration.
479
+
480
+ ### Missing Sections
481
+
482
+ If optional sections are missing, the skill generates a minimal task list:
483
+
484
+ | Missing Section | Behavior |
485
+ |----------------|----------|
486
+ | `User stories` | Generate only SCAFFOLD/EXTEND + BUILD + VALIDATE tasks; flag as ambiguity: "No user stories — task list is infrastructure-only" |
487
+ | `Acceptance criteria` | Generate all tasks but no TEST tasks; flag each story as untested (HIGH severity) |
488
+ | `Artifacts requested` | Infer artifact types from user stories (Code implies RULE, Workflow implies WORKFLOW) |
489
+ | `Deployment targets` | Skip DEPLOY, WORKFLOW_DEPLOY, CONFIG, CHECKLIST tasks; flag as ambiguity |
490
+ | `Constraints` | Empty constraints object; no guard rails applied |
491
+ | `Interfaces` | No interface-related ambiguity checks |
492
+ | `Non-functional requirements` | No NFR-related ambiguity checks |
493
+
494
+ ### Duplicate Story IDs
495
+
496
+ If two stories share the same `[US-NNN]` identifier:
497
+
498
+ 1. Flag as HIGH severity ambiguity
499
+ 2. Keep the first occurrence and rename the second to `[US-NNN-DUP]`
500
+ 3. Generate tasks for both but mark the duplicate's tasks with a warning
501
+
502
+ ### Circular Dependencies
503
+
504
+ If the dependency resolution algorithm detects a cycle:
505
+
506
+ 1. Report the cycle path: `T-003 -> T-005 -> T-008 -> T-003`
507
+ 2. Identify the likely cause (usually a WORKFLOW depending on a TEST that depends on the WORKFLOW)
508
+ 3. Suggest resolution: break the cycle by removing the weakest dependency edge
509
+ 4. Abort task list generation — a valid DAG is required
510
+
511
+ ### Unknown Artifact Types
512
+
513
+ If an artifact type in `## Artifacts requested` does not match any known mapping:
514
+
515
+ 1. Flag as MEDIUM severity ambiguity
516
+ 2. Generate a DOC-type task as a placeholder with the description: "Manual: create <artifact-type>"
517
+ 3. The placeholder task has no skill mapping (`skill: null`)
518
+
519
+ ### Empty Scope Document
520
+
521
+ If the file is empty or contains only headings with no content:
522
+
523
+ 1. Return a validation error: "Scope document is empty or contains no actionable content"
524
+ 2. List which sections were found (headings only) vs which had content
525
+ 3. Do not generate any tasks
526
+
527
+ ## Example
528
+
529
+ ### Input: Scope Document
530
+
531
+ ```markdown
532
+ # Module
533
+ fcx.sourcing.abtesting
534
+
535
+ ## Objective
536
+ Extend sourcing profiles to support A/B testing so we can compare profile
537
+ variants on conversion, latency, and cost in demo scenarios.
538
+
539
+ ## User stories
540
+ - [US-201] As a merchandiser, I can define two or more sourcing profile
541
+ variants (A/B/...) for an experiment.
542
+ - [US-202] As a merchandiser, I can allocate traffic splits (e.g., 50/50,
543
+ 10/90) across variants.
544
+ - [US-203] As an analyst, I can view experiment results with metrics per
545
+ variant in Fluent Analytics.
546
+
547
+ ## Acceptance criteria
548
+ - Given multiple profile variants and a traffic split, when requests are
549
+ routed, then variants receive traffic according to the split within
550
+ +/-1% error over sufficient volume.
551
+ - Given an active experiment, when a variant underperforms thresholds,
552
+ then the system can pause/adjust the split via config without redeploy.
553
+ - Given experiment data, when results are requested, then metrics
554
+ (conversion, p95 latency, cost per order) are reported per variant.
555
+
556
+ ## Non-functional requirements
557
+ - p95 latency: +<5 ms overhead from routing logic.
558
+ - Availability: 99.9%.
559
+ - Auditability: experiment definitions and changes are versioned.
560
+
561
+ ## Constraints
562
+ - backward_compatible
563
+ - no_pii_in_logs
564
+
565
+ ## Interfaces
566
+ - Fluent AI Skills (Fluent CLI, Fluent MCP)
567
+ - Fluent Analytics (Google Looker)
568
+
569
+ ## Conventions
570
+ - Testing: unit (routing), contract (Profile APIs), smoke (experiment
571
+ start/stop), golden (metrics aggregation).
572
+ - Versioning: semver
573
+
574
+ ## Artifacts requested
575
+ - Code (new or updated orchestration rules)
576
+ - Orchestration Workflow (updated orchestration workflow)
577
+ - Tests (unit / orchestration / end to end)
578
+ - Docs (README, Confluence)
579
+
580
+ ## Deployment targets
581
+ - fluent:account/retailer-demo
582
+ - feature flag: sourcing.abtest.enabled
583
+ ```
584
+
585
+ ### Output: Task List (JSON)
586
+
587
+ ```json
588
+ {
589
+ "schema": "scope-decomposition-v1",
590
+ "scopeDocument": "scope/sourcing-abtesting.md",
591
+ "module": "fcx.sourcing.abtesting",
592
+ "generatedAt": "2026-02-23T10:00:00Z",
593
+ "profile": "HMDEV",
594
+ "tasks": [
595
+ {
596
+ "id": "T-001",
597
+ "type": "SCAFFOLD",
598
+ "title": "Scaffold module fcx.sourcing.abtesting",
599
+ "description": "Create module skeleton for sourcing A/B testing. Entity type: ORDER. Includes Maven structure, module.json, build scripts, and test harness.",
600
+ "skill": "fluent-module-scaffold",
601
+ "dependsOn": [],
602
+ "storyRef": null,
603
+ "inputs": {
604
+ "module-name": "sourcing-abtesting",
605
+ "entity-types": ["ORDER"],
606
+ "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator", "ExperimentConfigReader"]
607
+ },
608
+ "acceptanceCriteria": [],
609
+ "priority": 1,
610
+ "status": "pending"
611
+ },
612
+ {
613
+ "id": "T-002",
614
+ "type": "RULE",
615
+ "title": "Implement experiment variant definition rule",
616
+ "description": "Rule to allow defining two or more sourcing profile variants (A/B/...) for an experiment. Reads experiment config from settings, registers variants on the entity.",
617
+ "skill": "fluent-rule-scaffold",
618
+ "dependsOn": ["T-001"],
619
+ "storyRef": "US-201",
620
+ "inputs": {
621
+ "rule-name": "ExperimentVariantRouter",
622
+ "entity-type": "ORDER"
623
+ },
624
+ "acceptanceCriteria": [],
625
+ "priority": 2,
626
+ "status": "pending"
627
+ },
628
+ {
629
+ "id": "T-003",
630
+ "type": "RULE",
631
+ "title": "Implement traffic split allocation rule",
632
+ "description": "Rule to allocate traffic across sourcing profile variants based on configured percentage splits (e.g., 50/50, 10/90).",
633
+ "skill": "fluent-rule-scaffold",
634
+ "dependsOn": ["T-001"],
635
+ "storyRef": "US-202",
636
+ "inputs": {
637
+ "rule-name": "TrafficSplitAllocator",
638
+ "entity-type": "ORDER"
639
+ },
640
+ "acceptanceCriteria": [
641
+ "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume."
642
+ ],
643
+ "priority": 3,
644
+ "status": "pending"
645
+ },
646
+ {
647
+ "id": "T-004",
648
+ "type": "RULE",
649
+ "title": "Implement experiment config reader rule",
650
+ "description": "Rule to read experiment configuration (variant definitions, split ratios, pause/adjust state) from retailer settings without requiring redeploy.",
651
+ "skill": "fluent-rule-scaffold",
652
+ "dependsOn": ["T-001"],
653
+ "storyRef": "US-202",
654
+ "inputs": {
655
+ "rule-name": "ExperimentConfigReader",
656
+ "entity-type": "ORDER"
657
+ },
658
+ "acceptanceCriteria": [
659
+ "Given an active experiment, when a variant underperforms thresholds, then the system can pause/adjust the split via config without redeploy."
660
+ ],
661
+ "priority": 4,
662
+ "status": "pending"
663
+ },
664
+ {
665
+ "id": "T-005",
666
+ "type": "SETTING",
667
+ "title": "Create experiment configuration settings",
668
+ "description": "Create retailer-scoped settings for experiment definitions, variant splits, and threshold configuration. Settings must be updatable without module redeploy.",
669
+ "skill": "fluent-settings",
670
+ "dependsOn": ["T-001"],
671
+ "storyRef": "US-202",
672
+ "inputs": {
673
+ "settings": [
674
+ { "name": "sourcing.experiment.config", "context": "RETAILER" },
675
+ { "name": "sourcing.experiment.thresholds", "context": "RETAILER" }
676
+ ]
677
+ },
678
+ "acceptanceCriteria": [],
679
+ "priority": 5,
680
+ "status": "pending"
681
+ },
682
+ {
683
+ "id": "T-006",
684
+ "type": "WORKFLOW",
685
+ "title": "Add A/B test rulesets to ORDER sourcing workflow",
686
+ "description": "Extend the ORDER workflow with rulesets for experiment routing: insert ExperimentVariantRouter and TrafficSplitAllocator into the sourcing event chain. Add statuses if needed for experiment branching.",
687
+ "skill": "fluent-workflow-builder",
688
+ "dependsOn": ["T-002", "T-003", "T-004"],
689
+ "storyRef": "US-201",
690
+ "inputs": {
691
+ "workflow-type": "ORDER",
692
+ "rulesets-to-add": ["ExperimentRouting"]
693
+ },
694
+ "acceptanceCriteria": [],
695
+ "priority": 6,
696
+ "status": "pending"
697
+ },
698
+ {
699
+ "id": "T-007",
700
+ "type": "TEST_UNIT",
701
+ "title": "Write unit tests for routing and split rules",
702
+ "description": "Unit tests for ExperimentVariantRouter, TrafficSplitAllocator, and ExperimentConfigReader. Cover: correct split distribution, config read/parse, edge cases (0% split, 100% split, missing config).",
703
+ "skill": "fluent-build",
704
+ "dependsOn": ["T-002", "T-003", "T-004"],
705
+ "storyRef": "US-201",
706
+ "inputs": {},
707
+ "acceptanceCriteria": [
708
+ "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume."
709
+ ],
710
+ "priority": 7,
711
+ "status": "pending"
712
+ },
713
+ {
714
+ "id": "T-008",
715
+ "type": "BUILD",
716
+ "title": "Build module fcx.sourcing.abtesting",
717
+ "description": "Compile all rule classes, run unit tests, and package into deployable ZIP artifact.",
718
+ "skill": "fluent-build",
719
+ "dependsOn": ["T-002", "T-003", "T-004", "T-005", "T-006", "T-007"],
720
+ "storyRef": null,
721
+ "inputs": {},
722
+ "acceptanceCriteria": [],
723
+ "priority": 8,
724
+ "status": "pending"
725
+ },
726
+ {
727
+ "id": "T-009",
728
+ "type": "VALIDATE",
729
+ "title": "Validate module structure",
730
+ "description": "Run /fluent-module-validate to confirm module.json, Maven structure, rule wiring, test coverage, and version consistency.",
731
+ "skill": "fluent-module-validate",
732
+ "dependsOn": ["T-008"],
733
+ "storyRef": null,
734
+ "inputs": {},
735
+ "acceptanceCriteria": [],
736
+ "priority": 9,
737
+ "status": "pending"
738
+ },
739
+ {
740
+ "id": "T-010",
741
+ "type": "VERSION",
742
+ "title": "Bump version to 1.0.0",
743
+ "description": "Set initial release version across module.json, all POMs, and CHANGELOG.md. Tag as v1.0.0.",
744
+ "skill": "fluent-version-manage",
745
+ "dependsOn": ["T-008"],
746
+ "storyRef": null,
747
+ "inputs": {
748
+ "command": "bump",
749
+ "level": "minor"
750
+ },
751
+ "acceptanceCriteria": [],
752
+ "priority": 10,
753
+ "status": "pending"
754
+ },
755
+ {
756
+ "id": "T-011",
757
+ "type": "DEPLOY",
758
+ "title": "Deploy module to retailer-demo",
759
+ "description": "Deploy fc-module-sourcing-abtesting ZIP to fluent:account/retailer-demo.",
760
+ "skill": "fluent-module-deploy",
761
+ "dependsOn": ["T-008", "T-009"],
762
+ "storyRef": null,
763
+ "inputs": {
764
+ "target": "fluent:account/retailer-demo"
765
+ },
766
+ "acceptanceCriteria": [],
767
+ "priority": 11,
768
+ "status": "pending"
769
+ },
770
+ {
771
+ "id": "T-012",
772
+ "type": "WORKFLOW_DEPLOY",
773
+ "title": "Deploy updated ORDER workflow",
774
+ "description": "Upload the modified ORDER workflow with A/B test rulesets to the target retailer.",
775
+ "skill": "fluent-workflow-deploy",
776
+ "dependsOn": ["T-006"],
777
+ "storyRef": null,
778
+ "inputs": {},
779
+ "acceptanceCriteria": [],
780
+ "priority": 12,
781
+ "status": "pending"
782
+ },
783
+ {
784
+ "id": "T-013",
785
+ "type": "CONFIG",
786
+ "title": "Configure feature flag and experiment settings",
787
+ "description": "Enable feature flag sourcing.abtest.enabled on target retailer. Populate initial experiment configuration settings.",
788
+ "skill": "fluent-retailer-config",
789
+ "dependsOn": ["T-011"],
790
+ "storyRef": null,
791
+ "inputs": {
792
+ "feature-flag": "sourcing.abtest.enabled"
793
+ },
794
+ "acceptanceCriteria": [],
795
+ "priority": 13,
796
+ "status": "pending"
797
+ },
798
+ {
799
+ "id": "T-014",
800
+ "type": "TEST_E2E",
801
+ "title": "Run end-to-end experiment routing test",
802
+ "description": "Create orders against the deployed workflow and verify traffic is split across variants. Confirm experiment config changes take effect without redeploy.",
803
+ "skill": "fluent-e2e-test",
804
+ "dependsOn": ["T-011", "T-012", "T-013"],
805
+ "storyRef": "US-201",
806
+ "inputs": {},
807
+ "acceptanceCriteria": [
808
+ "Given multiple profile variants and a traffic split, when requests are routed, then variants receive traffic according to the split within +/-1% error over sufficient volume.",
809
+ "Given an active experiment, when a variant underperforms thresholds, then the system can pause/adjust the split via config without redeploy."
810
+ ],
811
+ "priority": 14,
812
+ "status": "pending"
813
+ },
814
+ {
815
+ "id": "T-015",
816
+ "type": "DOC",
817
+ "title": "Generate module documentation",
818
+ "description": "Create README.md with module overview, rule descriptions, configuration guide, and deployment instructions.",
819
+ "skill": null,
820
+ "dependsOn": ["T-008"],
821
+ "storyRef": null,
822
+ "inputs": {},
823
+ "acceptanceCriteria": [],
824
+ "priority": 15,
825
+ "status": "pending"
826
+ },
827
+ {
828
+ "id": "T-016",
829
+ "type": "CHECKLIST",
830
+ "title": "Run pre-deployment checklist",
831
+ "description": "Execute full pre-deploy validation: environment readiness, module integrity, workflow validity, settings completeness, and risk assessment.",
832
+ "skill": "fluent-pre-deploy-check",
833
+ "dependsOn": ["T-008", "T-009", "T-010", "T-011", "T-012", "T-013", "T-014", "T-015"],
834
+ "storyRef": null,
835
+ "inputs": {},
836
+ "acceptanceCriteria": [],
837
+ "priority": 16,
838
+ "status": "pending"
839
+ }
840
+ ],
841
+ "ambiguities": [
842
+ {
843
+ "section": "Interfaces",
844
+ "item": "Fluent Analytics (Google Looker)",
845
+ "issue": "No skill or MCP tool covers Looker dashboard creation. Story US-203 requires metrics visualization in Fluent Analytics, which is outside agent tooling scope. Requires manual implementation or external tooling.",
846
+ "severity": "HIGH"
847
+ },
848
+ {
849
+ "section": "Acceptance criteria",
850
+ "item": "within +/-1% error over sufficient volume",
851
+ "issue": "Statistical validation of traffic distribution requires volume thresholds and statistical testing that existing E2E test tools cannot automate. Manual verification or custom test harness needed.",
852
+ "severity": "MEDIUM"
853
+ },
854
+ {
855
+ "section": "User stories",
856
+ "item": "[US-203] view experiment results with metrics per variant",
857
+ "issue": "Story requires Fluent Analytics dashboard work. No tasks generated for Looker integration — only data-side tasks can be automated.",
858
+ "severity": "HIGH"
859
+ }
860
+ ],
861
+ "constraints": {
862
+ "backward_compatible": true,
863
+ "no_pii_in_logs": true
864
+ },
865
+ "traceabilityMatrix": {
866
+ "US-201": ["T-002", "T-006", "T-007", "T-014"],
867
+ "US-202": ["T-003", "T-004", "T-005", "T-014"],
868
+ "US-203": []
869
+ },
870
+ "nfrs": [
871
+ { "requirement": "p95 latency: +<5 ms overhead from routing logic", "threshold": "5ms", "appliesTo": ["T-002", "T-003"] },
872
+ { "requirement": "Availability: 99.9%", "threshold": "99.9%", "appliesTo": ["T-014"] },
873
+ { "requirement": "Auditability: experiment definitions and changes are versioned", "threshold": null, "appliesTo": ["T-004", "T-005"] }
874
+ ],
875
+ "deploymentTargets": [
876
+ { "target": "fluent:account/retailer-demo", "featureFlag": "sourcing.abtest.enabled" }
877
+ ]
878
+ }
879
+ ```
880
+
881
+ ### Variation: EXTEND Path (Existing Module)
882
+
883
+ If the scope document's module matches an existing deployed module with source in `SOURCE/`, the first task changes from SCAFFOLD to EXTEND:
884
+
885
+ ```json
886
+ {
887
+ "id": "T-001",
888
+ "type": "EXTEND",
889
+ "title": "Extend existing module hm-extensions with A/B testing rules",
890
+ "description": "Module hm-extensions already exists in accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/. Add new rules for A/B testing. Source analyzed — existing rules: SendWebhook, ValidateOrder, ...",
891
+ "skill": "fluent-rule-scaffold",
892
+ "dependsOn": [],
893
+ "storyRef": null,
894
+ "inputs": {
895
+ "existing-module-path": "accounts/HMDEV/SOURCE/fluentcommerce-fc-module-hm-extensions/",
896
+ "entity-types": ["ORDER"],
897
+ "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator", "ExperimentConfigReader"]
898
+ },
899
+ "acceptanceCriteria": [],
900
+ "priority": 1,
901
+ "status": "pending"
902
+ }
903
+ ```
904
+
905
+ If the module is deployed but source is **not** in `SOURCE/`, a SOURCE_ONBOARD task precedes EXTEND:
906
+
907
+ ```json
908
+ {
909
+ "id": "T-001",
910
+ "type": "SOURCE_ONBOARD",
911
+ "title": "Obtain source code for module hm-extensions",
912
+ "description": "Module hm-extensions is deployed (rules found via plugin.list) but no source in accounts/HMDEV/SOURCE/. Clone the repository or decompile the deployed JAR to obtain source before extending.",
913
+ "skill": "fluent-custom-code",
914
+ "dependsOn": [],
915
+ "storyRef": null,
916
+ "inputs": {
917
+ "module-name": "hm-extensions",
918
+ "profile": "HMDEV"
919
+ },
920
+ "acceptanceCriteria": [],
921
+ "priority": 1,
922
+ "status": "pending"
923
+ },
924
+ {
925
+ "id": "T-002",
926
+ "type": "EXTEND",
927
+ "title": "Extend module hm-extensions with A/B testing rules",
928
+ "description": "Add new rules to hm-extensions after source onboarding completes.",
929
+ "skill": "fluent-rule-scaffold",
930
+ "dependsOn": ["T-001"],
931
+ "storyRef": null,
932
+ "inputs": {
933
+ "entity-types": ["ORDER"],
934
+ "rules": ["ExperimentVariantRouter", "TrafficSplitAllocator"]
935
+ },
936
+ "acceptanceCriteria": [],
937
+ "priority": 2,
938
+ "status": "pending"
939
+ }
940
+ ```
941
+
942
+ **Key difference:** When extending, all RULE tasks depend on EXTEND (not SCAFFOLD), and the EXTEND task's inputs include the existing module path so the rule scaffolder knows where to add files.
943
+
944
+ ### Output: Traceability Gaps
945
+
946
+ From the example above, `US-203` has an empty task array in the traceability matrix. The skill reports this prominently:
947
+
948
+ ```
949
+ TRACEABILITY GAPS
950
+ [HIGH] US-203 "view experiment results with metrics per variant"
951
+ -> 0 tasks generated (Fluent Analytics integration outside agent scope)
952
+ -> Recommend: assign to human for manual Looker dashboard creation
953
+ ```
954
+
955
+ ## Console Output Format
956
+
957
+ After generating the task list, print a human-readable summary:
958
+
959
+ ```
960
+ === Scope Decomposition: fcx.sourcing.abtesting ===
961
+
962
+ Source: scope/sourcing-abtesting.md
963
+ Module: fcx.sourcing.abtesting
964
+ Profile: HMDEV
965
+
966
+ Tasks Generated: 16
967
+ SCAFFOLD: 1
968
+ RULE: 3
969
+ WORKFLOW: 1
970
+ SETTING: 1
971
+ TEST_UNIT: 1
972
+ BUILD: 1
973
+ VALIDATE: 1
974
+ VERSION: 1
975
+ DEPLOY: 1
976
+ WORKFLOW_DEPLOY: 1
977
+ CONFIG: 1
978
+ TEST_E2E: 1
979
+ DOC: 1
980
+ CHECKLIST: 1
981
+
982
+ Dependency Chain Depth: 5 (SCAFFOLD -> RULE -> WORKFLOW -> BUILD -> DEPLOY -> TEST_E2E)
983
+
984
+ Ambiguities: 3 (2 HIGH, 1 MEDIUM, 0 LOW)
985
+ [HIGH] Fluent Analytics (Google Looker) — no skill mapping
986
+ [HIGH] US-203 no tasks generated (Looker integration)
987
+ [MEDIUM] +/-1% error — unmeasurable by existing test tools
988
+
989
+ Traceability:
990
+ US-201: 4 tasks (covered)
991
+ US-202: 4 tasks (covered)
992
+ US-203: 0 tasks (GAP requires human action)
993
+
994
+ Constraints Applied: backward_compatible, no_pii_in_logs
995
+
996
+ Output:
997
+ accounts/HMDEV/analysis/scope/fcx-sourcing-abtesting.tasks.json
998
+ ```
999
+
1000
+ ## Markdown Output Format (--output-format markdown)
1001
+
1002
+ When markdown output is requested, produce a table-based summary alongside the JSON:
1003
+
1004
+ ```markdown
1005
+ # Task List: fcx.sourcing.abtesting
1006
+
1007
+ | ID | Type | Title | Skill | Depends On | Story | Priority |
1008
+ |----|------|-------|-------|-----------|-------|----------|
1009
+ | T-001 | SCAFFOLD | Scaffold module fcx.sourcing.abtesting | fluent-module-scaffold | -- | -- | 1 |
1010
+ | T-002 | RULE | Implement experiment variant definition rule | fluent-rule-scaffold | T-001 | US-201 | 2 |
1011
+ | T-003 | RULE | Implement traffic split allocation rule | fluent-rule-scaffold | T-001 | US-202 | 3 |
1012
+ | ... | ... | ... | ... | ... | ... | ... |
1013
+
1014
+ ## Ambiguities
1015
+
1016
+ | Severity | Section | Item | Issue |
1017
+ |----------|---------|------|-------|
1018
+ | HIGH | Interfaces | Fluent Analytics (Google Looker) | No skill mapping |
1019
+ | HIGH | User stories | US-203 | No tasks generated |
1020
+ | MEDIUM | Acceptance criteria | +/-1% error | Unmeasurable |
1021
+
1022
+ ## Traceability
1023
+
1024
+ | Story | Tasks | Coverage |
1025
+ |-------|-------|----------|
1026
+ | US-201 | T-002, T-006, T-007, T-014 | Covered |
1027
+ | US-202 | T-003, T-004, T-005, T-014 | Covered |
1028
+ | US-203 | (none) | GAP |
1029
+ ```
1030
+
1031
+ ## Batch Feature Stubbing (optional)
1032
+
1033
+ After decomposition identifies multiple features, optionally create feature directory stubs so the user can work through them sequentially.
1034
+
1035
+ ### When to offer
1036
+
1037
+ Offer batch stubbing when the decomposition produces **3 or more** distinct features. For 1-2 features, individual creation via `/fluent-use-case-discover` is fine.
1038
+
1039
+ ### How it works
1040
+
1041
+ 1. **Present the feature list** from decomposition with suggested slugs:
1042
+ ```
1043
+ Decomposition identified 5 features:
1044
+ 1. curbside-pickup — Curbside pickup flow for HD orders
1045
+ 2. bulky-fulfilment-split — Split fulfilments by product bulky attribute
1046
+ 3. wms-integration — WMS dispatch webhook integration
1047
+ 4. returns-self-service — Customer-initiated return flow
1048
+ 5. inventory-reservation — Real-time inventory reservation at order creation
1049
+
1050
+ Create feature directory stubs for all 5? (y/n)
1051
+ ```
1052
+
1053
+ 2. **On user confirmation**, create for each feature:
1054
+ ```bash
1055
+ mkdir -p accounts/<PROFILE>/features/<slug>
1056
+ ```
1057
+
1058
+ Write `status.json` in DISCOVERY state:
1059
+ ```json
1060
+ {
1061
+ "$schema": "feature-status-v1",
1062
+ "feature": "<slug>",
1063
+ "retailers": ["<RETAILER>"],
1064
+ "status": "DISCOVERY",
1065
+ "created": "<TODAY>",
1066
+ "updated": "<TODAY>",
1067
+ "spec": null,
1068
+ "plan": null,
1069
+ "planRevision": null,
1070
+ "architecture": false,
1071
+ "basedOn": null,
1072
+ "next": "/fluent-use-case-discover",
1073
+ "sessions": [],
1074
+ "archivedOn": null
1075
+ }
1076
+ ```
1077
+
1078
+ 3. **Show summary** after creation:
1079
+ ```
1080
+ Created 5 feature stubs:
1081
+ ✓ features/curbside-pickup/status.json [DISCOVERY] → next: /fluent-use-case-discover
1082
+ ✓ features/bulky-fulfilment-split/status.json [DISCOVERY] → next: /fluent-use-case-discover
1083
+ ✓ features/wms-integration/status.json [DISCOVERY] → next: /fluent-use-case-discover
1084
+ ✓ features/returns-self-service/status.json [DISCOVERY] → next: /fluent-use-case-discover
1085
+ ✓ features/inventory-reservation/status.json [DISCOVERY] → next: /fluent-use-case-discover
1086
+
1087
+ Run `/fluent-feature-status` to see the dashboard, then start with:
1088
+ /fluent-use-case-discover --feature curbside-pickup
1089
+ ```
1090
+
1091
+ 4. **Handoff:** Recommend `/fluent-feature-status` to see the full dashboard, then start working through features one by one with `/fluent-use-case-discover`.
1092
+
1093
+ ### Slug generation rules
1094
+
1095
+ - Lowercase kebab-case
1096
+ - Max 4 words
1097
+ - No dates, no skill prefixes
1098
+ - Derived from the feature title in the scope document
1099
+ - Auto-suggested, user confirms or overrides
1100
+
1101
+ ### Dependencies between features
1102
+
1103
+ If decomposition identifies dependencies between features (feature B depends on feature A), note the recommended order:
1104
+ ```
1105
+ Recommended order (based on dependencies):
1106
+ 1. inventory-reservation (no dependencies)
1107
+ 2. bulky-fulfilment-split (no dependencies)
1108
+ 3. curbside-pickup (depends on: inventory-reservation)
1109
+ 4. wms-integration (depends on: bulky-fulfilment-split)
1110
+ 5. returns-self-service (depends on: inventory-reservation)
1111
+ ```
1112
+
1113
+ ## Tips
1114
+
1115
+ - **Run `--validate-only` first** to check the scope document structure before generating a full task list. This catches missing sections and structural issues early.
1116
+ - **Scope documents should be machine-parseable** — use consistent heading levels, bullet lists with identifiers, and Given/When/Then format for criteria. The ADD template enforces this.
1117
+ - **One module per scope document** — if the scope covers multiple modules, split it into separate documents and run decomposition on each.
1118
+ - **Review ambiguities before executing tasks** — HIGH severity ambiguities often indicate scope gaps that need human resolution. Running tasks against an ambiguous scope wastes agent cycles.
1119
+ - **The task list is a living document** — the orchestrator updates task statuses in-place as work progresses. Re-running decomposition overwrites the file, so back up if in-progress work exists.
1120
+ - **Custom task types** — if a scope requires work outside the standard type table (e.g., database migration, external API setup), generate a DOC-type placeholder with `skill: null` and flag as ambiguity.
1121
+ - **Story-to-criteria linking** — if criteria do not explicitly reference story IDs, the skill links them by order of appearance. For precise linking, include `[US-NNN]` references in criteria text.
1122
+ - **Large scope documents** — for scopes with 20+ stories, the task list can exceed 50 tasks. Review the dependency DAG visualization to identify parallelizable task groups.
1123
+ - **Multi-feature scopes** — If your scope document covers multiple features, use `--batch-features` to create feature stubs automatically. This gives you a clear picture of the work ahead before diving into individual specs.