@se-studio/contentful-cms 2.4.0 → 2.5.1
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 +32 -0
- package/HOSTED.md +2 -2
- package/INSTALL.md +14 -136
- package/README.md +16 -40
- package/dist/bin/contentful-cms.js +2 -12
- package/dist/bin/contentful-cms.js.map +1 -1
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +10 -8
- package/dist/cli/program.js.map +1 -1
- package/dist/commands/article-tags-from-json.d.ts +4 -0
- package/dist/commands/article-tags-from-json.d.ts.map +1 -0
- package/dist/commands/article-tags-from-json.js +54 -0
- package/dist/commands/article-tags-from-json.js.map +1 -0
- package/dist/commands/bulk-rtf-replace.d.ts +4 -0
- package/dist/commands/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/commands/bulk-rtf-replace.js +103 -0
- package/dist/commands/bulk-rtf-replace.js.map +1 -0
- package/dist/commands/create-person-from-json.d.ts +4 -0
- package/dist/commands/create-person-from-json.d.ts.map +1 -0
- package/dist/commands/create-person-from-json.js +85 -0
- package/dist/commands/create-person-from-json.js.map +1 -0
- package/dist/commands/create-person.d.ts +4 -0
- package/dist/commands/create-person.d.ts.map +1 -0
- package/dist/commands/create-person.js +56 -0
- package/dist/commands/create-person.js.map +1 -0
- package/dist/commands/create-taxonomy-from-json.d.ts.map +1 -1
- package/dist/commands/create-taxonomy-from-json.js +47 -31
- package/dist/commands/create-taxonomy-from-json.js.map +1 -1
- package/dist/commands/create-taxonomy.d.ts +2 -0
- package/dist/commands/create-taxonomy.d.ts.map +1 -1
- package/dist/commands/create-taxonomy.js +7 -6
- package/dist/commands/create-taxonomy.js.map +1 -1
- package/dist/commands/ensure.d.ts.map +1 -1
- package/dist/commands/ensure.js +49 -0
- package/dist/commands/ensure.js.map +1 -1
- package/dist/commands/help.js +1 -1
- package/dist/commands/help.js.map +1 -1
- package/dist/commands/project.d.ts.map +1 -1
- package/dist/commands/project.js +35 -0
- package/dist/commands/project.js.map +1 -1
- package/dist/contentful/article-tags-from-json.d.ts +25 -0
- package/dist/contentful/article-tags-from-json.d.ts.map +1 -0
- package/dist/contentful/article-tags-from-json.js +121 -0
- package/dist/contentful/article-tags-from-json.js.map +1 -0
- package/dist/contentful/bulk-rtf-replace.d.ts +29 -0
- package/dist/contentful/bulk-rtf-replace.d.ts.map +1 -0
- package/dist/contentful/bulk-rtf-replace.js +119 -0
- package/dist/contentful/bulk-rtf-replace.js.map +1 -0
- package/dist/contentful/entry-fields.d.ts +1 -1
- package/dist/contentful/entry-fields.d.ts.map +1 -1
- package/dist/contentful/entry-fields.js +13 -0
- package/dist/contentful/entry-fields.js.map +1 -1
- package/dist/contentful/person-create.d.ts +31 -0
- package/dist/contentful/person-create.d.ts.map +1 -0
- package/dist/contentful/person-create.js +111 -0
- package/dist/contentful/person-create.js.map +1 -0
- package/dist/editor-pack/capabilities.d.ts +82 -0
- package/dist/editor-pack/capabilities.d.ts.map +1 -0
- package/dist/editor-pack/capabilities.js +350 -0
- package/dist/editor-pack/capabilities.js.map +1 -0
- package/dist/editor-pack/generate.d.ts.map +1 -1
- package/dist/editor-pack/generate.js +57 -15
- package/dist/editor-pack/generate.js.map +1 -1
- package/dist/generated/hosted-guide.d.ts +1 -1
- package/dist/generated/hosted-guide.d.ts.map +1 -1
- package/dist/generated/hosted-guide.js +1 -1
- package/dist/generated/hosted-guide.js.map +1 -1
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/hosted/customer-playbooks.d.ts.map +1 -1
- package/dist/hosted/customer-playbooks.js +3 -16
- package/dist/hosted/customer-playbooks.js.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js +1 -1
- package/dist/hosted/next/pages/CmsEditPage.js.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.d.ts.map +1 -1
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js +12 -3
- package/dist/hosted/next/pages/CustomerPlaybooksPage.js.map +1 -1
- package/dist/hosted/next/pages/HomePage.d.ts.map +1 -1
- package/dist/hosted/next/pages/HomePage.js +1 -1
- package/dist/hosted/next/pages/HomePage.js.map +1 -1
- package/dist/mcp/guide.d.ts +2 -2
- package/dist/mcp/guide.d.ts.map +1 -1
- package/dist/mcp/guide.js +10 -5
- package/dist/mcp/guide.js.map +1 -1
- package/dist/mcp/prompts/onboarding.d.ts.map +1 -1
- package/dist/mcp/prompts/onboarding.js +116 -2
- package/dist/mcp/prompts/onboarding.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/project/doctor.d.ts +9 -0
- package/dist/project/doctor.d.ts.map +1 -0
- package/dist/project/doctor.js +136 -0
- package/dist/project/doctor.js.map +1 -0
- package/docs/FUNCTIONAL_SPEC.md +1 -1
- package/docs/MEDIA_INDEX_PLAN.md +1 -1
- package/docs/SKILLS.md +3 -3
- package/docs/editor-tasks/article-tags.md +47 -0
- package/docs/editor-tasks/authors-import.md +53 -0
- package/docs/editor-tasks/bulk-find-replace.md +52 -0
- package/docs/editor-tasks/clone-page.md +39 -0
- package/docs/editor-tasks/create-article.md +46 -0
- package/docs/editor-tasks/create-from-document.md +45 -0
- package/docs/editor-tasks/create-page.md +41 -0
- package/docs/editor-tasks/edit-rich-text.md +44 -0
- package/docs/editor-tasks/edit-scalar-fields.md +47 -0
- package/docs/editor-tasks/featured-images.md +46 -0
- package/docs/editor-tasks/media-reuse-and-upload.md +51 -0
- package/docs/editor-tasks/navigation.md +39 -0
- package/docs/editor-tasks/preview-verify.md +38 -0
- package/docs/editor-tasks/publish-handoff.md +36 -0
- package/docs/editor-tasks/seo-descriptions.md +48 -0
- package/docs/editor-tasks/taxonomy.md +51 -0
- package/docs/help/article-tags-from-json.md +62 -0
- package/docs/help/bulk-rtf-replace.md +80 -0
- package/docs/help/index.md +16 -1
- package/docs/help/person-from-json.md +82 -0
- package/docs/mcp/hosted-guide.md +15 -4
- package/package.json +3 -5
- package/skills/README.md +1 -1
- package/skills/core/SKILL.md +7 -1
- package/skills/editor-tasks/SKILL.md +83 -0
- package/skills/manifest.json +2 -1
- package/skills/setup/SKILL.md +21 -87
- package/dist/bin/cms-edit-mcp.d.ts +0 -3
- package/dist/bin/cms-edit-mcp.d.ts.map +0 -1
- package/dist/bin/cms-edit-mcp.js +0 -15
- package/dist/bin/cms-edit-mcp.js.map +0 -1
- package/dist/bin/cms-edit-setup.d.ts +0 -3
- package/dist/bin/cms-edit-setup.d.ts.map +0 -1
- package/dist/bin/cms-edit-setup.js +0 -7
- package/dist/bin/cms-edit-setup.js.map +0 -1
- package/dist/setup/wizard.d.ts +0 -4
- package/dist/setup/wizard.d.ts.map +0 -1
- package/dist/setup/wizard.js +0 -260
- package/dist/setup/wizard.js.map +0 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
+
const TASKS_PREAMBLE = 'Start by reading customer playbooks: cms_edit ["customer", "tasks-index"]; ' +
|
|
3
|
+
'cms_edit ["customer", "capabilities"]; cms_edit ["customer", "checklist"].\n\n';
|
|
2
4
|
function hostedNote(hosted) {
|
|
3
5
|
if (!hosted) {
|
|
4
6
|
return 'Local MCP: use --space when multiple spaces are configured.';
|
|
@@ -19,7 +21,8 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
19
21
|
'Verify cms-edit is working:\n' +
|
|
20
22
|
'1. Call cms_edit_version\n' +
|
|
21
23
|
'2. Call cms_edit with args ["health"]\n' +
|
|
22
|
-
'3.
|
|
24
|
+
'3. cms_edit ["customer", "tasks-index"] and ["customer", "capabilities"] — confirm onboarding resources load\n' +
|
|
25
|
+
'4. Summarize version, health, and available task count for the user',
|
|
23
26
|
},
|
|
24
27
|
},
|
|
25
28
|
],
|
|
@@ -220,7 +223,8 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
220
223
|
text: `${note}\n\n` +
|
|
221
224
|
`Create page at slug "${slug}" from a freeform document.\n` +
|
|
222
225
|
`${titleLine}${docLine}\n` +
|
|
223
|
-
|
|
226
|
+
`${TASKS_PREAMBLE}` +
|
|
227
|
+
'1. cms_edit ["customer", "task-create-from-document"]; overview, routing, components-index\n' +
|
|
224
228
|
'2. Infer page structure: map sections to component types using components-index\n' +
|
|
225
229
|
'3. Propose a plain-English page plan (slug, title, template, components) — ask user to confirm\n' +
|
|
226
230
|
'4. Build create-from-json payload; run cms_edit ["create", "from-json", "--file", "<path>", "--dry-run", "--strict"]\n' +
|
|
@@ -265,5 +269,115 @@ export function registerOnboardingPrompts(server, hosted) {
|
|
|
265
269
|
],
|
|
266
270
|
};
|
|
267
271
|
});
|
|
272
|
+
server.prompt('cms_edit_bulk_seo', 'Update SEO meta descriptions: read task playbook, inventory pages, update description field.', {
|
|
273
|
+
instructions: z
|
|
274
|
+
.string()
|
|
275
|
+
.optional()
|
|
276
|
+
.describe('Optional scope, e.g. all pages or specific slugs'),
|
|
277
|
+
}, async ({ instructions }) => {
|
|
278
|
+
const scope = instructions ? `Scope: ${instructions}\n` : '';
|
|
279
|
+
return {
|
|
280
|
+
messages: [
|
|
281
|
+
{
|
|
282
|
+
role: 'user',
|
|
283
|
+
content: {
|
|
284
|
+
type: 'text',
|
|
285
|
+
text: `${note}\n\n${TASKS_PREAMBLE}${scope}` +
|
|
286
|
+
'Update SEO meta descriptions:\n' +
|
|
287
|
+
'1. cms_edit ["customer", "task-seo-descriptions"]\n' +
|
|
288
|
+
'2. cms_edit ["sitemap"] or list target slugs from user\n' +
|
|
289
|
+
'3. Per page/article: open → set @p0 description "…" → diff → save\n' +
|
|
290
|
+
'4. Or batch set when entry IDs are known\n' +
|
|
291
|
+
'Field name is **description** (not seoDescription). Show diff before every save.',
|
|
292
|
+
},
|
|
293
|
+
},
|
|
294
|
+
],
|
|
295
|
+
};
|
|
296
|
+
});
|
|
297
|
+
server.prompt('cms_edit_bulk_find_replace', 'Bulk find-replace in rich text across pages or articles.', {
|
|
298
|
+
find: z.string().describe('Text to find'),
|
|
299
|
+
replace: z.string().describe('Replacement text'),
|
|
300
|
+
instructions: z.string().optional().describe('Optional scope or entry list'),
|
|
301
|
+
}, async ({ find, replace, instructions }) => {
|
|
302
|
+
const scope = instructions ? `Scope: ${instructions}\n` : '';
|
|
303
|
+
return {
|
|
304
|
+
messages: [
|
|
305
|
+
{
|
|
306
|
+
role: 'user',
|
|
307
|
+
content: {
|
|
308
|
+
type: 'text',
|
|
309
|
+
text: `${note}\n\n${TASKS_PREAMBLE}${scope}` +
|
|
310
|
+
`Bulk find-replace: "${find}" → "${replace}"\n` +
|
|
311
|
+
'1. cms_edit ["customer", "task-bulk-find-replace"]\n' +
|
|
312
|
+
'2. cms_edit ["search", "<find>"] or sitemap — propose affected count; wait for user approval\n' +
|
|
313
|
+
'3. cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…", "--dry-run"] — confirm match count\n' +
|
|
314
|
+
'4. cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…"] — or per-entry open/rtf/diff/save for small sets\n' +
|
|
315
|
+
'5. Summarize entries updated',
|
|
316
|
+
},
|
|
317
|
+
},
|
|
318
|
+
],
|
|
319
|
+
};
|
|
320
|
+
});
|
|
321
|
+
server.prompt('cms_edit_bulk_article_tags', 'Update tags on one or more articles.', {
|
|
322
|
+
instructions: z
|
|
323
|
+
.string()
|
|
324
|
+
.describe('Article slugs and tag slugs to apply, or description of changes'),
|
|
325
|
+
}, async ({ instructions }) => ({
|
|
326
|
+
messages: [
|
|
327
|
+
{
|
|
328
|
+
role: 'user',
|
|
329
|
+
content: {
|
|
330
|
+
type: 'text',
|
|
331
|
+
text: `${note}\n\n${TASKS_PREAMBLE}User request: ${instructions}\n` +
|
|
332
|
+
'Update article tags:\n' +
|
|
333
|
+
'1. cms_edit ["customer", "task-article-tags"]\n' +
|
|
334
|
+
'2. cms_edit ["index", "sync"] — refresh tag catalog\n' +
|
|
335
|
+
'3. Batch: article-tags-from-json --file tags.json --dry-run → user confirms → apply\n' +
|
|
336
|
+
'4. Or per article: open --article-slug → set @p0 tags id1,id2 --links (or --append) → diff → save\n' +
|
|
337
|
+
'5. Confirm tag list with user before saving',
|
|
338
|
+
},
|
|
339
|
+
},
|
|
340
|
+
],
|
|
341
|
+
}));
|
|
342
|
+
server.prompt('cms_edit_import_authors', 'Create person/author entries from a list or spreadsheet.', {
|
|
343
|
+
instructions: z
|
|
344
|
+
.string()
|
|
345
|
+
.describe('Author rows (name, slug, jobTitle, bio) or sheet description'),
|
|
346
|
+
}, async ({ instructions }) => ({
|
|
347
|
+
messages: [
|
|
348
|
+
{
|
|
349
|
+
role: 'user',
|
|
350
|
+
content: {
|
|
351
|
+
type: 'text',
|
|
352
|
+
text: `${note}\n\n${TASKS_PREAMBLE}Author data:\n${instructions}\n` +
|
|
353
|
+
'Create authors (person entries):\n' +
|
|
354
|
+
'1. cms_edit ["customer", "task-authors-import"]\n' +
|
|
355
|
+
'2. cms_edit ["customer", "routing"] — people URL base if configured\n' +
|
|
356
|
+
'3. Batch: create person-from-json --file authors.json --dry-run → user confirms → --if-not-exists\n' +
|
|
357
|
+
'4. Or single: create person --slug … --name … --job-title … --bio-markdown …\n' +
|
|
358
|
+
'5. Link to articles with set @p0 authors <ids> --links if requested',
|
|
359
|
+
},
|
|
360
|
+
},
|
|
361
|
+
],
|
|
362
|
+
}));
|
|
363
|
+
server.prompt('cms_edit_media', 'Find existing assets or upload new ones (reuse-first workflow).', {
|
|
364
|
+
description: z.string().describe('What image or file is needed, e.g. filename or subject'),
|
|
365
|
+
}, async ({ description }) => ({
|
|
366
|
+
messages: [
|
|
367
|
+
{
|
|
368
|
+
role: 'user',
|
|
369
|
+
content: {
|
|
370
|
+
type: 'text',
|
|
371
|
+
text: `${note}\n\n${TASKS_PREAMBLE}Media need: ${description}\n` +
|
|
372
|
+
'Media — reuse and upload:\n' +
|
|
373
|
+
'1. cms_edit ["customer", "task-media-reuse-and-upload"]\n' +
|
|
374
|
+
'2. cms_edit ["index", "sync"]\n' +
|
|
375
|
+
'3. asset search / list --type media — report matches to user\n' +
|
|
376
|
+
'4. Only if no match: asset upload --if-exists-by-filename\n' +
|
|
377
|
+
'5. Link asset ID or filename to target entry field',
|
|
378
|
+
},
|
|
379
|
+
},
|
|
380
|
+
],
|
|
381
|
+
}));
|
|
268
382
|
}
|
|
269
383
|
//# sourceMappingURL=onboarding.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,SAAS,UAAU,CAAC,MAAsB;IACxC,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,6DAA6D,CAAC;IACvE,CAAC;IACD,MAAM,QAAQ,GAAG,MAAM,CAAC,WAAW,IAAI,MAAM,CAAC,UAAU,CAAC;IACzD,OAAO,CACL,yBAAyB,QAAQ,2CAA2C;QAC5E,0DAA0D,CAC3D,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAiB,EAAE,MAAsB;IACjF,MAAM,IAAI,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC;IAEhC,MAAM,CAAC,MAAM,CACX,iBAAiB,EACjB,oEAAoE,EACpE,KAAK,IAAI,EAAE,CAAC,CAAC;QACX,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EACF,GAAG,IAAI,MAAM;wBACb,+BAA+B;wBAC/B,4BAA4B;wBAC5B,yCAAyC;wBACzC,
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/mcp/prompts/onboarding.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,MAAM,cAAc,GAClB,6EA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AQ,CAAC,wDAAwD,CAAC;KAC3F,EACD,KAAK,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC;QAC1B,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAe;gBACrB,OAAO,EAAE;oBACP,IAAI,EAAE,MAAe;oBACrB,IAAI,EACF,GAAG,IAAI,OAAO,cAAc,eAAe,WAAW,IAAI;wBAC1D,6BAA6B;wBAC7B,2DAA2D;wBAC3D,iCAAiC;wBACjC,gEAAgE;wBAChE,6DAA6D;wBAC7D,oDAAoD;iBACvD;aACF;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
|
package/dist/mcp/server.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import type { RunCmsEditFn } from './types.js';
|
|
|
4
4
|
export type { HostedMcpInfo } from './guide.js';
|
|
5
5
|
export type { RunCmsEditFn } from './types.js';
|
|
6
6
|
export interface CreateMcpServerOptions {
|
|
7
|
-
/** Custom runner (in-process for hosted). Defaults to child-process spawn
|
|
7
|
+
/** Custom runner (in-process for hosted). Defaults to child-process spawn of cms-edit CLI. */
|
|
8
8
|
runCmsEdit?: RunCmsEditFn;
|
|
9
9
|
/** When set, guide and prompts include hosted-specific notes (site name, no --space). */
|
|
10
10
|
hosted?: HostedMcpInfo;
|
package/dist/mcp/server.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACrC,
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../../src/mcp/server.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAOhD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,MAAM,WAAW,sBAAsB;IACrC,8FAA8F;IAC9F,UAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,yFAAyF;IACzF,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,oFAAoF;IACpF,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,eAAe,CAAC,OAAO,GAAE,sBAA2B,GAAG,SAAS,CAa/E;AA8BD,sDAAsD;AACtD,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAIzE"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CmsEditProject } from './types.js';
|
|
2
|
+
export type DoctorSeverity = 'error' | 'warning' | 'info';
|
|
3
|
+
export interface DoctorFinding {
|
|
4
|
+
severity: DoctorSeverity;
|
|
5
|
+
code: string;
|
|
6
|
+
message: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function runProjectDoctor(configPath: string, project: CmsEditProject): DoctorFinding[];
|
|
9
|
+
//# sourceMappingURL=doctor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/project/doctor.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;AAE1D,MAAM,WAAW,aAAa;IAC5B,QAAQ,EAAE,cAAc,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAiDD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,cAAc,GAAG,aAAa,EAAE,CAkG7F"}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
import { loadEditorPackManifest } from '../editor-pack/load.js';
|
|
4
|
+
import { parseConstants } from '../editor-pack/parse-constants.js';
|
|
5
|
+
import { resolveRepoRoot, resolveWebsiteAppDir } from './load.js';
|
|
6
|
+
function findArticlesPlaybook(repoRoot, projectKey) {
|
|
7
|
+
const candidates = [
|
|
8
|
+
path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'ARTICLES.md'),
|
|
9
|
+
path.join(repoRoot, 'docs', 'cms-editor', 'ARTICLES.md'),
|
|
10
|
+
path.join(repoRoot, 'docs', 'cms-editor', projectKey, 'articles.md'),
|
|
11
|
+
path.join(repoRoot, 'docs', 'cms-editor', 'articles.md'),
|
|
12
|
+
];
|
|
13
|
+
return candidates.some((candidate) => fs.existsSync(candidate));
|
|
14
|
+
}
|
|
15
|
+
function siteHasArticles(appDir) {
|
|
16
|
+
const constants = parseConstants(appDir);
|
|
17
|
+
return Boolean(constants.articlesSlug || constants.articlesBase || constants.enableArticleTypeIndex === true);
|
|
18
|
+
}
|
|
19
|
+
function newestMtime(paths) {
|
|
20
|
+
let newest = null;
|
|
21
|
+
for (const filePath of paths) {
|
|
22
|
+
if (!fs.existsSync(filePath))
|
|
23
|
+
continue;
|
|
24
|
+
const mtime = fs.statSync(filePath).mtimeMs;
|
|
25
|
+
if (newest === null || mtime > newest)
|
|
26
|
+
newest = mtime;
|
|
27
|
+
}
|
|
28
|
+
return newest;
|
|
29
|
+
}
|
|
30
|
+
function collectGuidelineMtimes(repoRoot, appDir) {
|
|
31
|
+
const dirs = [
|
|
32
|
+
path.join(appDir, 'docs', 'cms-guidelines'),
|
|
33
|
+
path.join(repoRoot, 'docs', 'cms-guidelines'),
|
|
34
|
+
];
|
|
35
|
+
const files = [];
|
|
36
|
+
for (const dir of dirs) {
|
|
37
|
+
if (!fs.existsSync(dir))
|
|
38
|
+
continue;
|
|
39
|
+
const walk = (current) => {
|
|
40
|
+
for (const entry of fs.readdirSync(current, { withFileTypes: true })) {
|
|
41
|
+
const full = path.join(current, entry.name);
|
|
42
|
+
if (entry.isDirectory())
|
|
43
|
+
walk(full);
|
|
44
|
+
else if (entry.name.endsWith('.md'))
|
|
45
|
+
files.push(full);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
walk(dir);
|
|
49
|
+
}
|
|
50
|
+
return newestMtime(files);
|
|
51
|
+
}
|
|
52
|
+
export function runProjectDoctor(configPath, project) {
|
|
53
|
+
const findings = [];
|
|
54
|
+
const resolvedConfig = path.resolve(configPath);
|
|
55
|
+
const packDir = path.join(path.dirname(resolvedConfig), 'editor-pack');
|
|
56
|
+
if (!fs.existsSync(packDir)) {
|
|
57
|
+
findings.push({
|
|
58
|
+
severity: 'error',
|
|
59
|
+
code: 'pack_missing',
|
|
60
|
+
message: `editor-pack/ not found — run: cms-edit editor-pack generate --project-config ${resolvedConfig}`,
|
|
61
|
+
});
|
|
62
|
+
return findings;
|
|
63
|
+
}
|
|
64
|
+
const repoRoot = resolveRepoRoot(resolvedConfig, project.website.appDir);
|
|
65
|
+
const appDir = resolveWebsiteAppDir(resolvedConfig, project.website.appDir);
|
|
66
|
+
const manifest = loadEditorPackManifest(packDir);
|
|
67
|
+
if (!manifest) {
|
|
68
|
+
findings.push({
|
|
69
|
+
severity: 'error',
|
|
70
|
+
code: 'manifest_missing',
|
|
71
|
+
message: 'editor-pack/manifest.json is missing or invalid',
|
|
72
|
+
});
|
|
73
|
+
return findings;
|
|
74
|
+
}
|
|
75
|
+
const requiredPackFiles = ['capabilities.json', 'tasks-index.md', 'checklist.md'];
|
|
76
|
+
for (const file of requiredPackFiles) {
|
|
77
|
+
if (!fs.existsSync(path.join(packDir, file))) {
|
|
78
|
+
findings.push({
|
|
79
|
+
severity: 'error',
|
|
80
|
+
code: 'pack_stale',
|
|
81
|
+
message: `editor-pack/${file} missing — regenerate editor pack`,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
const articlesExpected = siteHasArticles(appDir) || findArticlesPlaybook(repoRoot, project.projectKey);
|
|
86
|
+
if (articlesExpected && !findArticlesPlaybook(repoRoot, project.projectKey)) {
|
|
87
|
+
findings.push({
|
|
88
|
+
severity: 'warning',
|
|
89
|
+
code: 'articles_playbook_missing',
|
|
90
|
+
message: `Site appears to have articles but docs/cms-editor/${project.projectKey}/articles.md is missing`,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (articlesExpected && !manifest.resources.includes('articles')) {
|
|
94
|
+
findings.push({
|
|
95
|
+
severity: 'warning',
|
|
96
|
+
code: 'pack_articles_missing',
|
|
97
|
+
message: 'editor-pack has no articles.md — regenerate after adding articles playbook',
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
const routingPath = path.join(packDir, 'routing.md');
|
|
101
|
+
if (fs.existsSync(routingPath)) {
|
|
102
|
+
const routing = fs.readFileSync(routingPath, 'utf8');
|
|
103
|
+
if (!routing.includes('## Article paths') ||
|
|
104
|
+
routing.split('## Article paths')[1]?.trim().length === 0) {
|
|
105
|
+
findings.push({
|
|
106
|
+
severity: 'info',
|
|
107
|
+
code: 'routing_sparse',
|
|
108
|
+
message: 'editor-pack/routing.md has sparse article paths — regenerate from constants.ts',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
const packGeneratedAt = manifest.generatedAt ? Date.parse(manifest.generatedAt) : Number.NaN;
|
|
113
|
+
const guidelineMtime = collectGuidelineMtimes(repoRoot, appDir);
|
|
114
|
+
if (Number.isFinite(packGeneratedAt) &&
|
|
115
|
+
guidelineMtime !== null &&
|
|
116
|
+
guidelineMtime > packGeneratedAt) {
|
|
117
|
+
findings.push({
|
|
118
|
+
severity: 'warning',
|
|
119
|
+
code: 'pack_stale_guidelines',
|
|
120
|
+
message: 'CMS guidelines changed after editor-pack was generated — regenerate editor pack',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const constantsPath = path.join(appDir, 'src', 'lib', 'constants.ts');
|
|
124
|
+
if (fs.existsSync(constantsPath)) {
|
|
125
|
+
const constantsMtime = fs.statSync(constantsPath).mtimeMs;
|
|
126
|
+
if (Number.isFinite(packGeneratedAt) && constantsMtime > packGeneratedAt) {
|
|
127
|
+
findings.push({
|
|
128
|
+
severity: 'warning',
|
|
129
|
+
code: 'pack_stale_constants',
|
|
130
|
+
message: 'constants.ts changed after editor-pack was generated — regenerate editor pack',
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return findings;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/project/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC;AAWlE,SAAS,oBAAoB,CAAC,QAAgB,EAAE,UAAkB;IAChE,MAAM,UAAU,GAAG;QACjB,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,CAAC;QACpE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,EAAE,YAAY,EAAE,aAAa,CAA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c,CAAC,CAAC;IACtE,IAAI,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACjC,MAAM,cAAc,GAAG,EAAE,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC;QAC1D,IAAI,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,IAAI,cAAc,GAAG,eAAe,EAAE,CAAC;YACzE,QAAQ,CAAC,IAAI,CAAC;gBACZ,QAAQ,EAAE,SAAS;gBACnB,IAAI,EAAE,sBAAsB;gBAC5B,OAAO,EAAE,+EAA+E;aACzF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
package/docs/FUNCTIONAL_SPEC.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**CLI binary (`cms-edit`)** — invoked with subcommands and arguments from a terminal or shell script.
|
|
12
12
|
|
|
13
|
-
**MCP server
|
|
13
|
+
**Hosted MCP server** — deployed per site at `/api/mcp` (OAuth). Exposes `cms_edit`, `cms_edit_help`, `cms_edit_customer`, guide/customer resources, and onboarding prompts. Local stdio MCP is not supported; IDE/terminal agents use the `cms-edit` CLI directly.
|
|
14
14
|
|
|
15
15
|
---
|
|
16
16
|
|
package/docs/MEDIA_INDEX_PLAN.md
CHANGED
|
@@ -142,7 +142,7 @@ const deliveryToken = key.accessToken; // CDA
|
|
|
142
142
|
|
|
143
143
|
| Topic | Guidance |
|
|
144
144
|
|-------|----------|
|
|
145
|
-
| Permissions | PAT needs rights to read (and optionally create) space API keys; document in setup
|
|
145
|
+
| Permissions | PAT needs rights to read (and optionally create) space API keys; document in hosted/CLI setup guides |
|
|
146
146
|
| Multiple keys | Never “first key in list” without environment/name filter |
|
|
147
147
|
| Propagation | New keys may 401 for a few seconds after create — retry with backoff |
|
|
148
148
|
| Secrets | Do not log `accessToken`; store only `cdaTokenHash` + `apiKeyId` in index `meta` |
|
package/docs/SKILLS.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
| Channel | Package | Install | Use case |
|
|
6
6
|
|---------|---------|---------|----------|
|
|
7
7
|
| **Full SE Studio skills** | `@se-studio/skills` | `npx skills add @se-studio/skills`, `pnpm skills:sync` in monorepo, or auto-sync via `prepare` in consumer sites (see `packages/project-build/README.md`) | Marketing sites, CMS guidelines, app tasks |
|
|
8
|
-
| **Bundled cms-edit skills** | `@se-studio/contentful-cms` | `cms-edit skill install` | Minimal set shipped with the CLI (`core`, `templates`, `setup`) |
|
|
8
|
+
| **Bundled cms-edit skills** | `@se-studio/contentful-cms` | `cms-edit skill install` | Minimal set shipped with the CLI (`core`, `editor-tasks`, `templates`, `setup`) |
|
|
9
9
|
|
|
10
10
|
## Where to edit
|
|
11
11
|
|
|
@@ -24,6 +24,6 @@ Never edit:
|
|
|
24
24
|
- **`.agents/skills/`** — Monorepo target for `pnpm skills:sync`; gitignored; symlinked to `.cursor/skills/`.
|
|
25
25
|
- **`.claude/skills/`** — Optional per-machine path used by some Claude setups; **intentionally untracked**. Skills should come from this repo (`@se-studio/skills`, `cms-edit skill install`) or third-party skill packs — not from committed copies under `.claude/`.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Installing bundled skills
|
|
28
28
|
|
|
29
|
-
`cms-edit
|
|
29
|
+
`cms-edit skill install` copies bundled `core`, `editor-tasks`, and `templates` skills into `.agents/skills/` in the current project. In the monorepo, prefer `pnpm skills:sync` from `@se-studio/skills`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Capability: Article tags
|
|
2
|
+
|
|
3
|
+
## Intent phrases
|
|
4
|
+
|
|
5
|
+
- update article tags
|
|
6
|
+
- retag articles
|
|
7
|
+
- add tags to blog posts
|
|
8
|
+
|
|
9
|
+
## Requires capabilities
|
|
10
|
+
|
|
11
|
+
`articles` and `tags`
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- `cms_edit ["index", "sync"]`
|
|
16
|
+
- Resolve tag IDs: `resolve --tag-slug <slug> --tag-type-slug <type>` or `list --type tag`
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
**Batch (many articles):**
|
|
21
|
+
|
|
22
|
+
1. Build `tags.json` with an `articles` array (see `cms-edit help article-tags-from-json`)
|
|
23
|
+
2. `cms_edit ["article-tags-from-json", "--file", "tags.json", "--dry-run"]`
|
|
24
|
+
3. User confirms tag slugs per article
|
|
25
|
+
4. `cms_edit ["article-tags-from-json", "--file", "tags.json"]`
|
|
26
|
+
|
|
27
|
+
**Single article (session):**
|
|
28
|
+
|
|
29
|
+
1. `cms_edit ["open", "--article-slug", "<slug>"]`
|
|
30
|
+
2. `cms_edit ["set", "@p0", "tags", "<id1>,<id2>", "--links"]` (or `--append`)
|
|
31
|
+
3. `cms_edit ["diff"]` → `cms_edit ["save"]`
|
|
32
|
+
|
|
33
|
+
## Confirmation gates
|
|
34
|
+
|
|
35
|
+
1. List target articles and tag slugs — user confirms
|
|
36
|
+
2. `diff` before each `save` when using sessions
|
|
37
|
+
|
|
38
|
+
## Out of scope
|
|
39
|
+
|
|
40
|
+
- Publish
|
|
41
|
+
- Creating new tags (see **Taxonomy** capability first)
|
|
42
|
+
|
|
43
|
+
## Related resources
|
|
44
|
+
|
|
45
|
+
- `cms-edit://customer/articles`
|
|
46
|
+
- `task-taxonomy`
|
|
47
|
+
- `cms-edit help article-tags-from-json`
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Capability: Authors (person entries)
|
|
2
|
+
|
|
3
|
+
## Intent phrases
|
|
4
|
+
|
|
5
|
+
- create authors
|
|
6
|
+
- import people from spreadsheet
|
|
7
|
+
- add team members to CMS
|
|
8
|
+
|
|
9
|
+
## Requires capabilities
|
|
10
|
+
|
|
11
|
+
`persons`
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- `cms_edit ["index", "sync"]` if linking to articles
|
|
16
|
+
- Convert spreadsheet to a structured list (name, slug, jobTitle, bio, email)
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
**Batch import (recommended):**
|
|
21
|
+
|
|
22
|
+
1. Build `authors.json` with a `persons` array (see `cms-edit help person-from-json`)
|
|
23
|
+
2. `cms_edit ["create", "person-from-json", "--file", "authors.json", "--dry-run"]`
|
|
24
|
+
3. User confirms the list
|
|
25
|
+
4. `cms_edit ["create", "person-from-json", "--file", "authors.json", "--if-not-exists"]`
|
|
26
|
+
|
|
27
|
+
**Single person:**
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
cms_edit ["create", "person", "--slug", "<slug>", "--name", "<name>", "--job-title", "…", "--bio-markdown", "…"]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
**Link to articles:**
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
cms_edit ["open", "--article-slug", "<slug>"]
|
|
37
|
+
cms_edit ["set", "@p0", "authors", "<personId1>,<personId2>", "--links"]
|
|
38
|
+
cms_edit ["diff"] → cms_edit ["save"]
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Confirmation gates
|
|
42
|
+
|
|
43
|
+
1. Show person list from spreadsheet — user confirms
|
|
44
|
+
2. `diff` before `save` when using sessions
|
|
45
|
+
|
|
46
|
+
## Out of scope
|
|
47
|
+
|
|
48
|
+
- Publish
|
|
49
|
+
|
|
50
|
+
## Related resources
|
|
51
|
+
|
|
52
|
+
- `cms-edit://customer/routing` (people URL base if configured)
|
|
53
|
+
- `cms-edit help person-from-json`
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Capability: Bulk find-replace in rich text
|
|
2
|
+
|
|
3
|
+
## Intent phrases
|
|
4
|
+
|
|
5
|
+
- find and replace across pages
|
|
6
|
+
- change text sitewide in body copy
|
|
7
|
+
- update legal boilerplate everywhere
|
|
8
|
+
|
|
9
|
+
## Requires capabilities
|
|
10
|
+
|
|
11
|
+
`bulkRtfFindReplace`
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- `cms_edit ["index", "sync"]` if catalog may be stale
|
|
16
|
+
- `cms_edit ["sitemap"]` or `cms_edit ["search", "<find text>"]` to list affected entries
|
|
17
|
+
- Read `cms-edit://customer/routing` for slug rules
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
1. **Discover scope** — `search` or `sitemap`; propose affected page/article count to the user
|
|
22
|
+
2. **Dry-run bulk replace:**
|
|
23
|
+
```
|
|
24
|
+
cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…", "--dry-run"]
|
|
25
|
+
```
|
|
26
|
+
Optional: `--include article`, `--prefix resources/blog`
|
|
27
|
+
3. **User approves** find/replace text and match count
|
|
28
|
+
4. **Apply:**
|
|
29
|
+
```
|
|
30
|
+
cms_edit ["bulk-rtf-replace", "--find", "…", "--replace-plain", "…"]
|
|
31
|
+
```
|
|
32
|
+
5. Summarize how many entries were updated
|
|
33
|
+
|
|
34
|
+
For a **small** number of entries, or when per-entry `diff` is required, use session workflow: `open` → `rtf replace` → `diff` → `save`.
|
|
35
|
+
|
|
36
|
+
For scalar fields on many entries (when the field exists on this schema), prefer `batch set` with entry IDs.
|
|
37
|
+
|
|
38
|
+
## Confirmation gates
|
|
39
|
+
|
|
40
|
+
1. Propose find/replace text and affected entry count — **wait for user approval**
|
|
41
|
+
2. Dry-run before apply
|
|
42
|
+
3. Report summary when complete
|
|
43
|
+
|
|
44
|
+
## Out of scope
|
|
45
|
+
|
|
46
|
+
- Publish
|
|
47
|
+
|
|
48
|
+
## Related resources
|
|
49
|
+
|
|
50
|
+
- `cms-edit://customer/capabilities`
|
|
51
|
+
- `cms-edit://customer/site-facts` (if present — canonical values to apply)
|
|
52
|
+
- `cms-edit help bulk-rtf-replace`
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Capability: Clone page structure
|
|
2
|
+
|
|
3
|
+
## Intent phrases
|
|
4
|
+
|
|
5
|
+
- copy page layout
|
|
6
|
+
- duplicate page structure
|
|
7
|
+
- use existing page as template
|
|
8
|
+
|
|
9
|
+
## Requires capabilities
|
|
10
|
+
|
|
11
|
+
`pages`
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Identify source page slug and target slug/title
|
|
16
|
+
- Read `cms-edit://customer/components-index`
|
|
17
|
+
|
|
18
|
+
## Steps
|
|
19
|
+
|
|
20
|
+
1. `cms_edit ["open", "--page-slug", "<source-slug>"]`
|
|
21
|
+
2. `cms_edit ["snapshot"]` — note template and component tree
|
|
22
|
+
3. `cms_edit ["list", "--type", "template"]` — confirm template ID
|
|
23
|
+
4. Build `create from-json` payload mirroring structure with new slug/title
|
|
24
|
+
5. `create from-json --dry-run --strict` → create → `save`
|
|
25
|
+
6. Adjust copy/fields on the new page
|
|
26
|
+
|
|
27
|
+
## Confirmation gates
|
|
28
|
+
|
|
29
|
+
1. Confirm source page, new slug, and title
|
|
30
|
+
2. `--dry-run --strict` before create
|
|
31
|
+
|
|
32
|
+
## Out of scope
|
|
33
|
+
|
|
34
|
+
- Publish
|
|
35
|
+
|
|
36
|
+
## Related resources
|
|
37
|
+
|
|
38
|
+
- `cms-edit://customer/components-index`
|
|
39
|
+
- `task-create-page`
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Capability: Create an article
|
|
2
|
+
|
|
3
|
+
## Intent phrases
|
|
4
|
+
|
|
5
|
+
- create a blog post
|
|
6
|
+
- new article
|
|
7
|
+
- add publication
|
|
8
|
+
|
|
9
|
+
## Requires capabilities
|
|
10
|
+
|
|
11
|
+
`articles`
|
|
12
|
+
|
|
13
|
+
## Prerequisites
|
|
14
|
+
|
|
15
|
+
- Read `cms-edit://customer/articles`, `defaults`, `routing`, `components-index`
|
|
16
|
+
- `cms_edit ["index", "sync"]`
|
|
17
|
+
- `cms_edit ["list", "--type", "articleType"]` — every article needs an article type
|
|
18
|
+
|
|
19
|
+
## Steps
|
|
20
|
+
|
|
21
|
+
1. Resolve article type slug/name
|
|
22
|
+
2. Ask about custom featured image; otherwise apply `defaults` inheritance rules
|
|
23
|
+
3. Build `create from-json` payload (article + components from articles playbook)
|
|
24
|
+
4. `cms_edit ["create", "from-json", "--file", "<path>", "--dry-run", "--strict"]`
|
|
25
|
+
5. On approval, create and `save`
|
|
26
|
+
|
|
27
|
+
Or minimal shell:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
cms_edit ["create", "article", "--slug", "<slug>", "--title", "<title>", "--article-type-slug", "<type>"]
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Confirmation gates
|
|
34
|
+
|
|
35
|
+
1. Confirm slug, title, article type, featured image choice
|
|
36
|
+
2. `--dry-run --strict` before create
|
|
37
|
+
3. `diff` before `save`
|
|
38
|
+
|
|
39
|
+
## Out of scope
|
|
40
|
+
|
|
41
|
+
- Publish
|
|
42
|
+
|
|
43
|
+
## Related resources
|
|
44
|
+
|
|
45
|
+
- `cms-edit://customer/articles`
|
|
46
|
+
- `cms-edit://customer/defaults`
|