You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add spec_generator workflow with API research step, improve component_generator
- New spec_generator workflow: plain English description → rich JSON spec with
props, dependencies, and API integration details
- API research step detects external APIs and documents exact endpoints, auth
methods, response shapes, and implementation notes
- Component generator now receives API integration context and passes it to the
React component prompt, producing correct fetch code with null safety
- Fix evaluator: switch from generateObject to generateText + manual JSON parse
to avoid nested Zod schema failures
- Fix propsGrouped check: replace regex with brace-depth counting parser to
handle curly braces in string values (e.g. "{count} open positions")
- Add vite-env.d.ts to scaffold template for CSS import TypeScript support
- Add Greenhouse job board test scenario for API integration testing
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: webflow-code-components/src/workflows/component_generator/prompts/evaluate_component@v1.prompt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -181,5 +181,7 @@ Please evaluate this component against all six criteria. Return a structured JSO
181
181
2. Detailed reasoning explaining the score with specific examples
182
182
3. Per-criterion scores and notes
183
183
184
+
IMPORTANT: Return ONLY raw JSON. Do NOT wrap the output in markdown code fences (```json or ```). Output the JSON object directly with no extra text before or after it.
185
+
184
186
Remember: If scoring below 90, you MUST list exactly what needs to change so the generator can fix it on the next iteration.
This component integrates with external APIs. Use the EXACT endpoints, query parameters, and response shapes documented below. Do NOT guess or hallucinate API details.
222
+
223
+
{{ apiIntegrations }}
224
+
225
+
CRITICAL RULES for API integration:
226
+
1. Use the EXACT endpoint URL provided — including all required query parameters
227
+
2. Use the EXACT field names from the responseShape — do not rename or assume fields
228
+
3. Mark fields as optional in your TypeScript interface if the responseShape marks them with `?`
229
+
4. Add null-safety (`|| []`, `?.`, `?? ''`) for ALL optional/nullable fields
230
+
5. Handle loading and error states (show a loading spinner, then results or an error message)
231
+
6. The API key / token prop should have a sensible placeholder default value
232
+
7. Respect the authMethod: 'none' = no auth, 'path-token' = token in URL path, 'api-key-query' = key as query param, 'api-key-header' = key in request header, 'bearer-token' = Authorization: Bearer header
233
+
8. If notes mention CORS issues, add appropriate error handling
234
+
</api-integrations>
235
+
{% endif %}
236
+
207
237
<css-class-prefix>
208
238
Use `wf-{{ classPrefix }}-` for all CSS class names.
209
239
The root element must have exactly the class: `wf-{{ classPrefix }}`
Copy file name to clipboardExpand all lines: webflow-code-components/src/workflows/component_generator/prompts/generate_simple_declaration@v1.prompt
+71-29Lines changed: 71 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
# Simple Webflow Declaration Generator v1
3
3
#
4
4
# Takes the full .webflow.tsx declaration and produces a simplified version
5
-
# that only exposes core content props a client would need to edit.
5
+
# that only exposes the props a CLIENT would realistically change post-handoff.
6
6
#
7
7
# Variables:
8
8
# - componentName (string, required): PascalCase component name
@@ -20,36 +20,76 @@ maxTokens: 3000
20
20
---
21
21
<system>
22
22
## Role
23
-
You create simplified Webflow component declarations. Given a full declaration with many props, you produce a "client-friendly" version that only exposes the props a non-technical user would need to configure.
23
+
You create simplified Webflow component declarations for client handoff. Given a full declaration with many props, you produce a drastically reduced version with only the props a non-technical client would realistically need to change.
24
24
25
25
## Context
26
-
Agencies building Webflow code components often create two versions:
27
-
1. **Full version**: All props exposed — layout variants, animation settings, spacing, every text field. For developers building the site.
28
-
2. **Simple version**: Only the core content props — text, links, images, key toggles. For clients editing content after handoff.
29
-
30
-
Both versions use the SAME React component and CSS. The only difference is which props appear in the Webflow Designer panel.
31
-
32
-
## What to KEEP in the Simple Version
33
-
- **Text and TextNode props**: All user-visible text content (headings, descriptions, button text, labels)
34
-
- **Link props**: All URLs/links (CTAs, navigation)
35
-
- **Image props**: All images
36
-
- **Visibility props**: Show/hide toggles for major sections
37
-
- **Key Boolean props**: Important on/off switches that affect content (e.g., `showFooter`)
38
-
- **Id prop**: Always include for CSS/JS targeting
Agencies building Webflow code components create two versions:
27
+
1. **Full version**: All props exposed — every text field, layout variant, animation setting. For the developer/agency building the site.
28
+
2. **Simple version**: ONLY the props a client would change when editing their own site. This is the handoff version.
29
+
30
+
Both use the SAME React component and CSS. The React component has sensible defaults for all props, so anything not exposed in the simple version just uses its default.
31
+
32
+
## The Client Handoff Test
33
+
34
+
Ask yourself: **"After the agency hands off the site, what would the client realistically change?"**
35
+
36
+
A client editing their pricing page would change:
37
+
- Plan names and prices (they updated their pricing)
38
+
- CTA button text and links (they changed their signup flow)
39
+
- Whether a section is visible (they dropped a tier)
40
+
- The main heading (they rebranded)
41
+
42
+
A client would NOT change:
43
+
- Billing period format ("/month" → they'd just ask the agency)
44
+
- Feature list details (too granular, they'd ask the agency)
45
+
- Descriptions/subtitles (set once during build, rarely touched)
46
+
- Layout direction (horizontal vs vertical — that's a design decision)
47
+
- Badge text ("Most Popular" — set during build)
48
+
- Footer copy (set once, rarely changed)
49
+
50
+
## What to KEEP (target: 8-15 props)
51
+
52
+
**Always keep:**
53
+
- `id` (Id) — always include
54
+
- Primary headings/titles (TextNode) — the main text a client sees
55
+
- Primary values that change often (Text) — prices, names of things
56
+
- CTA/action text (Text) — button labels
57
+
- CTA/action links (Link) — where buttons go
58
+
- Section visibility (Visibility) — show/hide major sections
59
+
60
+
**Keep only if the component has them:**
61
+
- Image props — hero images, logos
62
+
- Key toggles — prominent on/off switches the client controls
**Task**: Create a simplified version of this declaration that keeps only the core content props (text, links, images, visibility, id). Remove layout variants, style config, number props, and technical behavior props.
112
+
**Task**: Apply the "client handoff test" — keep ONLY the props a non-technical client would realistically change on their own site. Be aggressive about cutting. The React component has sensible defaults for everything, so removed props just use defaults.
113
+
114
+
Target: roughly 40-50% fewer props than the full version.
73
115
74
-
The component name in the declaration should be `"{{ componentName }} (Simple)"`.
116
+
The component name should be `"{{ componentName }} (Simple)"`.
75
117
76
118
**Output**: Complete `.webflow.tsx` file contents only. No markdown fences, no explanation.
0 commit comments