@se-studio/skills 1.4.3 → 1.4.4
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
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @se-studio/skills
|
|
2
2
|
|
|
3
|
+
## 1.4.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Add `cms-edit asset review` to audit visual assets (filename, alt text, dimensions, file size, GIF) from the Preview API index, plus the `contentful-cms-media-review` skill for spreadsheet workflows.
|
|
8
|
+
|
|
3
9
|
## 1.4.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contentful-cms-media-review
|
|
3
|
+
description: "Audit CMS images, videos, and Lottie animations for filename, alt text, dimensions, size, and GIF issues using cms-edit, then produce an Excel report of failures."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Skill: contentful-cms — Media Review
|
|
7
|
+
|
|
8
|
+
Use this skill to audit **visual assets** in a Contentful space and produce a spreadsheet of assets that fail quality checks.
|
|
9
|
+
|
|
10
|
+
## When to use
|
|
11
|
+
|
|
12
|
+
- Cleaning up CMS media before or after a migration
|
|
13
|
+
- Finding oversized images, missing alt text, or animated GIFs
|
|
14
|
+
- Brightline, SE Studio, or any site with `cms-edit` configured
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
- `cms-edit` configured for the target space (`cms-edit health`)
|
|
19
|
+
- `CONTENTFUL_PREVIEW_ACCESS_TOKEN` set (default index uses Preview API / drafts)
|
|
20
|
+
- Run `cms-edit index sync` before the review if the index is stale
|
|
21
|
+
|
|
22
|
+
## Workflow
|
|
23
|
+
|
|
24
|
+
### Step 1 — Sync the index
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
cms-edit index sync --space <space-key>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Use `--published` only when you want published/delivery content only.
|
|
31
|
+
|
|
32
|
+
### Step 2 — Run the review
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
cms-edit --json asset review --space <space-key> > /tmp/media-review.json
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Optional flags:
|
|
39
|
+
|
|
40
|
+
| Flag | Purpose |
|
|
41
|
+
|------|---------|
|
|
42
|
+
| `--include-passing` | Include assets with no failures |
|
|
43
|
+
| `--max-width 2000` | Max raster/video width (default 2000) |
|
|
44
|
+
| `--max-image-kb 800` | Max image file size |
|
|
45
|
+
| `--max-video-mb 8` | Max video file size |
|
|
46
|
+
| `--max-lottie-kb 400` | Max Lottie JSON size |
|
|
47
|
+
| `--published` | Use Delivery API index |
|
|
48
|
+
|
|
49
|
+
Exit code **1** when any asset has failing issues (useful for CI).
|
|
50
|
+
|
|
51
|
+
### Step 3 — Build the Excel report
|
|
52
|
+
|
|
53
|
+
Create a workbook with **failures only** (default JSON output). Use the **xlsx** skill.
|
|
54
|
+
|
|
55
|
+
**Sheet: Issues** — one row per failing asset
|
|
56
|
+
|
|
57
|
+
| Column | Source field |
|
|
58
|
+
|--------|----------------|
|
|
59
|
+
| Asset ID | `assets[].id` |
|
|
60
|
+
| Contentful URL | `assets[].contentfulUrl` |
|
|
61
|
+
| CDN URL | `assets[].url` |
|
|
62
|
+
| Title | `assets[].title` |
|
|
63
|
+
| Filename | `assets[].fileName` |
|
|
64
|
+
| Alt text | `assets[].description` |
|
|
65
|
+
| Content type | `assets[].contentType` |
|
|
66
|
+
| Width | `assets[].width` |
|
|
67
|
+
| Height | `assets[].height` |
|
|
68
|
+
| Size (KB) | `assets[].sizeKb` |
|
|
69
|
+
| Media wrappers | `assets[].mediaEntryCount` |
|
|
70
|
+
| Issue codes | `assets[].issues[].code` (comma-separated fails) |
|
|
71
|
+
| Issue details | `assets[].issues[].message` (semicolon-separated) |
|
|
72
|
+
| Updated | `assets[].updatedAt` |
|
|
73
|
+
|
|
74
|
+
**Sheet: Summary**
|
|
75
|
+
|
|
76
|
+
- `space`, `spaceId`, `environment`, `generated`, `preview`
|
|
77
|
+
- `total`, `failingCount`, `warningCount`
|
|
78
|
+
- `issueCounts` breakdown
|
|
79
|
+
- Thresholds from `thresholds` object
|
|
80
|
+
|
|
81
|
+
Default output path: `docs/media-review-<space>-<date>.xlsx` in the app directory.
|
|
82
|
+
|
|
83
|
+
### Step 4 — Present findings
|
|
84
|
+
|
|
85
|
+
Summarize for the user:
|
|
86
|
+
|
|
87
|
+
- Total assets scanned vs failures
|
|
88
|
+
- Top issue types (from `issueCounts`)
|
|
89
|
+
- Quick wins (missing alt, animated GIFs, obvious stock filenames)
|
|
90
|
+
- Note: `no_media_wrapper` is a **warning** — asset may still be used via rich text or be genuinely unused
|
|
91
|
+
|
|
92
|
+
## What is checked
|
|
93
|
+
|
|
94
|
+
| Check | Issue code | Severity |
|
|
95
|
+
|-------|------------|----------|
|
|
96
|
+
| Descriptive filename | `bad_filename` | fail |
|
|
97
|
+
| Alt text present | `missing_alt` | fail |
|
|
98
|
+
| Alt text quality | `weak_alt` | fail |
|
|
99
|
+
| Width ≤ max (not SVG/Lottie) | `oversized_width` | fail |
|
|
100
|
+
| File size limits | `oversized_file` | fail / warn |
|
|
101
|
+
| Animated GIF | `animated_gif` | fail |
|
|
102
|
+
| No media wrapper in index | `no_media_wrapper` | warn |
|
|
103
|
+
|
|
104
|
+
## Brightline example
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
cd apps/brightline-website
|
|
108
|
+
cms-edit index sync --space brightline
|
|
109
|
+
cms-edit --json asset review --space brightline > /tmp/brightline-media-review.json
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
Space key: `brightline` (space ID `96gdpqkm7elu`).
|
|
113
|
+
|
|
114
|
+
## Phase 2 (not yet in cms-edit)
|
|
115
|
+
|
|
116
|
+
Production page URLs and definitive unused-asset detection need CMA `links_to_asset` or a production crawl. When available, add columns `prodUrls` and `cmsUsages` to the spreadsheet.
|
|
117
|
+
|
|
118
|
+
## Related
|
|
119
|
+
|
|
120
|
+
- `contentful-cms-alt-text-audit` — per-page alt text fixes
|
|
121
|
+
- `contentful-cms-image-guide` — full image inventory with AI descriptions
|
|
122
|
+
- `cms-edit asset audit` — missing alt only (narrower, faster)
|
|
123
|
+
- `cms-edit asset set-description <id> "alt"` — fix alt text on an asset
|
|
@@ -29,6 +29,7 @@ Preview / `DRAFT_ONLY` Contentful access in local dev is expected and not a smok
|
|
|
29
29
|
| `pnpm smoke-test:cache` | `build` + `start` + double-pass `x-nextjs-cache` verify |
|
|
30
30
|
| `pnpm smoke-test:deploy-check` | Post-build gate: `start` (no rebuild) + functional smoke — use in Vercel `buildCommand` |
|
|
31
31
|
| `pnpm smoke-test:live` | Live deployment URL smoke — GitHub Action + Vercel Deployment Checks |
|
|
32
|
+
| `pnpm revalidation-test` | `build` + `start` + revalidation matrix (warm → invalidate → cold → warm); see `revalidation.cases.json` and [CONTENTFUL_WEBHOOK_REVALIDATION.md](../../../../docs/CONTENTFUL_WEBHOOK_REVALIDATION.md) |
|
|
32
33
|
|
|
33
34
|
Example `package.json` entries:
|
|
34
35
|
|
|
@@ -39,7 +40,8 @@ Example `package.json` entries:
|
|
|
39
40
|
"smoke-test:audit": "SMOKE_TEST_AUDIT_CACHE_LOGS=true smoke-test-one 3012",
|
|
40
41
|
"smoke-test:cache": "SMOKE_TEST_SERVER_SCRIPT=start SMOKE_TEST_VERIFY_CACHE=true smoke-test-one 3012",
|
|
41
42
|
"smoke-test:deploy-check": "smoke-test-deploy-check",
|
|
42
|
-
"smoke-test:live": "smoke-test-live"
|
|
43
|
+
"smoke-test:live": "smoke-test-live",
|
|
44
|
+
"revalidation-test": "node ../../scripts/revalidation-matrix-test.mjs 3012"
|
|
43
45
|
```
|
|
44
46
|
|
|
45
47
|
**Vercel build gate** — append to root `vercel.json` so failed smoke fails the build before deploy:
|
|
@@ -161,8 +163,9 @@ Read (do not guess from constants alone):
|
|
|
161
163
|
| `page` | Top-level CMS pages (not home, not article trees) | 2 |
|
|
162
164
|
| `article-type-index` | e.g. `/work/`, `/blog/` | 1 |
|
|
163
165
|
| `article` | Nested article/case-study URLs | 2 |
|
|
164
|
-
| `tag` / `tags-index` | If
|
|
165
|
-
| `person` / `people-listing` | If
|
|
166
|
+
| `tag` / `tags-index` | If routes exist (sitemap optional) | 1–2 each |
|
|
167
|
+
| `person` / `people-listing` | If routes exist (sitemap optional) | 1–2 each |
|
|
168
|
+
| `not-found` | Non-existent path | 1 (`expectHtmlStatus: 404`) |
|
|
166
169
|
|
|
167
170
|
**Exclude** obvious non-prod slugs: `tmp-*`, draft pages, unless intentionally tested.
|
|
168
171
|
|
|
@@ -187,11 +190,20 @@ curl -sI "http://localhost:<port>/some-path.md"
|
|
|
187
190
|
"port": 3012,
|
|
188
191
|
"cases": [
|
|
189
192
|
{ "category": "home", "label": "Home", "path": "/", "expectMarkdown": true },
|
|
190
|
-
{ "category": "page", "label": "About", "path": "/about/", "expectMarkdown": true }
|
|
193
|
+
{ "category": "page", "label": "About", "path": "/about/", "expectMarkdown": true },
|
|
194
|
+
{
|
|
195
|
+
"category": "not-found",
|
|
196
|
+
"label": "404 — unknown path",
|
|
197
|
+
"path": "/smoke-test-does-not-exist/",
|
|
198
|
+
"expectMarkdown": false,
|
|
199
|
+
"expectHtmlStatus": 404
|
|
200
|
+
}
|
|
191
201
|
]
|
|
192
202
|
}
|
|
193
203
|
```
|
|
194
204
|
|
|
205
|
+
`expectHtmlStatus` requires `@se-studio/site-check@^2.7.2`. Omit for normal 2xx HTML checks.
|
|
206
|
+
|
|
195
207
|
Optional `cmsIntegrity` (local only — see section below):
|
|
196
208
|
|
|
197
209
|
```json
|