@se-studio/contentful-cms 1.0.11 → 1.0.13
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/CHANGELOG.md +12 -0
- package/README.md +1 -1
- package/dist/commands/screenshot.js +7 -7
- package/package.json +1 -1
- package/skills/cms-guidelines/README.md +10 -3
- package/skills/cms-guidelines/evaluation-prompt.md +2 -2
- package/skills/cms-guidelines/generate-component-guidelines.md +3 -3
- package/skills/cms-guidelines/generation-prompt.md +23 -9
- package/skills/cms-guidelines/variant-loop.md +17 -12
- package/skills/cms-guidelines/variant-proposal-prompt.md +8 -4
- package/skills/core/SKILL.md +3 -3
- package/skills/screenshots/SKILL.md +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @se-studio/contentful-cms Changelog
|
|
2
2
|
|
|
3
|
+
## 1.0.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Bulk version bump: patch for all packages
|
|
8
|
+
|
|
9
|
+
## 1.0.12
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Bulk version bump: patch for all packages
|
|
14
|
+
|
|
3
15
|
## 1.0.11
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -251,7 +251,7 @@ Capture a PNG of a component, collection, external component, person, or page. *
|
|
|
251
251
|
|
|
252
252
|
| Target | Command |
|
|
253
253
|
|--------|---------|
|
|
254
|
-
| Session ref (full-fidelity) | `cms-edit screenshot @c0` — all types (component, collection, externalComponent, person) via convert API and `/cms
|
|
254
|
+
| Session ref (full-fidelity) | `cms-edit screenshot @c0` — all types (component, collection, externalComponent, person) via convert API and `/cms/preview/render-json` |
|
|
255
255
|
| JSON file (no Contentful) | `cms-edit screenshot --json-file path/to/entry.json` — IBase* JSON; validates or screenshots without a session |
|
|
256
256
|
| By type (mock, no session) | `cms-edit screenshot --component HeroSimple`, `cms-edit screenshot --collection CardGrid` |
|
|
257
257
|
| Page | `cms-edit screenshot` (current page) or `cms-edit screenshot /pricing` |
|
|
@@ -14,9 +14,9 @@ const DEFAULT_VIEWPORT_WIDTH = 1280;
|
|
|
14
14
|
const DEFAULT_VIEWPORT_HEIGHT = 900;
|
|
15
15
|
const DEFAULT_BASE_URL = 'http://localhost:3000';
|
|
16
16
|
function isComponentOrCollectionUrl(url) {
|
|
17
|
-
return (url.includes('/cms
|
|
18
|
-
url.includes('/cms
|
|
19
|
-
url.includes('/cms
|
|
17
|
+
return (url.includes('/cms/showcase/render') ||
|
|
18
|
+
url.includes('/cms/preview/render') ||
|
|
19
|
+
url.includes('/cms/preview/render-json'));
|
|
20
20
|
}
|
|
21
21
|
/** Collect repeatable --param key=value into an array. */
|
|
22
22
|
function collectParam(value, prev) {
|
|
@@ -50,7 +50,7 @@ export function registerScreenshotCommand(program) {
|
|
|
50
50
|
' --collection CardGrid')
|
|
51
51
|
.option('--component <type>', 'Showcase a component by type name (no session needed)')
|
|
52
52
|
.option('--collection <type>', 'Showcase a collection by type name (no session needed)')
|
|
53
|
-
.option('--live', 'Fetch real Contentful data via /cms
|
|
53
|
+
.option('--live', 'Fetch real Contentful data via /cms/preview/render?id=... (requires preview token)')
|
|
54
54
|
.option('--out <path>', 'Output file path (default: ./screenshot-<type>-<timestamp>.png)')
|
|
55
55
|
.option('--full', 'Capture the full scrollable page (passed to agent-browser)')
|
|
56
56
|
.option('--embedded', 'Append &embedded=true to showcase URL (suppresses IframeHeightReporter)')
|
|
@@ -81,7 +81,7 @@ export function registerScreenshotCommand(program) {
|
|
|
81
81
|
const raw = fs.readFileSync(opts.jsonFile, 'utf-8');
|
|
82
82
|
const data = JSON.parse(raw);
|
|
83
83
|
const encoded = Buffer.from(raw, 'utf-8').toString('base64');
|
|
84
|
-
url = appendRequestParams(`${baseUrl}/cms
|
|
84
|
+
url = appendRequestParams(`${baseUrl}/cms/preview/render-json?data=${encoded}`, requestParams);
|
|
85
85
|
displayType = data?.type ?? 'json';
|
|
86
86
|
}
|
|
87
87
|
else if (opts.component || opts.collection) {
|
|
@@ -111,7 +111,7 @@ export function registerScreenshotCommand(program) {
|
|
|
111
111
|
throw new Error('Convert API returned no data.');
|
|
112
112
|
}
|
|
113
113
|
const encoded = Buffer.from(JSON.stringify(data), 'utf-8').toString('base64');
|
|
114
|
-
url = appendRequestParams(`${baseUrl}/cms
|
|
114
|
+
url = appendRequestParams(`${baseUrl}/cms/preview/render-json?data=${encoded}`, requestParams);
|
|
115
115
|
displayType = data?.type ?? entryId;
|
|
116
116
|
}
|
|
117
117
|
else if (target?.startsWith('/') || target?.startsWith('http')) {
|
|
@@ -254,7 +254,7 @@ function buildShowcaseUrl(baseUrl, type, mode, fields, embedded, clean, requestP
|
|
|
254
254
|
params.set(key, value);
|
|
255
255
|
}
|
|
256
256
|
}
|
|
257
|
-
return `${baseUrl}/cms
|
|
257
|
+
return `${baseUrl}/cms/showcase/render?${params.toString()}`;
|
|
258
258
|
}
|
|
259
259
|
/** Appends requestParams as query parameters to an arbitrary URL. */
|
|
260
260
|
function appendRequestParams(url, requestParams) {
|
package/package.json
CHANGED
|
@@ -17,7 +17,7 @@ Guidelines are short markdown fragments — one per CMS type — that describe h
|
|
|
17
17
|
```bash
|
|
18
18
|
pnpm --filter <appName> generate-showcase
|
|
19
19
|
```
|
|
20
|
-
This writes `src/
|
|
20
|
+
This writes `src/generated/showcase-examples.json`.
|
|
21
21
|
3. **Curate showcase mocks** — run the [curate-showcase-mocks skill](.cursor/skills/se-marketing-sites/curate-showcase-mocks/SKILL.md) to select the best examples into `showcase-mocks.json`. This makes the showcase (and screenshots) show realistic content.
|
|
22
22
|
4. **Generate field list** — parse TypeScript types to produce structured field metadata:
|
|
23
23
|
```bash
|
|
@@ -135,6 +135,13 @@ Outputs:
|
|
|
135
135
|
generated/cms-discovery/
|
|
136
136
|
field-list.json
|
|
137
137
|
colour-hints.json
|
|
138
|
-
accepted-variants/
|
|
139
|
-
|
|
138
|
+
accepted-variants/
|
|
139
|
+
components/ # one .json per component type
|
|
140
|
+
collections/ # one .json per collection type
|
|
141
|
+
externals/ # one .json per external component type
|
|
142
|
+
screenshots/
|
|
143
|
+
components/ # PNG screenshots for components
|
|
144
|
+
collections/ # PNG screenshots for collections
|
|
145
|
+
externals/ # PNG screenshots for externals
|
|
146
|
+
index.json # file field uses subpath e.g. "components/hero-default.png"
|
|
140
147
|
```
|
|
@@ -80,5 +80,5 @@ Output JSON only:
|
|
|
80
80
|
- If `attempts < 2 × N` → use `suggestions` to generate additional variant params; capture
|
|
81
81
|
the new screenshots; re-evaluate.
|
|
82
82
|
- If `attempts >= 2 × N` → stop; use `acceptedVariants` from the best evaluation so far.
|
|
83
|
-
3. The final accepted set is written to `generated/cms-discovery/accepted-variants
|
|
84
|
-
and the screenshots are committed to `docs/cms-guidelines/screenshots/`.
|
|
83
|
+
3. The final accepted set is written to `generated/cms-discovery/accepted-variants/{components|collections|externals}/<type-slug>.json`
|
|
84
|
+
and the screenshots are committed to `docs/cms-guidelines/screenshots/{components|collections|externals}/`.
|
|
@@ -10,8 +10,8 @@ For one CMS type (e.g. Hero):
|
|
|
10
10
|
|
|
11
11
|
| Output | Location |
|
|
12
12
|
|---|---|
|
|
13
|
-
| Variant screenshots | `docs/cms-guidelines/screenshots/hero-*.png` |
|
|
14
|
-
| Accepted variant list | `generated/cms-discovery/accepted-variants/hero.json` |
|
|
13
|
+
| Variant screenshots | `docs/cms-guidelines/screenshots/components/hero-*.png` |
|
|
14
|
+
| Accepted variant list | `generated/cms-discovery/accepted-variants/components/hero.json` |
|
|
15
15
|
| Guideline fragment | `docs/cms-guidelines/components/hero.md` |
|
|
16
16
|
| Colour hint entry | `generated/cms-discovery/colour-hints.json` |
|
|
17
17
|
| Merged full doc (updated) | `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md` |
|
|
@@ -44,7 +44,7 @@ Follow variant-loop.md.
|
|
|
44
44
|
cms-capture-screenshots --variants /tmp/<type-slug>-variants.json --app-dir <APP_DIR>
|
|
45
45
|
5. Evaluate screenshots using evaluation-prompt.md.
|
|
46
46
|
- If not suitably different and attempts < 2×N: capture new suggestions, re-evaluate.
|
|
47
|
-
- When done: save accepted list to generated/cms-discovery/accepted-variants/<type-slug>.json
|
|
47
|
+
- When done: save accepted list to generated/cms-discovery/accepted-variants/{components|collections|externals}/<type-slug>.json
|
|
48
48
|
|
|
49
49
|
=== Phase B: Generate guideline ===
|
|
50
50
|
Follow generation-prompt.md.
|
|
@@ -13,7 +13,8 @@ metadata, then writes a self-contained markdown guideline fragment in the target
|
|
|
13
13
|
|---|---|
|
|
14
14
|
| Component source file | `src/project/components/<TypeName>.tsx` |
|
|
15
15
|
| Field metadata (used fields + types + enums) | `generated/cms-discovery/field-list.json` |
|
|
16
|
-
|
|
|
16
|
+
| Project theme (palette + typography + grid) | `generated/cms-discovery/theme-context.md` |
|
|
17
|
+
| Accepted screenshots | `generated/cms-discovery/accepted-variants/{components\|collections\|externals}/<type-slug>.json` + image files |
|
|
17
18
|
| Target format example | `tmp/component-guidelines-target-format.md` (Hero example) |
|
|
18
19
|
| Mapping reference | `generated/cms-discovery/mapping.md` |
|
|
19
20
|
| SizingInformation source | `src/lib/SizingInformation.ts` |
|
|
@@ -33,9 +34,12 @@ accepted variant list. Describe what you see in each screenshot.
|
|
|
33
34
|
|
|
34
35
|
Component: <COMPONENT_TYPE>
|
|
35
36
|
|
|
36
|
-
Accepted variants (from accepted-variants/<type-slug>.json):
|
|
37
|
+
Accepted variants (from accepted-variants/{components|collections|externals}/<type-slug>.json):
|
|
37
38
|
<ACCEPTED_VARIANTS_JSON>
|
|
38
39
|
|
|
40
|
+
Project theme (from generated/cms-discovery/theme-context.md):
|
|
41
|
+
<THEME_CONTEXT>
|
|
42
|
+
|
|
39
43
|
For each variant, describe:
|
|
40
44
|
- The visual layout (columns, stack, full-width, etc.)
|
|
41
45
|
- The elements visible (heading, eyebrow, body, links, visual/image, background colour)
|
|
@@ -44,7 +48,8 @@ For each variant, describe:
|
|
|
44
48
|
- Anything notable (animations not applicable in screenshots, spacing gaps, alignment)
|
|
45
49
|
|
|
46
50
|
Be precise. Write one short paragraph per variant (3–5 sentences). No code references.
|
|
47
|
-
Only use colour names from the site palette
|
|
51
|
+
Only use colour names from the site palette (listed in the theme context above) and
|
|
52
|
+
typography class names (h1–h6, p2, p3 etc. from the typography scale above).
|
|
48
53
|
|
|
49
54
|
Output format: one section per variant, headed by ## <label>.
|
|
50
55
|
```
|
|
@@ -74,6 +79,9 @@ Section.tsx source (shows how backgroundColour and textColour are applied):
|
|
|
74
79
|
Field mapping reference (mapping.md — shows how CMS fields map to app props):
|
|
75
80
|
<MAPPING_SOURCE>
|
|
76
81
|
|
|
82
|
+
Project theme (palette, typography, grid from generated/cms-discovery/theme-context.md):
|
|
83
|
+
<THEME_CONTEXT>
|
|
84
|
+
|
|
77
85
|
Extract and write:
|
|
78
86
|
1. FIELDS: For each field in USED_FIELDS, write one row: field name, type, what it does when
|
|
79
87
|
set, what happens when it is empty. Use only typography class names and colour names as
|
|
@@ -105,6 +113,7 @@ B) Extracted behaviour rules from the source code.
|
|
|
105
113
|
Also provided:
|
|
106
114
|
- The target format example (Hero guideline from tmp/component-guidelines-target-format.md).
|
|
107
115
|
- The field list from generated/cms-discovery/field-list.json.
|
|
116
|
+
- The project theme from generated/cms-discovery/theme-context.md (palette names + typography scale).
|
|
108
117
|
- The screenshot index from docs/cms-guidelines/screenshots/index.json (lists captured screenshots).
|
|
109
118
|
- The app's devBaseUrl from .contentful-cms.json (e.g. "http://localhost:3010").
|
|
110
119
|
|
|
@@ -116,12 +125,14 @@ Produce a single markdown fragment for <COMPONENT_TYPE> following EXACTLY this s
|
|
|
116
125
|
## Screenshots
|
|
117
126
|
|
|
118
127
|
(For each accepted variant that has a captured screenshot in index.json, include an image link.
|
|
119
|
-
Use the devBaseUrl from .contentful-cms.json for the host.
|
|
128
|
+
Use the devBaseUrl from .contentful-cms.json for the host.
|
|
129
|
+
Use the `file` field from index.json VERBATIM as the ?file= value — it may include a subdirectory
|
|
130
|
+
prefix such as `components/` or `collections/`. Do NOT reconstruct the path from the type slug. Format:)
|
|
120
131
|
|
|
121
132
|
| Variant | Preview |
|
|
122
133
|
|---------|---------|
|
|
123
|
-
| Default |  |
|
|
135
|
+
| Navy |  |
|
|
125
136
|
|
|
126
137
|
(Only include variants present in index.json. If no screenshots exist, write: "No screenshots captured yet. Run cms-capture-screenshots to generate them.")
|
|
127
138
|
|
|
@@ -146,8 +157,10 @@ Use the devBaseUrl from .contentful-cms.json for the host. Format:)
|
|
|
146
157
|
Rules:
|
|
147
158
|
- SELF-CONTAINED. A reader with no code access must fully understand the component.
|
|
148
159
|
- No source code references, no file paths, no "see Hero.tsx".
|
|
149
|
-
- Only use typography class names (h1–h6, p2, p3
|
|
150
|
-
as code-like snippets. Everything else is plain English.
|
|
160
|
+
- Only use typography class names (from theme-context.md, e.g. h1–h6, p2, p3) and colour
|
|
161
|
+
names (from theme-context.md palette) as code-like snippets. Everything else is plain English.
|
|
162
|
+
- For the ## Colours section, list the valid palette colour names from theme-context.md — do
|
|
163
|
+
NOT invent colour names or describe them generically.
|
|
151
164
|
- If a field is listed in USED_FIELDS but has no visual effect when empty, say
|
|
152
165
|
"No visible effect when empty" in the table.
|
|
153
166
|
- Collections: add a section for card-level fields and describe how the number of cards
|
|
@@ -195,8 +208,9 @@ Generate the CMS guideline fragment for <COMPONENT_TYPE>.
|
|
|
195
208
|
Files to read:
|
|
196
209
|
- src/project/components/<TypeName>.tsx (or collections/<TypeName>.tsx)
|
|
197
210
|
- generated/cms-discovery/field-list.json
|
|
211
|
+
- generated/cms-discovery/theme-context.md (palette + typography + grid — use for all colour and font references)
|
|
198
212
|
- generated/cms-discovery/mapping.md
|
|
199
|
-
- generated/cms-discovery/accepted-variants/<type-slug>.json
|
|
213
|
+
- generated/cms-discovery/accepted-variants/{components|collections|externals}/<type-slug>.json
|
|
200
214
|
- docs/cms-guidelines/screenshots/index.json (to know which screenshots exist)
|
|
201
215
|
- .contentful-cms.json (to get devBaseUrl for screenshot links)
|
|
202
216
|
- src/lib/SizingInformation.ts
|
|
@@ -23,7 +23,7 @@ or manually follow the steps below.
|
|
|
23
23
|
▼
|
|
24
24
|
┌──────────────────────────────────────────────────┐
|
|
25
25
|
│ Step 2: Capture screenshots │
|
|
26
|
-
│ → docs/cms-guidelines/screenshots/<
|
|
26
|
+
│ → docs/cms-guidelines/screenshots/{mode}s/<n>.png│
|
|
27
27
|
└──────────────────────┬───────────────────────────┘
|
|
28
28
|
│
|
|
29
29
|
▼
|
|
@@ -53,6 +53,7 @@ or manually follow the steps below.
|
|
|
53
53
|
**Assign this task to a Cursor subagent.** Provide:
|
|
54
54
|
- `apps/example-brightline/src/project/components/<TypeName>.tsx` (component source)
|
|
55
55
|
- `generated/cms-discovery/field-list.json` (field metadata including enum values)
|
|
56
|
+
- `generated/cms-discovery/theme-context.md` (palette + typography — authoritative colour names)
|
|
56
57
|
- `scripts/guidelines/variant-proposal-prompt.md` (variant proposal instructions)
|
|
57
58
|
- `scripts/guidelines/evaluation-prompt.md` (evaluation instructions)
|
|
58
59
|
- `scripts/guidelines/capture-screenshots.mjs` (screenshot tool)
|
|
@@ -63,9 +64,10 @@ or manually follow the steps below.
|
|
|
63
64
|
```
|
|
64
65
|
Run the variant loop for <TypeName>:
|
|
65
66
|
|
|
66
|
-
1. PROPOSE: Read the component source file
|
|
67
|
-
scripts/guidelines/variant-proposal-prompt.md, produce a variants.json
|
|
68
|
-
Use N = 5 (or fewer if the component is simple).
|
|
67
|
+
1. PROPOSE: Read the component source file, field list, and theme-context.md (for palette names).
|
|
68
|
+
Using the instructions in scripts/guidelines/variant-proposal-prompt.md, produce a variants.json
|
|
69
|
+
for <TypeName>. Use N = 5 (or fewer if the component is simple).
|
|
70
|
+
IMPORTANT: use only colour names from theme-context.md — do NOT invent colour names.
|
|
69
71
|
|
|
70
72
|
2. CAPTURE: Run:
|
|
71
73
|
node scripts/guidelines/capture-screenshots.mjs --variants /tmp/variants.json
|
|
@@ -80,8 +82,9 @@ Run the variant loop for <TypeName>:
|
|
|
80
82
|
- If 2×N attempts reached: accept the best acceptedVariants set seen.
|
|
81
83
|
|
|
82
84
|
4. WRITE ACCEPTED LIST: Save the final accepted variant list to:
|
|
83
|
-
generated/cms-discovery/accepted-variants/<type-slug>.json
|
|
84
|
-
|
|
85
|
+
generated/cms-discovery/accepted-variants/{components|collections|externals}/<type-slug>.json
|
|
86
|
+
Use the `mode` field to pick the subdir: component → components/, collection → collections/, external → externals/.
|
|
87
|
+
Format: { "typeName": "<TypeName>", "mode": "<mode>", "variants": [...] }
|
|
85
88
|
|
|
86
89
|
5. COMMIT: git add docs/cms-guidelines/screenshots/ generated/cms-discovery/
|
|
87
90
|
git commit -m "chore(bl): variant screenshots for <TypeName>"
|
|
@@ -122,7 +125,7 @@ Example for Hero:
|
|
|
122
125
|
node scripts/guidelines/capture-screenshots.mjs --variants /tmp/hero-variants.json
|
|
123
126
|
```
|
|
124
127
|
|
|
125
|
-
Saves to `docs/cms-guidelines/screenshots/hero-*.png
|
|
128
|
+
Saves to `docs/cms-guidelines/screenshots/components/hero-*.png` (or `collections/` for collection types).
|
|
126
129
|
|
|
127
130
|
### 3 — Evaluate
|
|
128
131
|
|
|
@@ -134,8 +137,10 @@ If not suitably different: replace rejected screenshots with suggestions, re-cap
|
|
|
134
137
|
### 4 — Save accepted list
|
|
135
138
|
|
|
136
139
|
```bash
|
|
137
|
-
|
|
138
|
-
|
|
140
|
+
# Use the appropriate subdir based on mode: components/, collections/, or externals/
|
|
141
|
+
mkdir -p generated/cms-discovery/accepted-variants/components
|
|
142
|
+
# Write manually or via script — e.g. for a component:
|
|
143
|
+
# generated/cms-discovery/accepted-variants/components/hero.json
|
|
139
144
|
```
|
|
140
145
|
|
|
141
146
|
### 5 — Commit
|
|
@@ -157,13 +162,13 @@ git commit -m "chore(bl): variant screenshots for Hero"
|
|
|
157
162
|
{
|
|
158
163
|
"label": "default",
|
|
159
164
|
"description": "All fields populated, no colour override.",
|
|
160
|
-
|
|
161
|
-
|
|
165
|
+
"screenshotPath": "docs/cms-guidelines/screenshots/components/hero-default.png",
|
|
166
|
+
"showcaseParams": {}
|
|
162
167
|
},
|
|
163
168
|
{
|
|
164
169
|
"label": "navy",
|
|
165
170
|
"description": "Navy background + Off White text.",
|
|
166
|
-
"screenshotPath": "docs/cms-guidelines/screenshots/hero-navy.png",
|
|
171
|
+
"screenshotPath": "docs/cms-guidelines/screenshots/components/hero-navy.png",
|
|
167
172
|
"showcaseParams": { "backgroundColour": "Navy", "textColour": "Off White" }
|
|
168
173
|
}
|
|
169
174
|
]
|
|
@@ -14,8 +14,9 @@ variants (like flipped). The screenshots are then used to write the "What it loo
|
|
|
14
14
|
- **Component source file:** full contents of `src/project/components/<Type>.tsx` (or
|
|
15
15
|
`src/project/collections/<Type>.tsx`).
|
|
16
16
|
- **Used fields:** the `USED_FIELDS` or `FIELD_KEYS` from the source file.
|
|
17
|
-
- **Palette:**
|
|
18
|
-
|
|
17
|
+
- **Palette:** colour names from `generated/cms-discovery/theme-context.md` (generated by
|
|
18
|
+
`cms-generate-collection-guidelines` from `tailwind.config.json`). This is the authoritative
|
|
19
|
+
source — use it in preference to `field-list.json` or `generated/colors.ts`.
|
|
19
20
|
- **N:** number of variants to propose (typically 4–6 for a component, up to 8 for complex ones).
|
|
20
21
|
|
|
21
22
|
The LLM should output **N variants** in JSON format (see below).
|
|
@@ -35,12 +36,15 @@ should be able to tell them apart at a glance.
|
|
|
35
36
|
Component source:
|
|
36
37
|
<COMPONENT_SOURCE>
|
|
37
38
|
|
|
38
|
-
Palette (
|
|
39
|
+
Palette (from generated/cms-discovery/theme-context.md — use ONLY these names):
|
|
40
|
+
Background colours (backgroundColour):
|
|
39
41
|
<BACKGROUND_COLOURS>
|
|
40
42
|
|
|
41
|
-
Text
|
|
43
|
+
Text colours (textColour, i.e. foreground colours):
|
|
42
44
|
<TEXT_COLOURS>
|
|
43
45
|
|
|
46
|
+
Do NOT invent or paraphrase colour names. Use the exact names from theme-context.md.
|
|
47
|
+
|
|
44
48
|
Rules:
|
|
45
49
|
1. Always include a "default" variant with all optional fields populated and no colour override.
|
|
46
50
|
2. Include at least one variant per important "missing field" state (e.g. no visual, no links).
|
package/skills/core/SKILL.md
CHANGED
|
@@ -422,7 +422,7 @@ If omitted, defaults to `http://localhost:3000` with a warning.
|
|
|
422
422
|
|
|
423
423
|
### From session ref (full-fidelity)
|
|
424
424
|
|
|
425
|
-
`cms-edit screenshot @c0` uses the app's convert API and `/cms
|
|
425
|
+
`cms-edit screenshot @c0` uses the app's convert API and `/cms/preview/render-json` so **all** entry types render with real converted data: component, collection, externalComponent, person. No separate "mock vs live" for refs.
|
|
426
426
|
|
|
427
427
|
```bash
|
|
428
428
|
# Any entry type (component, collection, externalComponent, person)
|
|
@@ -445,7 +445,7 @@ cms-edit screenshot --json-file path/to/component.json
|
|
|
445
445
|
|
|
446
446
|
### By type (showcase mock, no session)
|
|
447
447
|
|
|
448
|
-
Uses `/cms
|
|
448
|
+
Uses `/cms/showcase/render` with mock data. Fast, no preview token.
|
|
449
449
|
|
|
450
450
|
```bash
|
|
451
451
|
cms-edit screenshot --component HeroSimple
|
|
@@ -469,7 +469,7 @@ cms-edit screenshot /about-us --full
|
|
|
469
469
|
| Flag | Description |
|
|
470
470
|
|------|-------------|
|
|
471
471
|
| `--json-file <path>` | Read IBase* JSON from file and screenshot via render-json (no Contentful) |
|
|
472
|
-
| `--live` | Legacy: use `/cms
|
|
472
|
+
| `--live` | Legacy: use `/cms/preview/render?id=...` for ref (optional; @ref is already full-fidelity) |
|
|
473
473
|
| `--out <path>` | Output file path (default: `./screenshot-<type>-<timestamp>.png`) |
|
|
474
474
|
| `--full` | Full-page capture (passed to `agent-browser screenshot --full`) |
|
|
475
475
|
| `--embedded` | Append `&embedded=true` to showcase URL (suppresses IframeHeightReporter) |
|
|
@@ -10,9 +10,9 @@ Use this skill when capturing **screenshots** of components, collections, pages,
|
|
|
10
10
|
|
|
11
11
|
## Commands
|
|
12
12
|
|
|
13
|
-
- **From session ref** (full-fidelity): `cms-edit screenshot @c0` — uses the convert API and `/cms
|
|
14
|
-
- **From JSON file** (no Contentful): `cms-edit screenshot --json-file path/to/entry.json` — reads an IBase* JSON (e.g. from `read @c0 --json` or an export), base64-encodes it, and opens `/cms
|
|
15
|
-
- **By type** (no session, mock): `cms-edit screenshot --component HeroSimple`, `cms-edit screenshot --collection CardGrid` — uses `/cms
|
|
13
|
+
- **From session ref** (full-fidelity): `cms-edit screenshot @c0` — uses the convert API and `/cms/preview/render-json` so **all** entry types render with real data: component, collection, externalComponent, person. Add `--full` for full-page capture (auto-applied for component/collection).
|
|
14
|
+
- **From JSON file** (no Contentful): `cms-edit screenshot --json-file path/to/entry.json` — reads an IBase* JSON (e.g. from `read @c0 --json` or an export), base64-encodes it, and opens `/cms/preview/render-json?data=...`. Use to validate or screenshot without a session or preview token.
|
|
15
|
+
- **By type** (no session, mock): `cms-edit screenshot --component HeroSimple`, `cms-edit screenshot --collection CardGrid` — uses `/cms/showcase/render` with mock data.
|
|
16
16
|
- **Page**: `cms-edit screenshot` (current open page) or `cms-edit screenshot /resources/publications/other/my-slug`
|
|
17
17
|
- **URL only** (no agent-browser needed): `cms-edit screenshot @c0 --url-only`
|
|
18
18
|
|
|
@@ -29,8 +29,8 @@ Check the site's URL structure (e.g. `/resources/publications/<type>/<slug>`) an
|
|
|
29
29
|
|
|
30
30
|
When using `--component <type>` or `--collection <type>` (no session), the default is **mock** (showcase). Use `--live` with a ref to prefer the legacy direct preview URL; for `@ref`, full-fidelity is already the default via convert → render-json.
|
|
31
31
|
|
|
32
|
-
- **Mock:** `/cms
|
|
33
|
-
- **Live** (with ref): `cms-edit screenshot @c0 --live` — uses `/cms
|
|
32
|
+
- **Mock:** `/cms/showcase/render` with mock data; fast, no preview token.
|
|
33
|
+
- **Live** (with ref): `cms-edit screenshot @c0 --live` — uses `/cms/preview/render?id=...`; equivalent for component/collection/externalComponent to the default @ref path.
|
|
34
34
|
|
|
35
35
|
## Checking your work
|
|
36
36
|
|