Skip to content

forcedotcom/sf-skills / plugins/builder/experience-cms/skills/experience-cms-content-generate

experience-cms-content-generate

Verified

Creates, edits, and publishes Salesforce CMS content of any kind — any domain, any topic. Single and bulk: create many in parallel, edit one or many, publish all or a subset. Use this skill ANY TIME a user asks to create, generate, write, draft, author, or add content, OR to update, edit, or revise a content record, OR to publish it, OR to delete/remove a content record. Triggers like "create a <thing> about X", "create 5 <things>", "update content <id>", "publish content <id>", "publish the record <id>", "make <id> live", "delete content <id>" — where <thing> is any user-named content type. Activates FIRST whenever content authoring, editing, publishing, or deletion is mentioned, regardless of subject. Handles the full workflow: finding the content type, resolving the workspace, creating content, editing or publishing it — including a record identified by its variantId. Does not apply to defining a content type / schema (use experience-cms-content-type-generate), cloning, versioning, workspaces, or media.

references/principles.md

View on GitHub
# Key Principles — full elaboration

The SKILL.md "Key Principles" list is the compressed index of these invariants; the operational detail also lives in each Step body. This file holds the long form for reference.

1. **Follow the workflow in order** — sequential steps. Step 1 silent parse; Step 2 fast-path (FQN in prompt) or sibling delegation; Step 3 workspace only after `contentTypeFqn` is captured. Asking workspace before Step 2, clarifying content type before Step 2, or delegating when an FQN was already provided are all documented failure modes.
2. **Dispatch is the work** — every successful run ends with `create_cms_content` returning a managed content record. Drafting content as chat prose without persisting is a bug.
3. **Server-side generation only** — both `create_cms_content` and `update_cms_content_variant` run on the `prompt` channel; the server generates + validates the body. The agent generates only the title (and re-emits it on edit only when the edit targets the title). The agent does NOT walk a schema, does NOT assemble `contentBody`, does NOT pre-validate client-side, and does NOT regenerate rejected fields client-side. `prompt` and `contentBody` are mutually exclusive — never send both.
4. **User goal verbatim as `prompt`** — pass the user's message (or approved topic prompt / edit instruction) to the tool as `prompt` unmodified. Do not paraphrase or trim.
5. **Sibling owns content type on the delegation path — route strictly on `status`** — `experience-cms-content-type-generate` is a black box. This skill consumes `{ status, fqn, message }`; the sibling may also emit `schema` but this skill ignores it. Only `success` continues; `not_deployed` / `cancelled` / `error` STOP with the sibling's `message` printed verbatim. On `success`, validate FQN format (Step 2c). Never call `metadata-grounding` yourself, re-present candidates, or construct FQNs from folder names. A `not_deployed` type is local-only and NOT dispatchable — do NOT proceed to Step 3 or try a guessed FQN ("the FQN is predictable, I'll just try" IS the bug); `create_cms_content` would fail `INVALID_TYPE`. (N/A on Buckets 1/2/3 — no sibling call.)
6. **Workspace from user or UIBundle** — `contentSpaceOrFolderId` comes from a user-selected local UIBundle (resolved via `get_or_create_cms_workspace_and_web_app_channel`) or a manually provided ID. **Never silently infer, never run SOQL / `sf data query` to discover spaces** — always present the UIBundle options and manual fallback, then let the user choose.
7. **Cancel terminates immediately** — a user `cancel` / `no` / `stop` / `End session` ends the workflow. Do not dispatch after a cancel.
8. **Consistent display format** — same table format after create and after edit; never switch mid-session.
9. **Track session content registry** — maintain `{title, managedContentId, managedContentVariantId, contentKey, publishStatus, index}` for every item created or edited. `publishStatus` starts as `draft` at create time and flips to `published` when Step 9c confirms the item was published server-side. The variant ID is stable across edits (versions bump, variants do not) — the same `managedContentVariantId` from `create_cms_content` remains valid for all subsequent `update_cms_content_variant` calls. Step 10's render handoff filters on `publishStatus=published`.
10. **Post-action loop is mandatory** — after every successful create or edit, display the content body and ask: Edit / Publish / End session. Never skip or auto-publish.
11. **Bulk = one call per item, in parallel — HARD RULE** — every `create_cms_content` call carries a 1-element `inputs` array; for N items, dispatch N parallel calls in a single turn. Do NOT combine items into a single `inputs` array (not even for N=2), do NOT serialize (dispatch-then-await-then-dispatch defeats parallelism), do NOT re-batch on retry. Same shape for `update_cms_content_variant`. Tool schema-prep happens silently — never narrate "Let me load the content creation tool".
12. **Publish defaults to all** — unless the user requests a subset, publish all items in the registry.
13. **Route the intent FIRST (Step 0)** — update / edit / publish / delete are first-class entry points, not only create-flow tails. When the user opens with one of those verbs, route at Step 0 and follow the named path. UPDATE-by-id enters at Step 8c, PUBLISH-by-id at Step 9b (skipping Steps 1–5, no type/workspace resolution, no render prompt). DELETE is a hard stop — no delete tool exists. Editing/publishing is NOT session-only — a record from a prior session or another user is in scope, but ONLY when an identifier is available (session registry OR a user-typed `MC…`/`20Y…`/`9Ps`). When the user names content by title/subject with no ID and nothing in the registry matches, STOP and ask for the identifier — you may NOT search the org to find it by name (no `search_content`, `get_spaces`, `get_content_types_for_workspace`, other discovery/listing tool, SOQL, or `sf data query`). Freelancing (picking tools by intuition, or hunting for the record by name, on an update/publish/delete open) is the bug this step prevents.
14. **No-drift STOP — never fall back** — if the required `content-write` tool for the route is unavailable (`update_cms_content_variant` / `publish_content` / `create_cms_content`), or the operation is unsupported (delete), STOP and print the actionable user-facing message (see Step 0 no-drift rule / Step 0-D). The message MAY name the CMS `content-write` service/server, the specific tool the step needs, and the fix (connect it + re-run) — that's what lets the user self-serve. It must NOT quote "the hard stop rule" or enumerate the rejected fallbacks. Never substitute SOQL, `sf data`, a CLI call, a sibling tool, or the `contentBody` channel. **Identifier handling:** when the user supplies any content identifier for update or publish, classify it by prefix and validate + resolve it to a `managedContentVariantId` via the matching `content-readonly` read tool before touching the write tool — `9Ps` (variant ID) → `get_content_variant` (param `variantId`); content key `MC…` or `managedContentId` `20Y…` → `get_content`. `get_content` does NOT accept a variant ID (a `9Ps` returns `INVALID_ID_FIELD`), so route `9Ps` values only to `get_content_variant`. Pass the resolved `managedContentVariantId` to `update_cms_content_variant` / `publish_content`. If the read fails, the ID is invalid — STOP and tell the user; never publish/edit an unvalidated ID. Never resolve via SOQL/CLI. If the required read tool is unavailable, apply this STOP rule; if the prefix matches no known form, ask the user for a valid identifier — do NOT guess.
15. **Type-class-unsupported is a hard stop** — when `create_cms_content` / `update_cms_content_variant` returns `UNKNOWN_EXCEPTION` "Content generation is not supported for content type '<fqn>' (type class: '<class>')" (e.g. `sfdc_cms__media` — covers `sfdc_cms__image`, `sfdc_cms__video`, and other media-class types), the type class itself cannot be authored via this tool on any org / workspace / prompt. This is a fixed capability limit, not a per-request, per-org, or per-workspace problem. This fires ONLY on the actual server error — never pre-empt it by guessing a type class from the prompt (dispatch `create_cms_content` normally; let the server return the error). Print the fixed message from `references/error-recovery.md` **verbatim, nothing else** — no retry prompt, no rewording, no preamble, no delegating to the type-generate sibling (this is not a type-discovery or schema gap), no swapping FQNs, and never propose a direct-API / hand-built `contentBody` workaround (that violates Principle 3 worse than the original error). Then end the turn.
reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis.Stars: 471kUpdated Claude CodeCodexVerifiedInstall
diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness.Stars: 322kUpdated Claude CodeCodexVerifiedInstall
dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependenciesStars: 322kUpdated Claude CodeCodexVerifiedInstall
executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is availableStars: 322kUpdated Claude CodeCodexVerifiedInstall