@se-studio/contentful-cms 1.0.4 → 1.0.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.
Files changed (33) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -0
  3. package/dist/bin/cms-capture-screenshots.d.ts +4 -0
  4. package/dist/bin/cms-capture-screenshots.d.ts.map +1 -0
  5. package/dist/bin/cms-capture-screenshots.js +183 -0
  6. package/dist/bin/cms-capture-screenshots.js.map +1 -0
  7. package/dist/bin/cms-generate-collection-guidelines.d.ts +4 -0
  8. package/dist/bin/cms-generate-collection-guidelines.d.ts.map +1 -0
  9. package/dist/bin/cms-generate-collection-guidelines.js +209 -0
  10. package/dist/bin/cms-generate-collection-guidelines.js.map +1 -0
  11. package/dist/bin/cms-generate-field-list.d.ts +4 -0
  12. package/dist/bin/cms-generate-field-list.d.ts.map +1 -0
  13. package/dist/bin/cms-generate-field-list.js +114 -0
  14. package/dist/bin/cms-generate-field-list.js.map +1 -0
  15. package/dist/bin/cms-merge-guidelines.d.ts +4 -0
  16. package/dist/bin/cms-merge-guidelines.d.ts.map +1 -0
  17. package/dist/bin/cms-merge-guidelines.js +147 -0
  18. package/dist/bin/cms-merge-guidelines.js.map +1 -0
  19. package/dist/bin/cms-update-colour-hints.d.ts +4 -0
  20. package/dist/bin/cms-update-colour-hints.d.ts.map +1 -0
  21. package/dist/bin/cms-update-colour-hints.js +111 -0
  22. package/dist/bin/cms-update-colour-hints.js.map +1 -0
  23. package/dist/config/load.js +1 -1
  24. package/dist/config/load.js.map +1 -1
  25. package/package.json +7 -2
  26. package/skills/cms-guidelines/README.md +140 -0
  27. package/skills/cms-guidelines/colour-hint-prompt.md +77 -0
  28. package/skills/cms-guidelines/evaluation-prompt.md +84 -0
  29. package/skills/cms-guidelines/generate-component-guidelines.md +126 -0
  30. package/skills/cms-guidelines/generation-prompt.md +202 -0
  31. package/skills/cms-guidelines/validation-prompt.md +170 -0
  32. package/skills/cms-guidelines/variant-loop.md +184 -0
  33. package/skills/cms-guidelines/variant-proposal-prompt.md +127 -0
@@ -0,0 +1,127 @@
1
+ # Variant Proposal Prompt
2
+
3
+ **Step 4.1 — Input/output contract and prompt for proposing component variants.**
4
+
5
+ The variant loop produces screenshots that cover the visual diversity of a component. A good
6
+ set captures: default state, important absent-field states, colour variants, and any layout
7
+ variants (like flipped). The screenshots are then used to write the "What it looks like" and
8
+ "Colours" sections of the guideline.
9
+
10
+ ---
11
+
12
+ ## Input
13
+
14
+ - **Component source file:** full contents of `src/project/components/<Type>.tsx` (or
15
+ `src/project/collections/<Type>.tsx`).
16
+ - **Used fields:** the `USED_FIELDS` or `FIELD_KEYS` from the source file.
17
+ - **Palette:** `backgroundColour` and `textColour` enum values from `generated/cms-discovery/field-list.json`
18
+ (or from `generated/colors.ts`).
19
+ - **N:** number of variants to propose (typically 4–6 for a component, up to 8 for complex ones).
20
+
21
+ The LLM should output **N variants** in JSON format (see below).
22
+
23
+ ---
24
+
25
+ ## Prompt
26
+
27
+ ```
28
+ You are preparing screenshots for CMS component guidelines.
29
+
30
+ I will give you the source code of a Next.js component that renders a CMS entry.
31
+ Your task: propose N variants that, together, best document how the component looks
32
+ under different conditions. Choose variants that are VISUALLY DISTINCT — a reader
33
+ should be able to tell them apart at a glance.
34
+
35
+ Component source:
36
+ <COMPONENT_SOURCE>
37
+
38
+ Palette (backgroundColour options):
39
+ <BACKGROUND_COLOURS>
40
+
41
+ Text colour options (textColour):
42
+ <TEXT_COLOURS>
43
+
44
+ Rules:
45
+ 1. Always include a "default" variant with all optional fields populated and no colour override.
46
+ 2. Include at least one variant per important "missing field" state (e.g. no visual, no links).
47
+ 3. Include at least one colour variant if the component has backgroundColour (use a dark colour
48
+ like Navy or Deep Periwinkle).
49
+ 4. If the component has a flipped/alternate variant (e.g. Hero Flipped), include it.
50
+ 5. Avoid variants that will look identical or near-identical to another variant in the list.
51
+ 6. N = <N>; produce exactly N variants (or fewer if the component is simple).
52
+
53
+ Output JSON only, no explanation. Format:
54
+ {
55
+ "typeName": "<CMS componentType or collectionType>",
56
+ "variants": [
57
+ {
58
+ "label": "default",
59
+ "description": "All fields populated, no colour override.",
60
+ "showcaseParams": {}
61
+ },
62
+ {
63
+ "label": "no-visual",
64
+ "description": "visual field removed; copy spans full width.",
65
+ "showcaseParams": { "showVisual": "false" }
66
+ },
67
+ {
68
+ "label": "navy-background",
69
+ "description": "Navy background with Off White text.",
70
+ "showcaseParams": { "backgroundColour": "Navy", "textColour": "Off White" }
71
+ }
72
+ ]
73
+ }
74
+
75
+ showcaseParams keys must match the cms-edit screenshot --param format:
76
+ backgroundColour, textColour, showVisual, showLinks, showHeading, etc.
77
+ For a flipped variant, use a separate typeName entry for "Hero Flipped".
78
+ ```
79
+
80
+ ---
81
+
82
+ ## Output contract
83
+
84
+ ```json
85
+ {
86
+ "typeName": "Hero",
87
+ "variants": [
88
+ {
89
+ "label": "default",
90
+ "description": "All optional fields populated, no colour override.",
91
+ "showcaseParams": {}
92
+ },
93
+ {
94
+ "label": "no-visual",
95
+ "description": "Visual removed; copy spans full width.",
96
+ "showcaseParams": { "showVisual": "false" }
97
+ },
98
+ {
99
+ "label": "navy",
100
+ "description": "Navy background + Off White text.",
101
+ "showcaseParams": { "backgroundColour": "Navy", "textColour": "Off White" }
102
+ },
103
+ {
104
+ "label": "minimal",
105
+ "description": "Heading only, no eyebrow/subtitle/body/links/visual.",
106
+ "showcaseParams": { "showVisual": "false", "showLinks": "false" }
107
+ }
108
+ ]
109
+ }
110
+ ```
111
+
112
+ - `label` — used to name the screenshot file: `<typeName-kebab>-<label>.png`
113
+ - `description` — included in the screenshot log and used by the evaluation step
114
+ - `showcaseParams` — key-value pairs passed as `--param key=value` to `cms-edit screenshot`
115
+
116
+ ---
117
+
118
+ ## Notes on N and the cap
119
+
120
+ The orchestrator (Step 4.4) uses N (the number of proposed variants) as a cap:
121
+
122
+ - It will attempt up to **2×N** screenshots in total.
123
+ - If the evaluation step (Step 4.3) concludes the variants are "suitably different" before
124
+ reaching 2×N attempts, it stops early.
125
+ - If not, it requests a new proposal from the LLM for the remaining slots (up to 2×N total).
126
+
127
+ For most components, N = 4–6 produces a good coverage set.