seed-content
Skill316 starsChanged 5 months agoMITView on GitHub
Use when populating the local Strapi with content programmatically through MCP — e.g. "seed content", "seed a page", "import content into strapi", "create demo content", "add a page with components". Schema-driven create/update of pages, navbar, and footer via the Strapi MCP server. For reproducible baseline content, use the native export/import seed flow instead.
- Sends data out
In this repository25 other files it gives its agents.
- AGENTS.mdAGENTS.md
- .claude/skills/vercel-react-best-practices/AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- add-content-typeSkill
- add-localeSkill
- add-ui-componentSkill
- consolidate-patternsSkill
- copy-componentSkill
- create-content-componentSkill
- find-componentSkill
- find-skillsSkill
- frontend-designSkill
- make-prSkill
- next-best-practicesSkill
- remove-azure-monitorSkill
- remove-cache-revalidationSkill
- remove-cdn-purgeSkill
- remove-sentrySkill
- resolve-review-suggestionsSkill
- review-prSkill
- start-workSkill
- strapi-schema-checkSkill
- validate-branch-refsSkill
- vercel-react-best-practicesSkill
- write-testsSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Create or update content in the local Strapi using the Strapi MCP server, driven by the live schemas.
- Very specific: line 36
Read the target schema before mapping.
- Very specific: line 66
If no component matches a section, skip it and suggest create-content-component.
- Very specific: line 91
Never screenshot an asset to fake one.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Seed Content via MCP
Create or update content in the local Strapi using the Strapi MCP server, driven by the live schemas. Use it for interactive/demo seeding from a source you provide — a description, structured data, or a reference page.
For reproducible, code-tracked baseline content, prefer the native export/import flow — see apps/docs/docs/strapi/data-seeding.md. This skill is the interactive, MCP-driven complement.
Prerequisites
- Strapi MCP reachable — verify with a read via MCP (list pages, or get the Navbar single type). If it isn't, stop and point the user to
apps/docs/docs/reference/AI/strapi-mcp.md. - Strapi running on
:1337.
Execution mode
- Direct (default) — preview the plan and get approval before writing.
- Invoked by another skill (e.g.
copy-component, carrying the caller's authorization) — run autonomously: skip the approval prompt, default to append when a page already exists, never prompt. Log failures and report them at the end.
Inputs
- target page — the page
fullPathto seed into (existing or new). - target component(s) — optional; specific UID(s) to seed (default: every section the source maps to).
- locale — which locale to seed into (default: the project's default locale). Every find and write is per-locale.
- parent — for a new page, its parent page (default: the root page
/, or derived from the target path).
In direct mode, ask for any missing required input; when invoked by another skill, derive them and never prompt.
Critical rules
Schema is the source of truth
Read the target schema before mapping. Only set fields that exist; respect required fields and enumeration values; coerce scalars only when type-compatible. Skip anything that can't be mapped safely and report it — never fail the whole run over one unmappable fragment.
A component must be registered before you write its UID
Strapi registers components from their schema files on boot. A component just created by create-content-component is not writable into a page's content until Strapi has restarted — writing an unregistered __component UID corrupts the dynamic zone. So when seeding a freshly created UID, first confirm Strapi restarted and is healthy (GET http://localhost:1337/api/health → 200). If it isn't up, ask the user to restart it and wait — never start the dev server in the background.
Dynamic-zone merge (page content, navbar, footer)
A Strapi PUT replaces the whole field. To add a component without wiping existing ones: GET the entry with content populated, append to the array, then PUT the full array back.
WRONG: PUT { content: [{ new }] } → deletes existing components
RIGHT: GET → content=[a,b]; PUT { content:[a,b,{ new }] }Page hierarchy — always set parent; keep fullPath consistent
A page's place in the tree is defined by its parent relation (which drives breadcrumbs, navigation, and child links) plus its required slug (lowercase [a-z0-9-], no leading/trailing slash). Always set parent — top-level pages point at the root page (slug /), others at their parent page, in the same locale.
fullPath is the chained parent slugs + own slug (starts with /), normally derived from slug + parent. When seeding you may write it directly, but only as <parent.fullPath>/<slug> and only with the matching parent set — a fullPath without the right parent resolves the URL while breaking the hierarchy. Never invent a fullPath that disagrees with the parent chain.
If a stored fullPath ends up stale or mismatched, open the Hierarchy single type in Strapi admin and run Update hierarchy — it recalculates the affected fullPaths and creates the redirects in one action. While seeding pre-launch test content, those redirects are safe to delete (dev/staging only). See apps/docs/docs/page-builder/pages-hierarchy.md.
Steps
- Verify MCP & registration — confirm MCP is reachable; if seeding a freshly created component, confirm Strapi restarted (registration rule above).
- Read schemas — page (
apps/strapi/src/api/page/content-types/page/schema.json), thenavbar/footersingle types, and component schemas underapps/strapi/src/components/(recurse nestedcomponentrefs). Only the dynamic-zone UIDs the Page registers are valid incontent. - Map source → UIDs by schema:
- Media — the MCP server can't upload files; media fields only accept existing media ids. So either reuse a library asset by name (
GET /api/upload/files?filters[name][$containsi]=<name>) or upload the file outside MCP first, then pass the returned id to the MCP create/update. Never screenshot an asset; if a required media field can't be resolved, skip the whole fragment (don't writenull). Upload flow below. - Relations — find-before-create by a natural key; resolve nested relations bottom-up (children before the entry that references them); reuse exact matches, create only when absent. For a
utilities.linkwhose internal page target can't be resolved, fall back to an external link (type: "external",href= the absolute source URL). - If no component matches a section, skip it and suggest
create-content-component.
- Media — the MCP server can't upload files; media fields only accept existing media ids. So either reuse a library asset by name (
- Preview the plan — UIDs, target page + locale, media, relations, skipped/invalid. Direct mode: approve before writing. Autonomous mode: log and proceed.
- Write:
- Pages (collection): find an existing page by
fullPath+locale(the unique per-locale identifier —slugalone isn't unique). Create withslug/parent(root/or the parent page) /content/status: "published"— optionallyfullPathas<parent.fullPath>/<slug>. Or GET → append → PUT to add to an existing page'scontent. - Navbar / Footer (single types): they always exist — GET, merge into
content, PUT. Never create.
- Pages (collection): find an existing page by
- Verify & report — re-fetch by
documentId+locale, confirmfullPath, and report created / updated / reused / skipped / invalid (withdocumentId,fullPath,locale) plus any manual follow-up (e.g. run Update hierarchy).
Uploading media (outside MCP)
The MCP server references media by id but cannot upload files. Upload first via Strapi's Upload API, then pass the id into the MCP create/update.
- Reuse check —
GET /api/upload/files?filters[name][$containsi]=<name>; if a match exists, use itsid. Upload (multipart) with an API token that has Upload permission (a full-access local token has it):
curl -sS -X POST http://localhost:1337/api/upload \ -H "Authorization: Bearer <API_TOKEN>" \ -F "files=@/path/to/asset.png" \ -F 'fileInfo={"name":"asset","alternativeText":"descriptive alt"}'The response is an array — take
[0].id. (Strapi stores the file via its configured upload provider — local / S3 / etc.)- Reference that id in the MCP call: a single-media field takes the
id; a multiple-media field takes an array of ids.
Never screenshot an asset to fake one. If a required media field can't be uploaded or matched, skip the fragment (don't write null).
See also
apps/docs/docs/reference/AI/strapi-mcp.md— connect an agent to Strapi over MCP first.create-content-component— add (and register) a page-builder component before seeding into it.copy-component— replicate a section; may invoke this skill to seed a demo entry.apps/docs/docs/strapi/data-seeding.md— native snapshot seeding.apps/docs/docs/page-builder/pages-hierarchy.md—fullPath, parents, redirects.apps/docs/docs/strapi/strapi-schemas.md— schema rules.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

