@addai/flows-mcp 1.0.0-rc.4 → 1.0.0-rc.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/skill/SKILL.md +2 -1
- package/skill/anti-patterns.md +35 -0
- package/skill/recipes.md +5 -4
- package/skill/version.txt +1 -1
package/package.json
CHANGED
package/skill/SKILL.md
CHANGED
|
@@ -32,7 +32,7 @@ You MUST follow this loop. Each step has a named tool.
|
|
|
32
32
|
|
|
33
33
|
**You have not finished if you did not validate and test before publishing.**
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Nine rules you must not break
|
|
36
36
|
|
|
37
37
|
1. **Never guess a node's config schema.** Call `describe_node_type(type)` first if you have not used this type in this session.
|
|
38
38
|
2. **NEVER pass a `position` to `add_nodes`. EVER.** It auto-places horizontally (left → right). If you pass positions you will get a vertical-stacked flow that the user has to manually fix. If positions get messy mid-build, call `autolayout` once at the end.
|
|
@@ -42,6 +42,7 @@ You MUST follow this loop. Each step has a named tool.
|
|
|
42
42
|
6. **Never publish without `pre_publish_check`.** Even if validation passes.
|
|
43
43
|
7. **The flow MUST be horizontal on the canvas.** Trigger on the far left, terminators on the far right. If `validate_flow` returns `LAYOUT_VERTICAL_DRIFT`, fix it before you continue.
|
|
44
44
|
8. **Every form input MUST have a `label`. Every `page` MUST start with a `textBlock` heading.** Forms with empty labels render as unmarked grey rectangles and are unusable. See AP14. Pick the right element type per field (`email`, `shortText`, `longText`, `dropdown`, etc.) — do not use `longText` for short single-line input.
|
|
45
|
+
9. **Every non-terminal `page` MUST include at least one `button` element with `buttonAction: "submit"`.** No button = no way to advance the flow. The button's text field is `buttonText` (NOT `label`). Action values: `submit` / `link` / `stop` / `restart`. See AP15 and AP16.
|
|
45
46
|
|
|
46
47
|
## Tool-by-step quick reference
|
|
47
48
|
|
package/skill/anti-patterns.md
CHANGED
|
@@ -174,3 +174,38 @@ publish_flow(flow_id) # only if check returned ready
|
|
|
174
174
|
**Quick check before saving the page node:** ask yourself "if a stranger opened this form, would they know what to fill in without me explaining?" If no, the labels/headings are missing.
|
|
175
175
|
|
|
176
176
|
See Recipe 1 in `recipes.md` for a fully-fleshed example.
|
|
177
|
+
|
|
178
|
+
## AP15 — Form without a submit button
|
|
179
|
+
|
|
180
|
+
**Mistake:** Building a `page` node with input elements but no `button` element. Users fill the form and have nowhere to click — the flow is stuck forever.
|
|
181
|
+
|
|
182
|
+
**Why it's wrong:** A page node advances to its `right` source handle only when the user presses a submit-action button. Without one, the page never completes. There is no implicit Continue button — *you must add one*. `validate_flow` raises `PAGE_MISSING_SUBMIT_BUTTON` for non-terminal pages without a `buttonAction: "submit"` button.
|
|
183
|
+
|
|
184
|
+
**Do instead:** Every non-terminal page MUST include at least one button element. The shape:
|
|
185
|
+
|
|
186
|
+
```js
|
|
187
|
+
{
|
|
188
|
+
id: "submit",
|
|
189
|
+
type: "button",
|
|
190
|
+
buttonText: "Send feedback", // NOT `label` — the field is buttonText
|
|
191
|
+
buttonAction: "submit", // submit | link | stop | restart
|
|
192
|
+
buttonAlign: "left",
|
|
193
|
+
buttonColor: "#3b82f6",
|
|
194
|
+
}
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
**Button action values (from `describe_page_element("button")`):**
|
|
198
|
+
- `submit` (default) — fires the page's `right` source handle and advances the flow. The typical Continue/Send button.
|
|
199
|
+
- `link` — opens `buttonLink` in same tab or new tab (`buttonLinkNewTab`). Does NOT advance the flow.
|
|
200
|
+
- `stop` — terminates the flow without advancing.
|
|
201
|
+
- `restart` — restarts the flow from the trigger.
|
|
202
|
+
|
|
203
|
+
**Terminal pages exemption:** pages with `isGoal: true` or `isExit: true` don't need a submit button (the flow has already terminated), though you may still want a `link` button ("Back to home") or a `restart` button ("Submit another").
|
|
204
|
+
|
|
205
|
+
## AP16 — Button using `label` instead of `buttonText`
|
|
206
|
+
|
|
207
|
+
**Mistake:** `{type: "button", label: "Continue", action: "submit"}`.
|
|
208
|
+
|
|
209
|
+
**Why it's wrong:** The page renderer reads `buttonText` / `buttonAction` / `buttonAlign` / `buttonColor` / `buttonLink` / `buttonLinkNewTab`. The generic `label` / `action` keys from other element types do nothing on a button — your button shows the literal default text ("Continue") and uses the default action.
|
|
210
|
+
|
|
211
|
+
**Do instead:** Call `describe_page_element("button")` before adding a button element. Use the exact field names: `buttonText`, `buttonAction`, `buttonAlign`, `buttonColor`, `buttonLink`, `buttonLinkNewTab`, `width`.
|
package/skill/recipes.md
CHANGED
|
@@ -84,9 +84,9 @@ Pick the right element type per field:
|
|
|
84
84
|
{
|
|
85
85
|
id: "submit",
|
|
86
86
|
type: "button",
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
buttonText: "Send feedback",
|
|
88
|
+
buttonAction: "submit",
|
|
89
|
+
buttonAlign: "left",
|
|
90
90
|
},
|
|
91
91
|
],
|
|
92
92
|
}},
|
|
@@ -124,7 +124,8 @@ Pick the right element type per field:
|
|
|
124
124
|
- [ ] Every input has a `placeholder` (or sensible `defaultValue`)
|
|
125
125
|
- [ ] Required fields have `required: true`
|
|
126
126
|
- [ ] Short fields (name, email) use `width: "half"` so they sit side-by-side
|
|
127
|
-
- [ ]
|
|
127
|
+
- [ ] **Every non-terminal page has at least one `button` element with `buttonAction: "submit"`** — otherwise the user has no way to advance the flow. The button's field is `buttonText`, NOT `label`. Action values: `submit` / `link` / `stop` / `restart`.
|
|
128
|
+
- [ ] Submit button has a meaningful `buttonText` ("Send feedback", not "Continue")
|
|
128
129
|
- [ ] Thank-you page (`isGoal: true`) has a `textBlock` confirming success
|
|
129
130
|
|
|
130
131
|
If you need a server response back to the form caller (not a confirmation page), use `respondToWebhook` followed by a separate `goal` node — but for typical web forms, the thank-you page IS the natural goal.
|
package/skill/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
2.
|
|
1
|
+
2.3.0
|