@se-studio/project-build 1.0.131 → 1.0.133
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 +13 -14
- package/package.json +2 -4
- package/dist/management/sync-skills.d.ts +0 -4
- package/dist/management/sync-skills.d.ts.map +0 -1
- package/dist/management/sync-skills.js +0 -97
- package/dist/management/sync-skills.js.map +0 -1
- package/dist/seskills.d.ts +0 -9
- package/dist/seskills.d.ts.map +0 -1
- package/dist/seskills.js +0 -32
- package/dist/seskills.js.map +0 -1
- package/skills/contentful-cms/alt-text-audit/SKILL.md +0 -60
- package/skills/contentful-cms/cms-guidelines/README.md +0 -166
- package/skills/contentful-cms/cms-guidelines/colour-hint-prompt.md +0 -77
- package/skills/contentful-cms/cms-guidelines/evaluation-prompt.md +0 -84
- package/skills/contentful-cms/cms-guidelines/generate-component-guidelines.md +0 -126
- package/skills/contentful-cms/cms-guidelines/generation-prompt.md +0 -231
- package/skills/contentful-cms/cms-guidelines/html-component-authoring.md +0 -401
- package/skills/contentful-cms/cms-guidelines/validation-prompt.md +0 -170
- package/skills/contentful-cms/cms-guidelines/variant-loop.md +0 -189
- package/skills/contentful-cms/cms-guidelines/variant-proposal-prompt.md +0 -131
- package/skills/contentful-cms/core/SKILL.md +0 -793
- package/skills/contentful-cms/generate-all-guidelines/SKILL.md +0 -313
- package/skills/contentful-cms/generate-cms-guidelines/SKILL.md +0 -313
- package/skills/contentful-cms/image-guide/SKILL.md +0 -240
- package/skills/contentful-cms/manifest.json +0 -11
- package/skills/contentful-cms/navigation/SKILL.md +0 -23
- package/skills/contentful-cms/rich-text/SKILL.md +0 -96
- package/skills/contentful-cms/schema-org/SKILL.md +0 -74
- package/skills/contentful-cms/screenshots/SKILL.md +0 -46
- package/skills/contentful-cms/seo-descriptions/SKILL.md +0 -54
- package/skills/contentful-cms/templates/SKILL.md +0 -21
- package/skills/contentful-cms/update-cms-guidelines/SKILL.md +0 -348
- package/skills/se-marketing-sites/cms-routes-and-appshared/SKILL.md +0 -99
- package/skills/se-marketing-sites/create-collection/SKILL.md +0 -295
- package/skills/se-marketing-sites/create-component/SKILL.md +0 -250
- package/skills/se-marketing-sites/create-page/SKILL.md +0 -129
- package/skills/se-marketing-sites/curate-showcase-mocks/SKILL.md +0 -343
- package/skills/se-marketing-sites/handling-media/SKILL.md +0 -195
- package/skills/se-marketing-sites/lib-cms-structure/SKILL.md +0 -83
- package/skills/se-marketing-sites/register-cms-features/SKILL.md +0 -95
- package/skills/se-marketing-sites/styling-system/SKILL.md +0 -122
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: update-cms-guidelines
|
|
3
|
-
description: Primary CMS guideline orchestration. Use `fresh` only after a full clean slate and complete pipeline (showcase → screenshots → new component prose via Phase B/C/D — never git-restore fragments). Use `sync` for incremental changes but always delete stale types. If the user is vague, ask whether they want a full clean regeneration or incremental sync before acting.
|
|
4
|
-
license: Private
|
|
5
|
-
metadata:
|
|
6
|
-
author: se-core-product
|
|
7
|
-
version: "1.1.0"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# Update CMS Guidelines
|
|
11
|
-
|
|
12
|
-
This is the **primary entry point** for all CMS guideline work. It wraps the lower-level skills
|
|
13
|
-
into three clear modes so you always know which path to take.
|
|
14
|
-
|
|
15
|
-
## Terms: full regeneration vs incremental
|
|
16
|
-
|
|
17
|
-
| Term | Meaning |
|
|
18
|
-
|---|---|
|
|
19
|
-
| **Full regeneration** (brand-new run) | **Clean slate** of generated artifacts, then rerun the **entire** pipeline: showcase data → mocks → field list → **all** screenshots (components **and** collections) → **new** component guideline markdown (Phase B + C + D for **every** type — no restoring old `.md` from git) → collection/external CLI step → merge → commit. Collections are CLI-regenerated; externals may need hand-filled sections after stub creation. |
|
|
20
|
-
| **Incremental** (`sync` + targeted work) | Discovery/registrations are the source of truth. **Remove every stale artifact** for types no longer registered (fragments, PNGs, `screenshots/index.json` rows, `accepted-variants` JSON where your app tracks them). Then add or refresh only **new** or **changed** types (screenshots + `generate-cms-guidelines` single / generate-all partial). Always merge at the end if fragments changed. |
|
|
21
|
-
|
|
22
|
-
**Not** a full regeneration: restoring `docs/cms-guidelines/components/*.md` (or externals) from `git checkout`, merge-only, or screenshots-only while leaving years-old prose in place.
|
|
23
|
-
|
|
24
|
-
## When the user is vague
|
|
25
|
-
|
|
26
|
-
Phrases like “regenerate guidelines”, “refresh CMS docs”, “update showcase/guidelines”, or “redo screenshots” are **ambiguous**.
|
|
27
|
-
|
|
28
|
-
**Before doing substantial work, ask briefly:**
|
|
29
|
-
|
|
30
|
-
1. Do you want a **full clean regeneration** (delete existing fragments and screenshots, rewrite every component guideline from scratch, full screenshot pass)?
|
|
31
|
-
2. Or an **incremental** update (sync with registrations — **including removing** dropped types — plus only new/changed types)?
|
|
32
|
-
3. Or something narrower (e.g. **merge-only**, **one component**, **collections CLI only**)?
|
|
33
|
-
|
|
34
|
-
If they insist on “everything” / “from scratch” / “totally regenerate” / “wipe and rebuild”, treat that as **full regeneration** and follow **`fresh`** including the **clean slate** steps below — do **not** shortcut with git-restored fragments.
|
|
35
|
-
|
|
36
|
-
## When to use which mode
|
|
37
|
-
|
|
38
|
-
| Situation | Mode |
|
|
39
|
-
|---|---|
|
|
40
|
-
| New app — no guidelines exist yet | `fresh` |
|
|
41
|
-
| User wants **total** / **full** / **clean-slate** regeneration | `fresh` (must include **clean slate** + full **generate-all-guidelines** Phase 3 for all components) |
|
|
42
|
-
| Types added or removed in `registrations.ts` (incremental) | `sync` — **always** remove stale files and index entries, then add/refresh new types |
|
|
43
|
-
| Fragment files edited manually, combined doc needs rebuild | `merge-only` |
|
|
44
|
-
| Major refactor but user confirms they **do not** need new prose | Rare — confirm explicitly; otherwise use `fresh` |
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Inputs
|
|
49
|
-
|
|
50
|
-
| Input | Example |
|
|
51
|
-
|---|---|
|
|
52
|
-
| App directory (repo-relative or absolute) | `apps/example-se2026` |
|
|
53
|
-
| Port | `3012` |
|
|
54
|
-
| Discovery URL | `http://localhost:3012/api/cms/discovery/` |
|
|
55
|
-
| Mode | `fresh` \| `sync` \| `merge-only` |
|
|
56
|
-
|
|
57
|
-
**App ports:**
|
|
58
|
-
|
|
59
|
-
| App | Port |
|
|
60
|
-
|---|---|
|
|
61
|
-
| example-brightline | 3010 |
|
|
62
|
-
| example-se2026 | 3012 |
|
|
63
|
-
| example-om1 | 3013 |
|
|
64
|
-
| example-empty | 3014 |
|
|
65
|
-
| example-brightlifekids | 3015 |
|
|
66
|
-
|
|
67
|
-
---
|
|
68
|
-
|
|
69
|
-
## Mode: fresh
|
|
70
|
-
|
|
71
|
-
Full pipeline from a **clean slate** (or a brand-new app). Expect roughly **30–90+ minutes** for a typical site (component count × LLM time for Phase B/C/D).
|
|
72
|
-
|
|
73
|
-
### Step 0 — Clean slate (mandatory for true full regeneration)
|
|
74
|
-
|
|
75
|
-
If any guideline or screenshot files already exist, **delete generated guideline outputs** before re-running the pipeline. Otherwise you risk mixed old/new content or skipping work.
|
|
76
|
-
|
|
77
|
-
**Do:**
|
|
78
|
-
|
|
79
|
-
1. Remove per-type fragments:
|
|
80
|
-
`docs/cms-guidelines/components/*.md`, `docs/cms-guidelines/collections/*.md`, `docs/cms-guidelines/externals/*.md`
|
|
81
|
-
**Keep** editorial/meta files if present (e.g. `README.md`, `CHECKLIST.md`, `LAYOUT.md`, `GENERATE_NEXT_*.md`).
|
|
82
|
-
2. Remove merged bundle: `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md`.
|
|
83
|
-
3. Remove screenshots: all `docs/cms-guidelines/screenshots/components/*.png`, `.../collections/*.png`, `.../externals/*.png` (if used), then reset `docs/cms-guidelines/screenshots/index.json` to `[]` **or** delete it so captures recreate it.
|
|
84
|
-
4. Clear showcase pipeline inputs as needed: remove `src/generated/showcase-examples.json`, `src/generated/showcase-mocks-draft.json`, and the tree `src/generated/cms-discovery/accepted-variants/` (or empty `components/` / `collections/` / `externals/` subdirs). Stub `src/generated/showcase-mocks.json` per **curate-showcase-mocks** if the import must compile.
|
|
85
|
-
5. Remove any **duplicate** variant path some apps still have (e.g. `generated/cms-discovery/accepted-variants/` at repo root of the app) if it is not the canonical `src/generated/...` tree.
|
|
86
|
-
6. Optionally reset `generated/cms-discovery/colour-hints.json` if you want colour hints re-derived during Phase C.
|
|
87
|
-
|
|
88
|
-
**Do not** (for a claimed full regeneration):
|
|
89
|
-
|
|
90
|
-
- Restore `docs/cms-guidelines/components/*.md` or `externals/*.md` from git instead of running **generate-all-guidelines Phase 3** (Phase B + C + D per component).
|
|
91
|
-
- Skip collection screenshot capture when collections are registered — Phase 1 must cover **both** components and collections for a complete visual record.
|
|
92
|
-
|
|
93
|
-
After this, run Steps 1–4 in order (prerequisites → showcase mocks → field list → generate-all-guidelines).
|
|
94
|
-
|
|
95
|
-
### Step 1 — Prerequisites
|
|
96
|
-
|
|
97
|
-
Check all of these before starting:
|
|
98
|
-
|
|
99
|
-
```bash
|
|
100
|
-
# 1. Dev server is running
|
|
101
|
-
curl -sL http://localhost:<PORT>/api/cms/discovery/ | head -c 100
|
|
102
|
-
# Should return: {"components":[
|
|
103
|
-
|
|
104
|
-
# 2. agent-browser is installed
|
|
105
|
-
agent-browser --version
|
|
106
|
-
# If missing: npm install -g agent-browser && agent-browser install
|
|
107
|
-
|
|
108
|
-
# 3. Env vars present in <appDir>/.env.local
|
|
109
|
-
grep -E "CONTENTFUL_SPACE_ID|CONTENTFUL_ACCESS_TOKEN|OPENAI_API_KEY|ANTHROPIC_API_KEY" <appDir>/.env.local
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
### Step 2 — Curate showcase mocks
|
|
113
|
-
|
|
114
|
-
Read and follow the **curate-showcase-mocks** skill:
|
|
115
|
-
`.agents/skills/se-marketing-sites-curate-showcase-mocks/SKILL.md`
|
|
116
|
-
|
|
117
|
-
This produces `src/generated/showcase-mocks.json` (committed) and
|
|
118
|
-
`src/generated/cms-discovery/accepted-variants/{components|collections|externals}/<slug>.json` (often gitignored — **some apps commit them**; follow the app’s `.gitignore`).
|
|
119
|
-
|
|
120
|
-
When complete, confirm:
|
|
121
|
-
- `src/generated/showcase-mocks.json` has non-empty `components` and `collections` keys
|
|
122
|
-
- `src/generated/cms-discovery/accepted-variants/` has `components/` and `collections/` subdirs with JSON files
|
|
123
|
-
|
|
124
|
-
Backfill any registered types missing from the LLM draft using `showcase-examples.json` (see curate skill), and add minimal `accepted-variants` JSON for types with no variant file so screenshot capture can run.
|
|
125
|
-
|
|
126
|
-
### Step 3 — Generate HTML Component Style Guide
|
|
127
|
-
|
|
128
|
-
Generate the design system reference used when authoring `HtmlComponent` entries:
|
|
129
|
-
|
|
130
|
-
```bash
|
|
131
|
-
# From the app directory:
|
|
132
|
-
pnpm run cms-generate-html-style-guide
|
|
133
|
-
# or from repo root:
|
|
134
|
-
pnpm --filter <appName> exec cms-generate-html-style-guide --app-dir .
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
Reads `tailwind.config.json` and `src/app/globals.css`; writes `docs/cms-guidelines/html-component-style-guide.md`. No dev server required. Safe to skip if the design system has not changed since the last run.
|
|
138
|
-
|
|
139
|
-
### Step 4 — Generate field list
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
# From the app directory:
|
|
143
|
-
pnpm run cms-discovery:field-list
|
|
144
|
-
# or from repo root:
|
|
145
|
-
pnpm --filter <appName> exec cms-generate-field-list --app-dir .
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
Produces `generated/cms-discovery/field-list.json` (discovery API reads from this path). Some apps use `src/generated/` for showcase artifacts; see app docs.
|
|
149
|
-
|
|
150
|
-
### Step 5 — Run generate-all-guidelines
|
|
151
|
-
|
|
152
|
-
Read and follow the **generate-all-guidelines** skill:
|
|
153
|
-
`.agents/skills/contentful-cms-generate-all-guidelines/SKILL.md`
|
|
154
|
-
|
|
155
|
-
Skip its prerequisite check (you already verified everything through Step 4).
|
|
156
|
-
Run Phases 0–5 from that skill with **full regeneration rules**:
|
|
157
|
-
|
|
158
|
-
- **Phase 0** — Discover types; **do not** skip components that already had old fragments (there should be none after clean slate).
|
|
159
|
-
- **Phase 1** — Bulk screenshot capture for **all components**, then **all collections** (and externals if your app captures them).
|
|
160
|
-
- **Phase 2** — Collections + externals (`cms-generate-collection-guidelines`)
|
|
161
|
-
- **Phase 3** — Component guidelines (**every** type: Phase B + C + D; **overwrite** `components/<slug>.md`)
|
|
162
|
-
- **Phase 4** — Merge (`cms-merge-guidelines`)
|
|
163
|
-
- **Phase 5** — Commit
|
|
164
|
-
|
|
165
|
-
### After Phase 2 (externals)
|
|
166
|
-
|
|
167
|
-
If any `docs/cms-guidelines/externals/<slug>.md` stubs were created, fill in their
|
|
168
|
-
`## Fields & Schema` and `## Usage` sections before committing. See the
|
|
169
|
-
**generate-cms-guidelines** skill (`Step 2b`) for guidance on what to put in these sections.
|
|
170
|
-
|
|
171
|
-
---
|
|
172
|
-
|
|
173
|
-
## Mode: sync
|
|
174
|
-
|
|
175
|
-
Use when types have been added or removed in `registrations.ts` (or from the Contentful space).
|
|
176
|
-
This mode diffs the current registered types against existing guideline files and handles both
|
|
177
|
-
stale files and new types.
|
|
178
|
-
|
|
179
|
-
**Incremental is not “append only”.** If a type left registrations or discovery, you **must** remove its artifacts (markdown, PNGs, index rows, optional `accepted-variants` files). Otherwise the repo and `COMPONENT_GUIDELINES_FOR_LLM.md` will lie.
|
|
180
|
-
|
|
181
|
-
### Phase 0 — Diff
|
|
182
|
-
|
|
183
|
-
Fetch the discovery endpoint and compute the current set of registered type slugs:
|
|
184
|
-
|
|
185
|
-
```bash
|
|
186
|
-
curl -sL http://localhost:<PORT>/api/cms/discovery/ > /tmp/discovery.json
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Slug formula: `name.toLowerCase().replace(/\s+/g, '-').replace(/[()]/g, '')`
|
|
190
|
-
|
|
191
|
-
Examples: `"Article Browser Sticky"` → `article-browser-sticky`, `"Two Column (Rich Text)"` → `two-column-rich-text`
|
|
192
|
-
|
|
193
|
-
Build three diff lists by comparing discovery slugs against existing files:
|
|
194
|
-
|
|
195
|
-
```bash
|
|
196
|
-
# List existing guideline file slugs (strip .md extension)
|
|
197
|
-
ls <appDir>/docs/cms-guidelines/components/ # → component file slugs
|
|
198
|
-
ls <appDir>/docs/cms-guidelines/collections/ # → collection file slugs
|
|
199
|
-
ls <appDir>/docs/cms-guidelines/externals/ # → external file slugs
|
|
200
|
-
```
|
|
201
|
-
|
|
202
|
-
From the diff, identify:
|
|
203
|
-
|
|
204
|
-
| Status | Meaning | Action |
|
|
205
|
-
|---|---|---|
|
|
206
|
-
| **STALE** | File exists, type not in discovery | Remove files |
|
|
207
|
-
| **NEW** | Type in discovery, no file exists | Generate guidelines |
|
|
208
|
-
| **UNCHANGED** | Both exist | Skip |
|
|
209
|
-
|
|
210
|
-
Report the full diff to the user before taking any action.
|
|
211
|
-
|
|
212
|
-
### Phase 1 — Remove stale files
|
|
213
|
-
|
|
214
|
-
For each **stale component** slug (`<slug>`):
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
# 1. Delete the guideline fragment
|
|
218
|
-
rm <appDir>/docs/cms-guidelines/components/<slug>.md
|
|
219
|
-
|
|
220
|
-
# 2. Delete all screenshot variants (screenshots live under components/ or collections/ subdirs)
|
|
221
|
-
rm -f <appDir>/docs/cms-guidelines/screenshots/components/<slug>-*.png
|
|
222
|
-
rm -f <appDir>/docs/cms-guidelines/screenshots/collections/<slug>-*.png
|
|
223
|
-
|
|
224
|
-
# 3. Remove screenshot index entries for this type (index.json has typeName and file e.g. "components/<slug>-default.png")
|
|
225
|
-
# Read screenshots/index.json, filter out entries where typeName matches or file starts with "components/<slug>-" or "collections/<slug>-", rewrite
|
|
226
|
-
node -e "
|
|
227
|
-
const fs = require('node:fs');
|
|
228
|
-
const p = '<appDir>/docs/cms-guidelines/screenshots/index.json';
|
|
229
|
-
const idx = JSON.parse(fs.readFileSync(p, 'utf8'));
|
|
230
|
-
const filtered = idx.filter(e => !e.file.startsWith('components/<slug>-') && !e.file.startsWith('collections/<slug>-'));
|
|
231
|
-
fs.writeFileSync(p, JSON.stringify(filtered, null, 2));
|
|
232
|
-
console.log('Removed', idx.length - filtered.length, 'entries for <slug>');
|
|
233
|
-
"
|
|
234
|
-
|
|
235
|
-
# 4. Remove accepted-variants file if present (check both components/ and collections/)
|
|
236
|
-
rm -f <appDir>/src/generated/cms-discovery/accepted-variants/components/<slug>.json
|
|
237
|
-
rm -f <appDir>/src/generated/cms-discovery/accepted-variants/collections/<slug>.json
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
For each **stale collection** slug (`<slug>`):
|
|
241
|
-
|
|
242
|
-
```bash
|
|
243
|
-
# 1. Fragment
|
|
244
|
-
rm <appDir>/docs/cms-guidelines/collections/<slug>.md
|
|
245
|
-
|
|
246
|
-
# 2. Screenshots for that collection
|
|
247
|
-
rm -f <appDir>/docs/cms-guidelines/screenshots/collections/<slug>-*.png
|
|
248
|
-
|
|
249
|
-
# 3. Remove index entries (same pattern as components — filter by file prefix)
|
|
250
|
-
# e.g. drop rows where e.file.startsWith('collections/<slug>-')
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
Use the same **index.json** filtering approach as for stale components (adjust the `startsWith` prefix to `collections/<slug>-`).
|
|
254
|
-
|
|
255
|
-
For each **stale external** slug:
|
|
256
|
-
|
|
257
|
-
> **Caution:** External guideline files contain hand-authored schema documentation. Confirm
|
|
258
|
-
> with the user before deleting. If confirmed:
|
|
259
|
-
|
|
260
|
-
```bash
|
|
261
|
-
rm <appDir>/docs/cms-guidelines/externals/<slug>.md
|
|
262
|
-
```
|
|
263
|
-
|
|
264
|
-
### Phase 2 — Add new types
|
|
265
|
-
|
|
266
|
-
**New components** (one or more):
|
|
267
|
-
|
|
268
|
-
Run the [generate-all-guidelines](../generate-all-guidelines/SKILL.md) skill's Phase 1 (screenshots)
|
|
269
|
-
and Phase 3 (component subagents) for **only the new types**, then skip to Phase 4 (merge).
|
|
270
|
-
|
|
271
|
-
If the new component does not yet have an `accepted-variants/components/<slug>.json` file (or `collections/<slug>.json` for a collection), run:
|
|
272
|
-
|
|
273
|
-
```bash
|
|
274
|
-
pnpm --filter <appName> generate-showcase-mocks -- --types "<Type Name 1>,<Type Name 2>"
|
|
275
|
-
```
|
|
276
|
-
|
|
277
|
-
This regenerates the variant file for just those types. Then capture screenshots and run the
|
|
278
|
-
Phase 3 subagent prompt as described in generate-all-guidelines.
|
|
279
|
-
|
|
280
|
-
**New collections or externals:**
|
|
281
|
-
|
|
282
|
-
Re-running the generator is safe — it always overwrites collections and only creates externals
|
|
283
|
-
if the file does not already exist:
|
|
284
|
-
|
|
285
|
-
```bash
|
|
286
|
-
cms-generate-collection-guidelines \
|
|
287
|
-
--discovery-url http://localhost:<PORT>/api/cms/discovery/ \
|
|
288
|
-
--app-dir <appDir>
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
If a new external stub was created, fill in its `## Fields & Schema` and `## Usage` sections
|
|
292
|
-
before committing (see Mode: fresh → After Phase 2).
|
|
293
|
-
|
|
294
|
-
### Phase 3 — Merge and commit
|
|
295
|
-
|
|
296
|
-
```bash
|
|
297
|
-
# Rebuild the combined document
|
|
298
|
-
cms-merge-guidelines --app-dir <appDir>
|
|
299
|
-
# or: pnpm --filter <appName> run cms-guidelines:merge
|
|
300
|
-
|
|
301
|
-
# Commit everything
|
|
302
|
-
git add <appDir>/docs/cms-guidelines/ <appDir>/src/generated/cms-discovery/
|
|
303
|
-
git commit -m "chore(<appName>): sync CMS guidelines with registrations"
|
|
304
|
-
```
|
|
305
|
-
|
|
306
|
-
---
|
|
307
|
-
|
|
308
|
-
## Mode: merge-only
|
|
309
|
-
|
|
310
|
-
Rebuilds `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md` from all existing fragment files.
|
|
311
|
-
Use after manual edits to fragment files, or after any of the other modes if the combined doc
|
|
312
|
-
looks stale.
|
|
313
|
-
|
|
314
|
-
```bash
|
|
315
|
-
cms-merge-guidelines --app-dir <appDir>
|
|
316
|
-
# or from the app directory:
|
|
317
|
-
pnpm run cms-guidelines:merge
|
|
318
|
-
```
|
|
319
|
-
|
|
320
|
-
---
|
|
321
|
-
|
|
322
|
-
## Output files (reference)
|
|
323
|
-
|
|
324
|
-
All under `<appDir>`:
|
|
325
|
-
|
|
326
|
-
| File | Description | Committed |
|
|
327
|
-
|---|---|---|
|
|
328
|
-
| `docs/cms-guidelines/components/<slug>.md` | Per-component fragment | Yes |
|
|
329
|
-
| `docs/cms-guidelines/collections/<slug>.md` | Per-collection fragment | Yes |
|
|
330
|
-
| `docs/cms-guidelines/externals/<slug>.md` | Per-external fragment | Yes |
|
|
331
|
-
| `docs/cms-guidelines/screenshots/index.json` | Screenshot index | Yes |
|
|
332
|
-
| `docs/cms-guidelines/screenshots/{components\|collections\|externals}/*.png` | Screenshot images | Yes |
|
|
333
|
-
| `docs/cms-guidelines/COMPONENT_GUIDELINES_FOR_LLM.md` | Merged document (AI-readable) | Yes |
|
|
334
|
-
| `generated/cms-discovery/field-list.json` | Field metadata (discovery API) | Yes |
|
|
335
|
-
| `src/generated/showcase-mocks.json` | Curated showcase mocks | Yes |
|
|
336
|
-
| `src/generated/cms-discovery/accepted-variants/{components\|collections\|externals}/<slug>.json` | Variant files (per type) | Usually no (app-dependent) |
|
|
337
|
-
| `src/generated/showcase-examples.json` | Raw Contentful data dump | No |
|
|
338
|
-
|
|
339
|
-
---
|
|
340
|
-
|
|
341
|
-
## Sub-skills reference
|
|
342
|
-
|
|
343
|
-
| Purpose | Skill |
|
|
344
|
-
|---|---|
|
|
345
|
-
| Curate showcase mocks (Step 2 of `fresh`) | `.agents/skills/se-marketing-sites-curate-showcase-mocks/SKILL.md` |
|
|
346
|
-
| Full-site bulk generation (Step 4 of `fresh`: Phases 0–5) | `.agents/skills/contentful-cms-generate-all-guidelines/SKILL.md` |
|
|
347
|
-
| Single-type regeneration (after code change) | `.agents/skills/contentful-cms-generate-cms-guidelines/SKILL.md` (mode: single) |
|
|
348
|
-
| Per-component pipeline detail | `packages/contentful-cms/skills/cms-guidelines/generate-component-guidelines.md` |
|
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: cms-routes-and-appshared
|
|
3
|
-
description: Guide for the (cms-routes) route group and appShared pattern. Use when setting up or migrating CMS-driven routing, creating new route segments, or refactoring page structure.
|
|
4
|
-
license: Private
|
|
5
|
-
metadata:
|
|
6
|
-
author: se-core-product
|
|
7
|
-
version: "1.0.0"
|
|
8
|
-
---
|
|
9
|
-
|
|
10
|
-
# CMS Routes and appShared Pattern
|
|
11
|
-
|
|
12
|
-
Reference apps: **example-se2026**, **example-brightline**, **example-om1**. (example-om1 uses `resources/`, `team/`, `topics/` instead of `articles/`, `people/`, `tags/`.)
|
|
13
|
-
|
|
14
|
-
## Route Group: (cms-routes)
|
|
15
|
-
|
|
16
|
-
All CMS-driven pages live under `src/app/(cms-routes)/`. The layout enables dynamic params:
|
|
17
|
-
|
|
18
|
-
```tsx
|
|
19
|
-
// layout.tsx
|
|
20
|
-
export const dynamicParams = true;
|
|
21
|
-
|
|
22
|
-
export default function CmsRoutesLayout({ children }: { children: React.ReactNode }) {
|
|
23
|
-
return children;
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Route Structure
|
|
28
|
-
|
|
29
|
-
| Path | File | Purpose |
|
|
30
|
-
|------|------|---------|
|
|
31
|
-
| `/` | `page.ts` | Home (slug: `index`) |
|
|
32
|
-
| `/{slug}/` | `[level1]/page.ts` | Single-level page |
|
|
33
|
-
| `/{slug1}/{slug2}/...` | `[level1]/[...slugs]/page.ts` | Multi-level pages |
|
|
34
|
-
| `/articles/` | `articles/page.ts` | Articles index (uses ARTICLES_BASE) |
|
|
35
|
-
| `/articles/{type}/` | `articles/[articleType]/page.ts` | Article type index |
|
|
36
|
-
| `/articles/{type}/{tag}/` | `articles/[articleType]/[tag]/page.ts` | Article type + tag index |
|
|
37
|
-
| `/articles/{type}/{tag}/{article}/` | `articles/[articleType]/[tag]/[...slugs]/page.ts` | Individual article |
|
|
38
|
-
| `/tags/`, `/tags/{tag}/` | `tags/` | Tag index (if enabled) |
|
|
39
|
-
| `/people/`, `/people/{person}/` | `people/` | People (if enabled) |
|
|
40
|
-
|
|
41
|
-
Base paths come from `@/lib/constants` (e.g. ARTICLES_BASE = `/learning-hub` or `/articles`).
|
|
42
|
-
|
|
43
|
-
## appShared Modules
|
|
44
|
-
|
|
45
|
-
Route files are thin wrappers. Logic lives in `src/appShared/`:
|
|
46
|
-
|
|
47
|
-
| Module | Exports | Used by |
|
|
48
|
-
|--------|---------|---------|
|
|
49
|
-
| `pageShared.tsx` | `generatePage`, `generatePageMetadata` | `/`, `[level1]`, `[level1]/[...slugs]` |
|
|
50
|
-
| `articleShared.tsx` | `generateArticlePage`, `generateArticleMetadata` | Article detail |
|
|
51
|
-
| `articleTypeShared.tsx` | `generateArticleTypePage`, `generateArticleTypeMetadata` | Article type index |
|
|
52
|
-
| `articleTypesIndexShared.tsx` | `generateArticleTypesIndexPage`, `generateArticleTypesIndexMetadata` | Articles index |
|
|
53
|
-
| `articleTypeTagShared.tsx` | `generateArticleTypeTagPage`, `generateArticleTypeTagMetadata` | Article type + tag index |
|
|
54
|
-
| `customTypeShared.tsx` | `generateCustomTypePage`, `generateCustomTypeMetadata` | Custom types |
|
|
55
|
-
| `personShared.tsx` | `generatePersonPage`, `generatePersonMetadata` | Person page |
|
|
56
|
-
| `tagShared.tsx` | `generateTagPage`, `generateTagMetadata` | Tag index |
|
|
57
|
-
| `tagsIndexShared.tsx` | `generateTagsIndexPage`, `generateTagsIndexMetadata` | Tags index |
|
|
58
|
-
| `teamIndexShared.tsx` | `generateTeamIndexPage`, `generateTeamIndexMetadata` | People index |
|
|
59
|
-
|
|
60
|
-
## Route Page Pattern
|
|
61
|
-
|
|
62
|
-
Each route page:
|
|
63
|
-
|
|
64
|
-
1. Exports `generateStaticParams() { return []; }` for dynamic routes
|
|
65
|
-
2. Defines `extractDetails(props)` to derive slug/path from params
|
|
66
|
-
3. Exports `generateMetadata(props, parent)` calling the shared metadata function
|
|
67
|
-
4. Exports default async function calling the shared page function
|
|
68
|
-
|
|
69
|
-
```typescript
|
|
70
|
-
import type { ResolvingMetadata } from 'next';
|
|
71
|
-
import { generatePage, generatePageMetadata } from '@/appShared/pageShared';
|
|
72
|
-
|
|
73
|
-
export function generateStaticParams() {
|
|
74
|
-
return [];
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
async function extractDetails(props: PageProps<'/[level1]'>) {
|
|
78
|
-
const params = await props.params;
|
|
79
|
-
const { level1 } = params;
|
|
80
|
-
return { slug: level1, path: `/${level1}/` };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
export async function generateMetadata(props: PageProps<'/[level1]'>, parent: ResolvingMetadata) {
|
|
84
|
-
const { slug, path } = await extractDetails(props);
|
|
85
|
-
return generatePageMetadata(slug, path, true, parent);
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
export default async function (props: PageProps<'/[level1]'>) {
|
|
89
|
-
const { slug, path } = await extractDetails(props);
|
|
90
|
-
return generatePage(slug, path, true);
|
|
91
|
-
}
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
For article routes, use `converterContext.urlCalculators.article`, `articleType`, `articleTypeTag` to compute the path. Import `converterContext` from `@/lib/converter-context` when that module exists (so route files don't pull in cms-server); otherwise from `@/lib/cms-server`.
|
|
95
|
-
|
|
96
|
-
## See Also
|
|
97
|
-
|
|
98
|
-
- **create-page** – Creating new pages and routes
|
|
99
|
-
- **lib-cms-structure** – lib directory layout
|