@se-studio/skills 1.1.1 → 1.2.0
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 +30 -0
- package/package.json +1 -1
- package/skills/contentful-cms-regenerate-editor-pack/SKILL.md +136 -0
- package/skills/contentful-cms-schema-audit/SKILL.md +122 -0
- package/skills/contentful-cms-sync-schema/SKILL.md +1 -0
- package/skills/contentful-cms-update-cms-guidelines/SKILL.md +7 -0
- package/skills/se-marketing-sites-redirects/SKILL.md +27 -1
- package/skills/se-marketing-sites-register-cms-features/SKILL.md +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @se-studio/skills
|
|
2
2
|
|
|
3
|
+
## 1.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Add contentful-cms-regenerate-editor-pack skill for hosted MCP editor-pack workflow.
|
|
8
|
+
|
|
9
|
+
## 1.1.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Bulk version bump: patch for all packages
|
|
14
|
+
|
|
15
|
+
## 1.1.2
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- Exclude redirect sources from sitemaps + robust protection against self and circular redirects.
|
|
20
|
+
|
|
21
|
+
- `buildRedirectMap` now normalizes internal paths (leading + trailing `/` to match urlCalculators + sitemap conventions) and reliably drops self-redirects (A → A). It also detects longer redirect cycles (A → B → A, etc.), drops the participating `from` rules from the baked map, and emits a `console.warn` during construction (visible in build/generate scripts).
|
|
22
|
+
- New exported utility: `filterSitemapEntriesExcludingRedirects(entries, redirectMap)`. Works on any `{ url: string }[]` (SitemapEntry, ISitemapEntry, etc.).
|
|
23
|
+
- The standard marketing site sitemap helper now accepts an optional `redirectMap` in `getSitemapEntries({ includeUnindexed, redirectMap })`. When provided, any URL that is the source of an active redirect is excluded from the generated sitemap entries. This is the recommended way to keep sitemaps clean when using editor-managed redirects.
|
|
24
|
+
- Widened the public `getSitemapEntries` option type in app helpers (additive; existing callers unaffected).
|
|
25
|
+
- Updated example app sitemaps (main + unindexed) to demonstrate fetching the map and passing it.
|
|
26
|
+
- Skill docs (`se-marketing-sites-redirects`) now include a "Redirects and sitemaps" section with usage patterns + notes on the improved cycle/self protection. Also updated routing docs.
|
|
27
|
+
- `buildRedirectMap` / `RedirectMap` / `getRedirectMap` behaviour for the middleware baked map is now safer (no self-loops or cycles will be baked).
|
|
28
|
+
|
|
29
|
+
Consumers using the `marketingSiteSitemap` helper + `getRedirectMap` at build time can now easily exclude redirect sources from both their static redirect map (for middleware) and their sitemaps in one consistent way.
|
|
30
|
+
|
|
31
|
+
See the redirect skill for the full recommended build-time pattern and the new filter helper.
|
|
32
|
+
|
|
3
33
|
## 1.1.1
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/package.json
CHANGED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contentful-cms-regenerate-editor-pack
|
|
3
|
+
description: "Regenerate cms-edit editor-pack for hosted MCP after registrations, guidelines, routing, or cms-editor docs change; validate, commit, and deploy."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Regenerate cms-edit editor pack
|
|
7
|
+
|
|
8
|
+
Use this skill when **site knowledge served to hosted cms-edit editors** must be refreshed. The editor pack becomes `cms-edit://customer/*` MCP resources on the hosted server.
|
|
9
|
+
|
|
10
|
+
**Audience:** SE developers — not content editors.
|
|
11
|
+
|
|
12
|
+
## When to regenerate
|
|
13
|
+
|
|
14
|
+
Run after any of these change:
|
|
15
|
+
|
|
16
|
+
| Change | Examples |
|
|
17
|
+
|--------|----------|
|
|
18
|
+
| CMS registrations | New component/collection in `src/lib/registrations.ts` |
|
|
19
|
+
| Guidelines | `docs/cms-guidelines/**`, merged `COMPONENT_GUIDELINES_FOR_LLM.md` |
|
|
20
|
+
| Routing / constants | `src/lib/constants.ts` (slugs, feature flags, `HOMEPAGE_SLUG`) |
|
|
21
|
+
| Editor playbooks | `docs/cms-editor/**/*.md` |
|
|
22
|
+
| Project config | `cms-edit/project.json` (`homepageSlug`, `devBaseUrl`, etc.) |
|
|
23
|
+
|
|
24
|
+
**Also run** at the end of **`contentful-cms-update-cms-guidelines`** (`fresh` or `sync`) when guidelines changed.
|
|
25
|
+
|
|
26
|
+
## What deploy does vs does not do
|
|
27
|
+
|
|
28
|
+
| Action | Automatic on git push? |
|
|
29
|
+
|--------|------------------------|
|
|
30
|
+
| Copy **committed** `editor-pack/` into cms-edit-host | Yes (when `cms-edit/**` changes and Vercel builds) |
|
|
31
|
+
| Run `editor-pack generate` | **No** — always manual (this skill) |
|
|
32
|
+
| Rebuild `.mcpb` on Vercel | Yes (part of customer `vercel-build.sh`) |
|
|
33
|
+
| Update hosted guide/prompts from `@se-studio/contentful-cms` | Redeploy host after bumping package version |
|
|
34
|
+
|
|
35
|
+
Editors do **not** reinstall `.mcpb` when only the editor pack changes.
|
|
36
|
+
|
|
37
|
+
## Step 1 — Locate config
|
|
38
|
+
|
|
39
|
+
| Repo layout | Config path |
|
|
40
|
+
|-------------|-------------|
|
|
41
|
+
| Single-site (SE Studio) | `cms-edit/project.json` |
|
|
42
|
+
| Multi-site monorepo | `cms-edit/<site>/project.json` |
|
|
43
|
+
|
|
44
|
+
See `docs/CMS_EDIT_SETUP.md` for customer-specific paths.
|
|
45
|
+
|
|
46
|
+
## Step 2 — Validate
|
|
47
|
+
|
|
48
|
+
From repo root (requires `cms-edit` on PATH — `pnpm build` in se-core-product or `npx @se-studio/contentful-cms`):
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
cms-edit project validate --project-config <path-to-project.json>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Step 3 — Generate
|
|
55
|
+
|
|
56
|
+
**SE Studio (`se-website-2026`):**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pnpm cms-edit:editor-pack
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**Generic / multi-site:**
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
cms-edit editor-pack generate --project-config cms-edit/<site>/project.json
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Output: `cms-edit/editor-pack/` or `cms-edit/<site>/editor-pack/` (manifest, indexes, `routing.md`, `overview.md`, per-type guideline snippets).
|
|
69
|
+
|
|
70
|
+
## Step 4 — Review diff
|
|
71
|
+
|
|
72
|
+
Check at minimum:
|
|
73
|
+
|
|
74
|
+
- `routing.md` — homepage CMS slug, article/tag paths
|
|
75
|
+
- `components-index.json` / `collections-index.json` — new types present
|
|
76
|
+
- `manifest.json` — resource list updated
|
|
77
|
+
|
|
78
|
+
## Step 5 — Commit
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
git add cms-edit/editor-pack # or cms-edit/<site>/editor-pack
|
|
82
|
+
git commit -m "chore(cms-edit): regenerate editor pack"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
## Step 6 — Deploy
|
|
86
|
+
|
|
87
|
+
### SE Studio (git-connected Vercel)
|
|
88
|
+
|
|
89
|
+
Push to the branch Vercel watches (usually `develop`). Changes under `cms-edit/**` trigger `cms-edit/scripts/vercel-build.sh`, which copies the committed pack and rebuilds the host.
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
git push
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
No `pnpm cms-edit:deploy` needed unless you want a manual Vercel deploy without pushing.
|
|
96
|
+
|
|
97
|
+
### Other customers (e.g. Pedestal)
|
|
98
|
+
|
|
99
|
+
From `se-core-product`:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
./scripts/deploy-cms-edit-host.sh \
|
|
103
|
+
--config <customer-repo>/cms-edit/<site>/project.json \
|
|
104
|
+
--editor-pack <customer-repo>/cms-edit/<site>/editor-pack \
|
|
105
|
+
--prod
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Or commit + push if that customer repo has its own cms-edit-host Vercel project.
|
|
109
|
+
|
|
110
|
+
## Homepage slug reminder
|
|
111
|
+
|
|
112
|
+
SE Studio sites store the marketing homepage as Contentful slug **`index`** (public URL `/`). Regenerated `routing.md` documents this. Set `website.homepageSlug` in `project.json` only for exceptions (e.g. Pedestal `home`).
|
|
113
|
+
|
|
114
|
+
## Verify after deploy
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
curl -s -H "Authorization: Bearer <PAT>" "https://<host>/api/health" | jq .gettingStarted
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
In Claude Desktop (hosted extension): ask to read `cms-edit://customer/routing` and confirm new component types appear in `cms-edit://customer/components-index`.
|
|
121
|
+
|
|
122
|
+
## Related docs
|
|
123
|
+
|
|
124
|
+
| Doc | Purpose |
|
|
125
|
+
|-----|---------|
|
|
126
|
+
| `docs/CMS_EDIT_SETUP.md` | Full customer runbooks |
|
|
127
|
+
| `packages/contentful-cms/docs/cms-edit-project-template/README.md` | `project.json` schema |
|
|
128
|
+
| Customer `cms-edit/README.md` | Repo-specific scripts |
|
|
129
|
+
|
|
130
|
+
## Sub-skill links
|
|
131
|
+
|
|
132
|
+
| Prior work | Skill |
|
|
133
|
+
|------------|-------|
|
|
134
|
+
| Guidelines changed | `contentful-cms-update-cms-guidelines` |
|
|
135
|
+
| New registration | `se-marketing-sites-register-cms-features` |
|
|
136
|
+
| Editor `.mcpb` install | `contentful-cms-setup` (hosted path) |
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: contentful-cms-schema-audit
|
|
3
|
+
description: "Run a comprehensive cross-site Contentful schema audit: field order, descriptions, validations, rich text embeds, field usage, webhooks, live preview, and Page Status. Use when comparing schemas across customer sites or recommending field reordering."
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Cross-site Contentful schema audit
|
|
7
|
+
|
|
8
|
+
Use when you need a **comprehensive comparison** of Contentful schemas across all SE Studio marketing sites — not just drift vs golden.
|
|
9
|
+
|
|
10
|
+
## Credentials
|
|
11
|
+
|
|
12
|
+
Only **`CONTENTFUL_MANAGEMENT_TOKEN`** is required (global env var).
|
|
13
|
+
|
|
14
|
+
- **Schema export** uses the Management API (CMA).
|
|
15
|
+
- **Field usage** uses the Preview API; preview tokens are **resolved automatically** from each space's delivery API keys via CMA (same as `cms-edit index sync`). No per-site `.env.local` needed.
|
|
16
|
+
|
|
17
|
+
The management token must have permission to read API keys for each target space.
|
|
18
|
+
|
|
19
|
+
## Site registry
|
|
20
|
+
|
|
21
|
+
Canonical site list: [`docs/schema-audit/sites.registry.json`](../../../docs/schema-audit/sites.registry.json)
|
|
22
|
+
|
|
23
|
+
Customer-specific types/fields (excluded from core gap noise): [`docs/schema-audit/customer-overrides.registry.json`](../../../docs/schema-audit/customer-overrides.registry.json)
|
|
24
|
+
|
|
25
|
+
## Two-phase workflow
|
|
26
|
+
|
|
27
|
+
### Phase 1 — Scripts (factual)
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
export CONTENTFUL_MANAGEMENT_TOKEN=...
|
|
31
|
+
|
|
32
|
+
# Full pipeline
|
|
33
|
+
pnpm schema-audit
|
|
34
|
+
|
|
35
|
+
# Subset of sites
|
|
36
|
+
pnpm schema-audit -- --sites brightline,om1
|
|
37
|
+
|
|
38
|
+
# Schema only (skip Preview API usage scan)
|
|
39
|
+
pnpm schema-audit -- --skip-usage
|
|
40
|
+
|
|
41
|
+
# Individual steps
|
|
42
|
+
pnpm schema-audit:export
|
|
43
|
+
pnpm schema-audit:space-config
|
|
44
|
+
pnpm schema-audit:matrix
|
|
45
|
+
pnpm schema-audit:rtf
|
|
46
|
+
pnpm schema-audit:help-text
|
|
47
|
+
pnpm schema-audit:usage
|
|
48
|
+
pnpm schema-audit:insights
|
|
49
|
+
pnpm schema-audit:sidebar
|
|
50
|
+
pnpm schema-audit:report
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Produces **`docs/schema-audit/REPORT.md`** — factual findings only.
|
|
54
|
+
|
|
55
|
+
### Phase 2 — Analysis (interpretive)
|
|
56
|
+
|
|
57
|
+
After Phase 1, read `REPORT.md` and matrix/usage JSON, then complete **`docs/schema-audit/ANALYSIS.md`**:
|
|
58
|
+
|
|
59
|
+
1. Rank P0/P1/P2 actions (migrations vs editorial vs config)
|
|
60
|
+
2. Decide which core gaps are intentional per-site
|
|
61
|
+
3. Prioritize RTF violations that block editors or break renderers
|
|
62
|
+
4. Batch help-text updates by content type
|
|
63
|
+
5. Recommend deprecating or documenting never-used fields
|
|
64
|
+
6. Confirm webhook URLs and live preview per deployment
|
|
65
|
+
7. Plan Page Status sidebar installs (Ninetailed is PointMe-only)
|
|
66
|
+
8. Extend `customer-overrides.registry.json` if new customer fields appear
|
|
67
|
+
|
|
68
|
+
If `ANALYSIS.md` already exists, the report step writes a fresh template to `ANALYSIS.template.md` instead of overwriting.
|
|
69
|
+
|
|
70
|
+
## Output artifacts
|
|
71
|
+
|
|
72
|
+
| Path | Purpose |
|
|
73
|
+
|------|---------|
|
|
74
|
+
| `docs/schema-audit/exports/<site>.json` | Full CMA schema (content types + editor interfaces) |
|
|
75
|
+
| `docs/schema-audit/exports/<site>-space-config.json` | Webhooks, live preview, Page Status install params |
|
|
76
|
+
| `docs/schema-audit/matrix/*.json` | Cross-site matrices + classified gaps |
|
|
77
|
+
| `docs/schema-audit/matrix/rtf-canonical-diff.json` | RTF violations vs `docs/schema-export.json` |
|
|
78
|
+
| `docs/schema-audit/matrix/help-text-review.json` | Full core help-text review queue |
|
|
79
|
+
| `docs/schema-audit/matrix/sidebar.json` | Sidebar widgets and Page Status gaps |
|
|
80
|
+
| `docs/schema-audit/matrix/space-config.json` | Webhook summary per site |
|
|
81
|
+
| `docs/schema-audit/usage/<site>.json` | Per-field population rates |
|
|
82
|
+
| `docs/schema-audit/usage/never-used.json` | Never-used core fields |
|
|
83
|
+
| `docs/schema-audit/usage/recommended-core-order.json` | Usage-ranked core editor order |
|
|
84
|
+
| `docs/schema-audit/usage/site-additional-fields.json` | Per-site non-core fields (appendix) |
|
|
85
|
+
| `docs/schema-audit/canonical/*.json` | Golden RTF rules and core field sets |
|
|
86
|
+
| `docs/schema-audit/REPORT.md` | Phase 1 factual report |
|
|
87
|
+
| `docs/schema-audit/ANALYSIS.md` | Phase 2 priorities (human/agent completed) |
|
|
88
|
+
| `docs/schema-audit/report.json` | Machine-readable summary |
|
|
89
|
+
|
|
90
|
+
## What the report covers
|
|
91
|
+
|
|
92
|
+
1. **Core** content type and field gaps (customer-specific excluded via registry)
|
|
93
|
+
2. Core validation/structural differences
|
|
94
|
+
3. Rich text: violations vs codebase canonical (`docs/schema-export.json`) plus cross-site diffs
|
|
95
|
+
4. Full help-text review queue for core fields
|
|
96
|
+
5. Never-used core fields (0% population)
|
|
97
|
+
6. Recommended core editor field order (usage-ranked; site extras in appendix)
|
|
98
|
+
7. Webhooks, live preview, Page Status app (vs `docs/CONTENTFUL_WEBHOOK_REVALIDATION.md`)
|
|
99
|
+
8. Sidebar placement gaps for Page Status on `component`/`collection`
|
|
100
|
+
9. Cross-site usage medians and per-site profiles
|
|
101
|
+
|
|
102
|
+
## Customer-specific scope
|
|
103
|
+
|
|
104
|
+
PointMe (`nt_*`, `featureFlags`, pricing), Brightline phone/tracking fields, etc. are registered in **`customer-overrides.registry.json`**. They appear in the appendix, not core gap counts.
|
|
105
|
+
|
|
106
|
+
Add new customer fields there before re-running so core gap noise stays low.
|
|
107
|
+
|
|
108
|
+
## Enum fields
|
|
109
|
+
|
|
110
|
+
`componentType`, `collectionType`, and `externalComponentType` enum lists are **informational** — each site keeps its own component names. See `matrix/enum-diffs.json`.
|
|
111
|
+
|
|
112
|
+
## Migrations
|
|
113
|
+
|
|
114
|
+
This skill is **read-only**. To align a space structurally, use **`contentful-cms-sync-schema`** after reviewing audit gaps in `ANALYSIS.md`.
|
|
115
|
+
|
|
116
|
+
## Re-run after schema changes
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
pnpm schema-audit
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Compare new `REPORT.md` / `matrix/*.json` to prior commit or regenerate descriptive site notes in `docs/schema-audit/<site>.md` if needed.
|
|
@@ -86,6 +86,7 @@ Standard order when diff shows these gaps:
|
|
|
86
86
|
| 4 | `16-add-navigation-item-long-text.js` | `navigationItem.longText` |
|
|
87
87
|
| 5 | `15-add-slug-regexp-validation.js` | Slug format validation |
|
|
88
88
|
| 6 | `17-add-article-authors.js` | `article.authors` array + backfill from `author` |
|
|
89
|
+
| 7 | `21-add-article-bottom-content.js` | `article.bottomContent` array (idempotent; clones `content` link types) |
|
|
89
90
|
|
|
90
91
|
Site-specific (run only when diff shows missing field **and** app uses it):
|
|
91
92
|
|
|
@@ -324,6 +324,12 @@ All under `<appDir>`:
|
|
|
324
324
|
|
|
325
325
|
---
|
|
326
326
|
|
|
327
|
+
## Hosted editor pack (after guidelines change)
|
|
328
|
+
|
|
329
|
+
If the site uses **hosted cms-edit** (`cms-edit/` in the customer repo), regenerate and commit the editor pack so MCP resources pick up new guideline prose and component indexes. Vercel deploy copies the **committed** pack — it does not run `editor-pack generate` for you.
|
|
330
|
+
|
|
331
|
+
Follow [`../contentful-cms-regenerate-editor-pack/SKILL.md`](../contentful-cms-regenerate-editor-pack/SKILL.md).
|
|
332
|
+
|
|
327
333
|
## Sub-skills reference
|
|
328
334
|
|
|
329
335
|
| Purpose | Skill |
|
|
@@ -331,4 +337,5 @@ All under `<appDir>`:
|
|
|
331
337
|
| Curate showcase mocks (Step 2 of `fresh`) | [`../se-marketing-sites-curate-showcase-mocks/SKILL.md`](../se-marketing-sites-curate-showcase-mocks/SKILL.md) |
|
|
332
338
|
| Full-site bulk generation (Step 4 of `fresh`: Phases 0–5) | [`../contentful-cms-generate-all-guidelines/SKILL.md`](../contentful-cms-generate-all-guidelines/SKILL.md) |
|
|
333
339
|
| Single-type regeneration (after code change) | [`../contentful-cms-generate-cms-guidelines/SKILL.md`](../contentful-cms-generate-cms-guidelines/SKILL.md) (mode: single) |
|
|
340
|
+
| Regenerate hosted editor pack | [`../contentful-cms-regenerate-editor-pack/SKILL.md`](../contentful-cms-regenerate-editor-pack/SKILL.md) |
|
|
334
341
|
| Per-component pipeline detail | [`generate-component-guidelines.md`](../contentful-cms-cms-guidelines/generate-component-guidelines.md) |
|
|
@@ -60,7 +60,7 @@ The following are already in the packages:
|
|
|
60
60
|
|
|
61
61
|
- `IRedirect` + `isRedirect` in `@se-studio/core-data-types` (now uses `fromInternal` / `toInternal`)
|
|
62
62
|
- `baseRedirectConverter` + `BaseRedirectSkeleton`
|
|
63
|
-
- `contentfulRedirectsRest` + `buildRedirectMap` + `getRedirectsWithErrors` / `getRedirectMap` (via `createAppHelpers`)
|
|
63
|
+
- `contentfulRedirectsRest` + `buildRedirectMap` (now with robust self/cycle guards + normalization) + `getRedirectsWithErrors` / `getRedirectMap` (via `createAppHelpers`)
|
|
64
64
|
- Revalidation tag `redirect` (so the existing webhook machinery knows about the new type)
|
|
65
65
|
|
|
66
66
|
You only need to wire the **rebuild** side in your app.
|
|
@@ -174,6 +174,30 @@ export const config = {
|
|
|
174
174
|
|
|
175
175
|
If you already have a `middleware.ts` for A/B or other things, just add the redirect check at the very top (before any other logic).
|
|
176
176
|
|
|
177
|
+
### 4.2.1 Redirects and sitemaps
|
|
178
|
+
|
|
179
|
+
When you create a redirect whose `from` (raw or resolved via internal picker) matches a URL that would otherwise be listed in your sitemap, that URL should generally be omitted from the sitemap (search engines should not be told to crawl a source that 301s away).
|
|
180
|
+
|
|
181
|
+
The shared libraries now support this easily:
|
|
182
|
+
|
|
183
|
+
- The `getSitemapEntries(...)` function returned by the marketing sitemap helper (when you configure `marketingSiteSitemap` in `createAppHelpers`) accepts an optional `redirectMap` in its options. When supplied, any entry whose URL is a redirect source is filtered out before the entries are returned to `buildSitemap`.
|
|
184
|
+
- Standalone: `filterSitemapEntriesExcludingRedirects(entries, redirectMap)` (exported from `@se-studio/contentful-rest-api`) works on any `{ url: string }[]` list for custom flows.
|
|
185
|
+
|
|
186
|
+
Recommended pattern (in `app/sitemap.ts` and the unindexed route):
|
|
187
|
+
|
|
188
|
+
```ts
|
|
189
|
+
import { getRedirectMap, getSitemapEntries } from '@/lib/cms-server';
|
|
190
|
+
import { buildSitemap } from '@se-studio/core-ui';
|
|
191
|
+
|
|
192
|
+
export default async function sitemap() {
|
|
193
|
+
const redirectMap = await getRedirectMap({});
|
|
194
|
+
const entries = await getSitemapEntries({ includeUnindexed: false, redirectMap });
|
|
195
|
+
return buildSitemap([() => Promise.resolve(entries)], { baseUrl, ... });
|
|
196
|
+
}
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Pure `fromPath` vanity redirects were already absent from sitemaps (no backing content entry). This mainly helps when you redirect *away from* live CMS pages/articles.
|
|
200
|
+
|
|
177
201
|
### 4.3 Webhook = Deploy Hook (the trigger)
|
|
178
202
|
|
|
179
203
|
In Contentful → Settings → Webhooks, create (or reuse) a webhook that fires on:
|
|
@@ -226,6 +250,8 @@ Then commit the updated `.agents/skills/...` (the monorepo keeps them in sync wi
|
|
|
226
250
|
|
|
227
251
|
The `redirect` content type and the `buildRedirectMap` / `getRedirectMap` helpers are intentionally stable so a future faster path can consume the same data.
|
|
228
252
|
|
|
253
|
+
`buildRedirectMap` automatically drops self-redirects (A → A after normalization) and any rules that participate in longer cycles, emitting a console warning for cycles during build/generate. Internal paths are normalized with a trailing `/` to match your urlCalculators and sitemap hrefs.
|
|
254
|
+
|
|
229
255
|
---
|
|
230
256
|
|
|
231
257
|
**You now have editor-managed redirects that are as robust and low-surprise as your A/B tests, using only patterns that already exist in the codebase.**
|
|
@@ -89,3 +89,7 @@ Registering a component automatically adds it to the CMS Showcase (usually avail
|
|
|
89
89
|
|
|
90
90
|
* Ensure your `mock` object in the registration is complete and realistic.
|
|
91
91
|
* The showcase helps verify that `usedFields` and `UnusedChecker` are working correctly.
|
|
92
|
+
|
|
93
|
+
## Hosted cms-edit
|
|
94
|
+
|
|
95
|
+
If the site has `cms-edit/` (hosted MCP for editors), regenerate the editor pack after adding registrations so `cms-edit://customer/components-index` includes the new type. See [`../contentful-cms-regenerate-editor-pack/SKILL.md`](../contentful-cms-regenerate-editor-pack/SKILL.md).
|