@se-studio/skills 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
CHANGED
package/package.json
CHANGED
|
@@ -130,7 +130,7 @@ cms-edit set @root items <id1>,<id2>,<id3> --links
|
|
|
130
130
|
|
|
131
131
|
**Rich text fields** (body, additionalCopy):
|
|
132
132
|
```bash
|
|
133
|
-
printf '## Why it matters\n\nOur platform helps teams **move faster** with [confidence](https://example.com).\n\n- Instant setup\n- No code required\n- 99.9%% uptime\n' | cms-edit rtf @c1 body -
|
|
133
|
+
printf '## Why it matters\n\nOur platform helps teams **move faster** with [confidence](https://example.com).\n\n- Instant setup\n- No code required\n- 99.9%% uptime\n' | cms-edit rtf @c1 body --markdown -
|
|
134
134
|
```
|
|
135
135
|
|
|
136
136
|
Markdown support:
|
|
@@ -146,17 +146,17 @@ For any content with multiple paragraphs or newlines, use `printf` piped to stdi
|
|
|
146
146
|
|
|
147
147
|
```bash
|
|
148
148
|
# Correct — printf interprets \n properly
|
|
149
|
-
printf '## Why it matters\n\nOur platform helps teams **move faster**.\n\n- Instant setup\n- No code required\n' | cms-edit rtf @c1 body -
|
|
149
|
+
printf '## Why it matters\n\nOur platform helps teams **move faster**.\n\n- Instant setup\n- No code required\n' | cms-edit rtf @c1 body --markdown -
|
|
150
150
|
|
|
151
151
|
# Also correct — file input
|
|
152
|
-
cms-edit rtf @c1 body --file path/to/file.md
|
|
153
|
-
cms-edit rtf @c1 body - < path/to/file.md
|
|
152
|
+
cms-edit rtf @c1 body --markdown --file path/to/file.md
|
|
153
|
+
cms-edit rtf @c1 body --markdown - < path/to/file.md
|
|
154
154
|
```
|
|
155
155
|
|
|
156
156
|
Single-line content (no newlines) can be passed as a quoted argument directly:
|
|
157
157
|
|
|
158
158
|
```bash
|
|
159
|
-
cms-edit rtf @c1 body "Simple single-paragraph body text with **bold**."
|
|
159
|
+
cms-edit rtf @c1 body --markdown "Simple single-paragraph body text with **bold**."
|
|
160
160
|
```
|
|
161
161
|
|
|
162
162
|
**Surgical rich text replace** (compliance / quidget tokens — does not re-import the whole field):
|
|
@@ -237,7 +237,7 @@ Same as Component plus:
|
|
|
237
237
|
When adding body content and a CTA (e.g. PDF download) to an article:
|
|
238
238
|
|
|
239
239
|
1. `cms-edit open <article-slug>` (or `open <id> --id`)
|
|
240
|
-
2. Set body: `cms-edit rtf @<ref> body "..."` or `--file path/to.md`. If you need to add a body component first, use `add` then `rtf`.
|
|
240
|
+
2. Set body: `cms-edit rtf @<ref> body --markdown "..."` or `--markdown --file path/to.md`. If you need to add a body component first, use `add` then `rtf`.
|
|
241
241
|
3. `cms-edit add CTA --target bottomContent`
|
|
242
242
|
4. Set CTA links: use `--type external --label "Download PDF" --href <url>` for an external PDF URL, or `--type download --label "Download PDF" --asset-id <asset-id>` for a Contentful asset (get the ID from `cms-edit asset search "..."` or `asset info <id>`).
|
|
243
243
|
5. `cms-edit save`
|
|
@@ -442,7 +442,7 @@ cms-edit read @c0
|
|
|
442
442
|
cms-edit set @c0 heading "We build for the future"
|
|
443
443
|
|
|
444
444
|
# 5. Update the body copy (use printf for multiline content)
|
|
445
|
-
printf '## Our mission\n\nWe help companies **ship faster** and _smarter_.\n\n- Founded in 2018\n- 500+ clients\n- [Join us](/careers)\n' | cms-edit rtf @c0 body -
|
|
445
|
+
printf '## Our mission\n\nWe help companies **ship faster** and _smarter_.\n\n- Founded in 2018\n- 500+ clients\n- [Join us](/careers)\n' | cms-edit rtf @c0 body --markdown -
|
|
446
446
|
|
|
447
447
|
# 6. Review
|
|
448
448
|
cms-edit diff
|
|
@@ -469,7 +469,7 @@ cms-edit open /products
|
|
|
469
469
|
cms-edit types component # discover what's available
|
|
470
470
|
cms-edit add CTA --after @c3
|
|
471
471
|
cms-edit set @c4 heading "Ready to get started?"
|
|
472
|
-
cms-edit rtf @c4 body "Join thousands of teams who trust us."
|
|
472
|
+
cms-edit rtf @c4 body --markdown "Join thousands of teams who trust us."
|
|
473
473
|
cms-edit links add @c4 --type external --label "Start free trial" --href https://app.example.com
|
|
474
474
|
cms-edit save
|
|
475
475
|
```
|
|
@@ -763,7 +763,7 @@ cat page.json | cms-edit create from-json # Pipe from stdin
|
|
|
763
763
|
- Any component entry in `components` or `items` may use `{ existingId }` to link an existing entry instead of creating a new one.
|
|
764
764
|
- The same applies to `links` entries — use `{ existingId }` to attach an existing link entry.
|
|
765
765
|
- `cmsLabel` sets the human-readable label shown in Contentful's entry list. Defaults to `type` or `contentType` if omitted. **Always set `cmsLabel` on components when a page has multiple instances of the same type** (e.g. three CTAs) — editors need to distinguish them.
|
|
766
|
-
- String `fields` values
|
|
766
|
+
- String `fields` values become Rich Text when they auto-detect as Markdown (same heuristic), HTML (tag-like), or Rich Text JSON (`nodeType: document`). Otherwise strings stay as-is — use `{ "value": "…", "format": "text"|"markdown"|"html"|"json" }` or `cms-edit rtf` with `--text|--markdown|--html|--json`.
|
|
767
767
|
- `target` sets which content array to use: `topContent`, `content` (default), or `bottomContent`.
|
|
768
768
|
- Slugs must not have a trailing slash — `from-json` strips it with a warning, but avoid it in source JSON.
|
|
769
769
|
- All entries are created as **drafts**. A human must publish in Contentful.
|
|
@@ -9,10 +9,10 @@ Use this skill when editing **rich text** fields (body, additionalCopy) and inse
|
|
|
9
9
|
|
|
10
10
|
## Rich text (rtf)
|
|
11
11
|
|
|
12
|
-
- **Replace** body with Markdown (single paragraph, no newlines): `cms-edit rtf @c1 body "Simple body with **bold** and [link](https://example.com)."`
|
|
12
|
+
- **Replace** body with Markdown (single paragraph, no newlines): `cms-edit rtf @c1 body --markdown "Simple body with **bold** and [link](https://example.com)."`
|
|
13
13
|
- **Multiline content** — use `printf` piped to stdin; `\n` in a double-quoted shell string is **not** a newline in bash:
|
|
14
14
|
```bash
|
|
15
|
-
printf '## Heading\n\nParagraph with **bold** and [link](https://example.com).\n' | cms-edit rtf @c1 body -
|
|
15
|
+
printf '## Heading\n\nParagraph with **bold** and [link](https://example.com).\n' | cms-edit rtf @c1 body --markdown -
|
|
16
16
|
```
|
|
17
17
|
- Use `--file path/to/file.md` or stdin (`-`) for long content.
|
|
18
18
|
- Markdown supported: headings, bold/italic, links, lists, blockquote, inline code, `---`.
|
|
@@ -86,7 +86,7 @@ Add `--dry-run` to count matches without writing.
|
|
|
86
86
|
Replace an entire rich text field by piping Markdown from stdin. Avoids shell quoting issues for long content.
|
|
87
87
|
|
|
88
88
|
```bash
|
|
89
|
-
echo "## New heading\n\nNew body text." | cms-edit rtf edit @c1 body
|
|
89
|
+
echo "## New heading\n\nNew body text." | cms-edit rtf edit @c1 body --markdown
|
|
90
90
|
```
|
|
91
91
|
|
|
92
92
|
In human (interactive) mode, the command prints the current Markdown to stdout first, then reads the replacement from stdin.
|
|
@@ -57,9 +57,17 @@ After this change the font table will reference `system-ui` but retain all the r
|
|
|
57
57
|
|
|
58
58
|
---
|
|
59
59
|
|
|
60
|
-
## Step 2 —
|
|
60
|
+
## Step 2 — Remove fonts (file + binaries)
|
|
61
61
|
|
|
62
|
-
Delete the entire file. It exports `noiVariableFlex` (local font) and `ibmPlexMono` (Google font) — both unused after cleanup.
|
|
62
|
+
Delete the entire `src/project/font.ts` file. It exports `noiVariableFlex` (local font) and `ibmPlexMono` (Google font) — both unused after cleanup.
|
|
63
|
+
|
|
64
|
+
Also remove any local font binaries that the template may ship alongside the loader. These are referenced by the now-deleted `font.ts` and otherwise linger as dead assets:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
rm -rf src/fonts/
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
(If `src/fonts/` does not exist on this template, the command is a no-op — safe to run unconditionally.)
|
|
63
71
|
|
|
64
72
|
---
|
|
65
73
|
|
|
@@ -266,55 +274,68 @@ Delete `src/project/components/Footer/MobileFooter.tsx` if it exists.
|
|
|
266
274
|
|
|
267
275
|
Create `scripts/clean-schema.js` (or update it if it already exists):
|
|
268
276
|
|
|
277
|
+
> The `scripts/` directory in the SE Studio template ships with `{ "type": "module" }` in its own `package.json`, so the script below is **ESM** (`import` syntax, not `require`). Do not add `'use strict'` — it is a no-op in ES modules.
|
|
278
|
+
|
|
269
279
|
```js
|
|
270
280
|
#!/usr/bin/env node
|
|
271
|
-
|
|
272
|
-
const fs = require('node:fs');
|
|
281
|
+
import fs from 'node:fs';
|
|
273
282
|
|
|
274
283
|
const inputPath = 'scripts/master-schema.json';
|
|
275
284
|
const outputPath = 'scripts/clean-schema.json';
|
|
276
285
|
|
|
277
286
|
if (!fs.existsSync(inputPath)) {
|
|
278
287
|
console.error(`Input file not found: ${inputPath}`);
|
|
279
|
-
console.error(
|
|
288
|
+
console.error(
|
|
289
|
+
'Export the schema first: contentful space export --skip-content --skip-webhooks --content-file scripts/master-schema.json',
|
|
290
|
+
);
|
|
280
291
|
process.exit(1);
|
|
281
292
|
}
|
|
282
293
|
|
|
283
294
|
const schema = JSON.parse(fs.readFileSync(inputPath, 'utf8'));
|
|
284
295
|
|
|
285
296
|
// Trim componentType to bare-bones set
|
|
286
|
-
const component = schema.contentTypes
|
|
297
|
+
const component = schema.contentTypes?.find((ct) => ct.sys.id === 'component');
|
|
287
298
|
if (component) {
|
|
288
|
-
const field = component.fields.find(f => f.id === 'componentType');
|
|
289
|
-
if (field) {
|
|
290
|
-
field.validations = field.validations.map(v => v.in ? { in: ['Generic'] } : v);
|
|
299
|
+
const field = component.fields.find((f) => f.id === 'componentType');
|
|
300
|
+
if (field?.validations) {
|
|
301
|
+
field.validations = field.validations.map((v) => (v.in ? { in: ['Generic'] } : v));
|
|
291
302
|
}
|
|
292
303
|
}
|
|
293
304
|
|
|
294
305
|
// Trim collectionType to bare-bones set
|
|
295
|
-
const collection = schema.contentTypes
|
|
306
|
+
const collection = schema.contentTypes?.find((ct) => ct.sys.id === 'collection');
|
|
296
307
|
if (collection) {
|
|
297
|
-
const field = collection.fields.find(f => f.id === 'collectionType');
|
|
298
|
-
if (field) {
|
|
299
|
-
field.validations = field.validations.map(v =>
|
|
300
|
-
v.in ? { in: ['Generic', 'Related articles'] } : v
|
|
308
|
+
const field = collection.fields.find((f) => f.id === 'collectionType');
|
|
309
|
+
if (field?.validations) {
|
|
310
|
+
field.validations = field.validations.map((v) =>
|
|
311
|
+
v.in ? { in: ['Generic', 'Related articles'] } : v,
|
|
301
312
|
);
|
|
302
313
|
}
|
|
303
314
|
}
|
|
304
315
|
|
|
305
|
-
//
|
|
306
|
-
|
|
316
|
+
// Drop the `in` validation on externalComponentType entirely.
|
|
317
|
+
// Replacing it with `{ in: [] }` is rejected by Contentful's Management API
|
|
318
|
+
// ("Expected at least one choice"), so we filter the validation out instead
|
|
319
|
+
// and leave any non-`in` validations untouched.
|
|
320
|
+
const ext = schema.contentTypes?.find((ct) => ct.sys.id === 'externalComponent');
|
|
307
321
|
if (ext) {
|
|
308
|
-
const field = ext.fields.find(f => f.id === 'externalComponentType');
|
|
309
|
-
if (field) {
|
|
310
|
-
field.validations = field.validations.
|
|
322
|
+
const field = ext.fields.find((f) => f.id === 'externalComponentType');
|
|
323
|
+
if (field?.validations) {
|
|
324
|
+
field.validations = field.validations.filter((v) => !v.in);
|
|
311
325
|
}
|
|
312
326
|
}
|
|
313
327
|
|
|
328
|
+
// Strip webhooks from the export. `contentful space import` will otherwise
|
|
329
|
+
// try to CREATE every webhook in the target space and 409 on conflicts when
|
|
330
|
+
// they already exist (e.g. revalidation webhook auto-provisioned by Vercel),
|
|
331
|
+
// causing the import to exit non-zero even though content types succeeded.
|
|
332
|
+
delete schema.webhooks;
|
|
333
|
+
|
|
314
334
|
fs.writeFileSync(outputPath, JSON.stringify(schema, null, 2));
|
|
315
335
|
console.log(`Clean schema written to ${outputPath}`);
|
|
316
336
|
console.log('Component types kept:', ['Generic']);
|
|
317
337
|
console.log('Collection types kept:', ['Generic', 'Related articles']);
|
|
338
|
+
console.log('Webhooks: stripped from output');
|
|
318
339
|
```
|
|
319
340
|
|
|
320
341
|
Run it:
|
|
@@ -353,10 +374,101 @@ Fix any TypeScript errors that surface from the removed imports. Common issues:
|
|
|
353
374
|
|
|
354
375
|
---
|
|
355
376
|
|
|
377
|
+
## Step 13 — Clean up `docs/cms-guidelines/`
|
|
378
|
+
|
|
379
|
+
Templates that have already had CMS guidelines generated will ship `docs/cms-guidelines/` files for components and collections that no longer exist after this cleanup. Trim it down to only the three kept types (Generic component, Generic collection, Related articles), then regenerate the merged docs.
|
|
380
|
+
|
|
381
|
+
### 1. Delete obsolete component / collection / external markdown
|
|
382
|
+
|
|
383
|
+
Remove every file under `docs/cms-guidelines/components/`, `docs/cms-guidelines/collections/`, and `docs/cms-guidelines/externals/` **except**:
|
|
384
|
+
|
|
385
|
+
- `docs/cms-guidelines/components/generic.md`
|
|
386
|
+
- `docs/cms-guidelines/collections/generic.md`
|
|
387
|
+
- `docs/cms-guidelines/collections/related-articles.md`
|
|
388
|
+
|
|
389
|
+
```bash
|
|
390
|
+
# Components: keep only generic.md
|
|
391
|
+
find docs/cms-guidelines/components -type f -name '*.md' ! -name 'generic.md' -delete 2>/dev/null || true
|
|
392
|
+
|
|
393
|
+
# Collections: keep only generic.md and related-articles.md
|
|
394
|
+
find docs/cms-guidelines/collections -type f -name '*.md' \
|
|
395
|
+
! -name 'generic.md' ! -name 'related-articles.md' -delete 2>/dev/null || true
|
|
396
|
+
|
|
397
|
+
# Externals: nothing kept
|
|
398
|
+
rm -rf docs/cms-guidelines/externals 2>/dev/null || true
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
### 2. Trim `docs/cms-guidelines/screenshots/`
|
|
402
|
+
|
|
403
|
+
Delete every PNG under `docs/cms-guidelines/screenshots/` that is not for `generic` (component or collection) or `related-articles` (collection):
|
|
404
|
+
|
|
405
|
+
```bash
|
|
406
|
+
# Component screenshots: keep generic-*.png only
|
|
407
|
+
find docs/cms-guidelines/screenshots/components -type f \
|
|
408
|
+
! -name 'generic-*.png' -delete 2>/dev/null || true
|
|
409
|
+
|
|
410
|
+
# Collection screenshots: keep generic-*.png and related-articles-*.png
|
|
411
|
+
find docs/cms-guidelines/screenshots/collections -type f \
|
|
412
|
+
! -name 'generic-*.png' ! -name 'related-articles-*.png' -delete 2>/dev/null || true
|
|
413
|
+
|
|
414
|
+
# Externals screenshots: drop entirely
|
|
415
|
+
rm -rf docs/cms-guidelines/screenshots/externals 2>/dev/null || true
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
### 3. Trim `docs/cms-guidelines/screenshots/index.json`
|
|
419
|
+
|
|
420
|
+
If it exists, edit `docs/cms-guidelines/screenshots/index.json` so it contains only entries for the three kept types — `Generic` (component), `Generic` (collection), and `Related articles` (collection). All other entries must be removed; otherwise the merged guidelines will reference deleted screenshots.
|
|
421
|
+
|
|
422
|
+
### 4. Regenerate the merged guidelines
|
|
423
|
+
|
|
424
|
+
```bash
|
|
425
|
+
pnpm cms-guidelines:merge
|
|
426
|
+
pnpm cms-generate-html-style-guide
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
This rewrites `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md` and `docs/cms-guidelines/html-component-style-guide.md` against the trimmed inputs.
|
|
430
|
+
|
|
431
|
+
---
|
|
432
|
+
|
|
433
|
+
## Step 14 — Clean up `src/generated/cms-discovery/accepted-variants/`
|
|
434
|
+
|
|
435
|
+
The same component/collection types are referenced by JSON discovery files under `src/generated/cms-discovery/accepted-variants/`. Stale entries for removed types must be deleted, otherwise `generate-showcase-mocks` and the CMS guideline skills will repopulate guidelines for components that no longer exist in code.
|
|
436
|
+
|
|
437
|
+
Delete everything in `accepted-variants/` **except**:
|
|
438
|
+
|
|
439
|
+
- `accepted-variants/generic.json` (if present at the top level)
|
|
440
|
+
- `accepted-variants/related-articles.json` (if present at the top level)
|
|
441
|
+
- `accepted-variants/components/generic.json`
|
|
442
|
+
- `accepted-variants/collections/generic.json`
|
|
443
|
+
- `accepted-variants/collections/related-articles.json`
|
|
444
|
+
|
|
445
|
+
```bash
|
|
446
|
+
DISCOVERY=src/generated/cms-discovery/accepted-variants
|
|
447
|
+
|
|
448
|
+
# Top-level legacy files (older templates): keep generic.json + related-articles.json only
|
|
449
|
+
find "$DISCOVERY" -maxdepth 1 -type f -name '*.json' \
|
|
450
|
+
! -name 'generic.json' ! -name 'related-articles.json' -delete 2>/dev/null || true
|
|
451
|
+
|
|
452
|
+
# Components: keep generic.json only
|
|
453
|
+
find "$DISCOVERY/components" -type f -name '*.json' \
|
|
454
|
+
! -name 'generic.json' -delete 2>/dev/null || true
|
|
455
|
+
|
|
456
|
+
# Collections: keep generic.json + related-articles.json
|
|
457
|
+
find "$DISCOVERY/collections" -type f -name '*.json' \
|
|
458
|
+
! -name 'generic.json' ! -name 'related-articles.json' -delete 2>/dev/null || true
|
|
459
|
+
|
|
460
|
+
# Externals: drop entirely
|
|
461
|
+
rm -rf "$DISCOVERY/externals" 2>/dev/null || true
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
If the project also ships top-level showcase outputs (`src/generated/showcase-examples.json`, `src/generated/showcase-mocks-draft.json`), delete those too — they are regenerated by `pnpm generate-showcase-mocks`. Leave `src/generated/showcase-mocks.json` (it is committed and will be re-curated via the **curate-showcase-mocks** skill on demand).
|
|
465
|
+
|
|
466
|
+
---
|
|
467
|
+
|
|
356
468
|
## What is deliberately left untouched
|
|
357
469
|
|
|
358
470
|
- `src/app/(cms-routes)/` — all routing is left as-is; the CMS routes work with whatever is registered
|
|
359
471
|
- `src/lib/constants.ts` — site title/description stays as-is for cleanup; update manually for new projects
|
|
360
472
|
- `src/project/STYLING.md` and `src/project/ANIMATION.md` — left for human review; update to reflect the new bare-bones system
|
|
361
|
-
- `src/project/font.ts` — deleted (step 2 above)
|
|
473
|
+
- `src/project/font.ts` and `src/fonts/` — deleted (step 2 above)
|
|
362
474
|
- `scripts/master-schema.json` — never modified, always kept as the original export
|