name: strapi-cms-publisher
description: 'Use when the user asks to "publish a markdown article to Strapi", "upload content to Strapi CMS", or "sync SEO content, schema, tags, categories, and media into Strapi draft". Maps local article bundles into a fixed Strapi Article/SEO/slug/source model, rewrites internal links and image URLs, and creates or updates draft entries only after a single explicit review and confirmation step. Use seo-content-writer, meta-tags-optimizer, or schema-markup-generator to generate the content itself.'
version: "9.2.0"
license: Apache-2.0
compatibility: "Claude Code, skills.sh, ClawHub, Vercel Labs, Cursor, Windsurf, Codex CLI, Amp, Gemini CLI, Kimi Code, Qwen Code, CodeBuddy"
homepage: "https://github.com/aaron-he-zhu/seo-geo-claude-skills"
when_to_use: "Use when publishing finalized markdown articles, inline or sidecar JSON-LD schema, tags, categories, and media into a fixed Strapi CMS model as draft entries. Also when the user asks to sync article updates, rewrite internal links, or upload article images before saving a draft."
argument-hint: "
Strapi CMS Publisher
This skill publishes finalized Markdown article bundles into an already-adapted Strapi model. It extracts inline and sidecar JSON-LD, resolves taxonomy and article state, uploads linked images, rewrites internal article links, creates missing tags as published entries, and stages all writes behind a single confirmation step.
What This Skill Does
Converts local Markdown, JSON-LD, and image assets into Strapi Article, shared.seo, shared.slug, shared.source, category, and tag records with draft article/category saves, published tag creation, and read-back verification.
Quick Start
Start with one of these prompts. Finish with a short handoff summary using the repository format in Skill Contract.
Single Article Draft Sync
Publish build-ready article vendors/cms-server-1/example.md to Strapi draft
Article + Sidecar Schema
Upload this markdown article and its JSON-LD sidecar to Strapi CMS draft,
create missing tags only after review
Update Existing Draft
Sync this article update to Strapi draft, rewrite local links, upload images,
and ask before updating the existing entry
Skill Contract
Expected output: a ready-to-run draft publish plan or a confirmed draft write summary plus a short handoff summary ready for memory/content/.
- Reads: article Markdown, optional sidecar JSON-LD files, linked local or remote images, fixed CMS mapping rules, and prior decisions from CLAUDE.md and State Model when available.
- Writes: Strapi draft entries, media uploads, category and tag relations, and a reusable publish summary.
- Promotes: missing taxonomy inputs, unresolved internal links, image upload blockers, and update confirmations to
memory/hot-cache.md,memory/decisions.md, andmemory/open-loops.md. - Next handoff: use the
Next Best Skillbelow when the draft needs rendered-page review.
Handoff Summary
Emit the standard shape from skill-contract.md §Handoff Summary Format.
Preconditions
- The Strapi content model is already adapted and fixed for this skill; do not spend runtime budget querying content type or component schema again unless the user explicitly says the model changed.
- Use the fixed REST endpoints directly on normal runs:
GET/POST/PUT /api/articles,GET/POST /api/categories,GET/POST /api/tags, andPOST /api/uploadfor media. - Keep article and category writes draft only. Create missing tags as published entries after approval. Never publish articles automatically.
- Rewrite local article links as
/article/{articleSlug}. ResolvearticleSlugfrom the linked article's frontmatterslugwhenever the target is a local Markdown article; do not assume the filename stem is the publish slug. Do not prepend a base URL or keep category segments in rewritten internal links. - If the connected runtime lacks Strapi write access, still produce the dry-run plan and confirmation summary.
- Parse article frontmatter using the fixed field names in references/frontmatter-contract.md.
Available Scripts
scripts/generate-content-hash.sh— Script under thisstrapi-cms-publisherskill directory; generatessource.contentHashfromtitle,description, and the original Markdown file bytes
Instructions
When a user requests Strapi publishing, run these eight steps in order:
- Confirm Publish Scope — gather article path(s), optional sidecar schema path(s), Strapi server alias, batch vs. single-entry mode, and whether updates or taxonomy creation are allowed after review.
- Parse the Article Bundle — read frontmatter using the fixed contract, read Markdown body, extract every
<script type="application/ld+json">block, load any sidecar JSON-LD files, and remove extracted script blocks from the Markdown that will be sent toArticle.content.
- Sanitize the body before upload — remove any
#(H1) heading line from the body before savingArticle.content, and reject unresolved screenshot placeholder lines matching> [截图占位符:or> [Screenshot Placeholder:with file/line references. Seereferences/publish-workflow.md§Body Sanitization.
Normalize CMS Fields — map the content bundle into the fixed Article payload (
title,description,content,slug.label,seo,source). Computesource.contentHashby runningscripts/generate-content-hash.shfrom this skill directory, withtitle,description, and the original article Markdown file path as--content-file, without preprocessing the file content. LeavecanonicalURLandopenGraph.ogUrlempty when only relative paths are available. Do not setsource.releaseAt.scripts/generate-content-hash.sh \ --title "$TITLE" \ --description "$DESCRIPTION" \ --content-file "$ARTICLE_MARKDOWN_FILE"Rewrite Internal Links and Images — resolve local article links against the linked Markdown file, read the target frontmatter
slug, rewrite links into/article/{articleSlug}, preserve anchors, upload local and remote images to Strapi media, and replace Markdown image URLs with the returned media URLs. Do not spend runtime budget checking whether the linked article already exists in Strapi before rewriting the URL. If the linked article cannot be read or has no frontmatterslug, treat it as an unresolved reference for the confirmation summary instead of blindly using the filename stem.Resolve Taxonomy and Article State — use
/api/categories,/api/tags, and/api/articlesdirectly to look up existing category, tag, and article records before writing. Stage missing categories as draft creates, stage missing tags as published creates, and stage article writes ascreateorupdatebased onslug.label. If a missing category only has a slug and no clear display name, stop and ask before confirmation.Present a Single Confirmation Summary — show article creates, article updates, pending draft category creates, pending published tag creates, media uploads, and unresolved references. No write operation is allowed before explicit user approval.
Execute Draft Writes — after approval, create missing draft categories via
/api/categories, create missing published tags via/api/tags, upload media via/api/upload, then create or update the draft article entry via/api/articlesand attach the resolved relations and media-backed Markdown.Read Back and Emit Handoff — fetch the saved draft, verify core fields (
title,slug,content,seo.structuredData, taxonomy, image URLs), and output a handoff summary plus any remaining blockers.
Reference: See references/publish-workflow.md for the fixed endpoint map, field map, schema merge rules, internal-link algorithm, image handling notes, and confirmation matrix.
Example
User: "Publish vendors/cms-server-1/heyue-he-xianhuo-nage-fengxian-da.md to Strapi draft and create missing tags only after review"
Output (abbreviated):
- Dry-run summary: 1 article update or create candidate, 1 category lookup, 5 tag lookups, 0-1 tag creates, N image uploads, 2 internal link rewrites
- Payload plan:
title,description, Markdowncontent, mergedseo.structuredData,slug.label,source.contentHashfromscripts/generate-content-hash.sh, taxonomy document IDs - Confirmation gate: one approval covering draft category creates, published tag creates, article draft write, and media uploads
- Read-back result: saved draft
documentId, preserved Markdown, uploaded media URLs substituted, unresolved links listed if any
Decision Rules
- Schema merge: combine inline JSON-LD blocks with sidecar JSON-LD, de-duplicate by semantic identity, and prefer sidecar values on direct conflicts.
- Article updates: always ask before overwriting an existing article matched by
slug.label. - Taxonomy creation: batch all missing categories and tags into one approval prompt before creating them; create categories as drafts and tags as published entries.
- Image handling: remote image URLs are downloaded to temporary local storage before upload; local images are uploaded directly; temporary downloads are deleted after upload.
Save Results
On user confirmation, save a dated summary to memory/content/YYYY-MM-DD-<topic>.md and promote key publish decisions or blockers to memory/hot-cache.md.
Reference Materials
- Publish Workflow — Fixed endpoint map, field mapping, schema merge rules, internal-link algorithm, media upload notes, and confirmation matrix
- Frontmatter Contract — Fixed field names for category, tags, image inputs, and SEO overrides
- Content Hash Script — Local script in this skill directory (
scripts/) for generatingsource.contentHash
Next Best Skill
- Primary: on-page-seo-auditor — audit the rendered draft once the CMS exposes a preview or published URL.