create-content-component
Skill316 starsChanged 5 months agoMITView on GitHub
Use when adding a new CMS-driven page section that lives in the page builder's dynamic zone — e.g. "add page component", "new page section", "page builder component", "create content component", "add section", "new strapi component". Not for top-level API resources (use `add-content-type`) or generic React components (use `add-ui-component`).
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
- 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
- seed-contentSkill
- 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
12 rules. About 0 are common, 8 are distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈8
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 19
Add a new page-builder section to both Strapi (component schema + dynamic-zone entry) and the Next.js frontend (React component + mapping), …
- Distinctive: line 28
If unsure, ask the user before scaffolding.
- Very specific: line 41
Not sure whether a similar section already exists (by purpose, attributes, or a screenshot)?
- Distinctive: line 48
If anything matches, ask the user whether to rename or extend.
- Very specific: line 64
Follow workflow.md for the full step-by-step.
- Distinctive: line 73
Run schema check before opening the PR:
- Distinctive: line 81
Renaming or deleting an existing field: instead of adding alongside — Strapi auto-syncs to DB and drops the column.
- Distinctive: line 120
After you add a Strapi component and its frontend React implementation, add a mocked wrapper so the component is visible in the dev …
- Distinctive: line 124
Create a mocked file
- Distinctive: line 146
Import the mocked file:
- Very specific: line 150
Add an entry to the showcaseItems array with kind: "component", component: MockedStrapiMyComponent, id, label and description.
- Distinctive: line 155
Keep mock objects minimal but representative.
≈ “Common” is an estimate: at least 1 in 5 of the 364,980 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
Create a Page-Builder Content Component
Add a new page-builder section to both Strapi (component schema + dynamic-zone entry) and the Next.js frontend (React component + mapping), ending with type regeneration. Population is automatic via the smart-populate plugin — see apps/docs/docs/strapi/plugins/smart-populate.md.
Routing — which skill do you actually want?
- This skill (
create-content-component) — Strapi-driven page section, built from an explicit attribute spec. copy-component— replicate a section from a reference (description, screenshot, or HTML/code); it derives the spec and delegates here.add-content-type— needs its own DB table + REST endpoint (Article, Product, etc.).add-ui-component— generic React UI (Button, Container) not driven by Strapi data.
If unsure, ask the user before scaffolding.
Inputs
- Name — kebab-case, lowercase (e.g.
pricing-table). Reject Pascal/camelCase. - Category — lowercase, no spaces. Existing under
apps/strapi/src/components/:elements,forms,layout,sections,seo-utilities,shared,utilities. Create the dir before the schema if new. - Attributes — fields the component needs.
- Admin icon — set
info.iconto a representative name fromreferences/strapi-icons.txt(optional but recommended; vary it per component). - Rich text? — two editors are available, CKEditor and TipTap. Reuse a
utilities.*rich-text component, or declare the matchingcustomField— never rawrichtext. Seeexamples.md(Rich text). - Relation needing specific fields? — components are populated automatically by smart-populate; only relations that need extra fields/depth require a
populateOverridesentry (Procedure step 3).
Duplication check
Not sure whether a similar section already exists (by purpose, attributes, or a screenshot)? Run find-component first — reuse or extend beats duplicating. Quick name check:
ls apps/strapi/src/components/<category>/<name>.json 2>/dev/null
find apps/ui/src/components/page-builder/components -iname "Strapi*<PascalName>*"If anything matches, ask the user whether to rename or extend.
Naming reference
Given category=sections, name=testimonials:
| Artifact | Value |
| Strapi UID | sections.testimonials |
| Strapi schema file | apps/strapi/src/components/sections/testimonials.json |
collectionName | components_sections_testimonials (format: components_<category>_<name_underscored>) |
| React component | StrapiTestimonials (prefix Strapi + PascalCase) |
| React file | apps/ui/src/components/page-builder/components/sections/StrapiTestimonials.tsx |
Procedure
Follow workflow.md for the full step-by-step. The high-level sequence:
- Strapi schema — create
apps/strapi/src/components/<category>/<name>.json(seeexamples.mdfor attribute patterns). - Register in Page dynamic zone — append the new UID to
attributes.content.componentsinapps/strapi/src/api/page/content-types/page/schema.json. - Population (usually nothing to do) — the page fetch uses
content: "smart", so the smart-populate plugin auto-populates the component's nested components/media/relations from its schema. Only add apopulateOverridesentry inapps/strapi/config/plugins/smart-populate.tsif a relation needs specific fields or extra depth. - React component —
apps/ui/src/components/page-builder/components/<category>/Strapi<PascalCaseName>.tsx. - Register in
PageContentComponents—apps/ui/src/components/page-builder/index.tsx. - Regenerate types —
pnpm --filter @repo/strapi generate:types.
Run schema check before opening the PR:
bash .claude/skills/strapi-schema-check/scripts/check.shCommon mistakes
- Renaming or deleting an existing field instead of adding alongside — Strapi auto-syncs to DB and drops the column. Run schema check first.
- Hand-writing a populate tree — smart-populate (
content: "smart") handles nested components automatically; don't add manualpopulateobjects unless a relation needs specific fields, and then only viapopulateOverrides. - Using raw
richtext— use a rich-textcustomField(CKEditor or TipTap), or reuse autilities.*rich-text component; seeexamples.md(Rich text). - Pascal/camelCase component names — Strapi UIDs must be kebab-case.
- Skipping type regeneration —
Data.Component<"<category>.<name>">won't resolve. - Forgetting
import "server-only"— every shipped page-builder section has it; without it, a future client import silently turns the section into a client component. - Typing props as
{ readonly component: ... }only — codebase convention isPageBuilderComponentProps & { component: Data.Component<...> }; the extra props are page-level context other sections rely on. - Picking the wrong category for a repeatable child component —
shared/is for repeatable "row" components shared across sections (shared.figure,shared.image-with-title-and-description);utilities/is for primitives reused everywhere (utilities.link,utilities.basic-image,utilities.ck-editor-content). Match the closest existing pattern; don't invent a new category. - Hardcoding UI copy — strings like "/month", "Most popular", "Choose plan" go in
apps/ui/locales/. Strapi-driven copy comes from the schema; static UI labels come from i18n. - Gold-plating the schema — only add fields the task actually asks for. Optional extras (CTA buttons, "highlighted" toggles, billing-period switches) inflate the schema and the migration risk surface; add them in a follow-up if needed.
- Repeatable scalars — Strapi has no "repeatable string" type. A list of bullet strings needs either a child component with a single
textfield (reuseutilities.textif it fits) or, if richer per-row state is needed, a small new component.
Verify
pnpm --filter @repo/strapi dev— boots clean (no schema error on new component).- Admin → Pages → add the new component to a dynamic zone → publish.
pnpm --filter @repo/ui dev— render → confirm data flows through.pnpm --filter @repo/ui exec tsc --noEmit— clean.bash .claude/skills/strapi-schema-check/scripts/check.sh— additive UID only.
Checklist
- Strapi schema created with correct
collectionName - UID registered in Page's
contentdynamic zone populateOverridesentry added only if a relation needs specific fields (most components need none)- React component with
Strapiprefix + named + default exports - Mapped in
PageContentComponents pnpm --filter @repo/strapi generate:typesran clean- Strapi boots, component renders with real data,
tsc --noEmitclean strapi-schema-checkpasses
Notes
- No regional wrappers. Single-region starter — skip the per-region wrapper pattern.
- No Storybook. Visual review via dev server or Playwright visual tests.
- Page schema is high-risk. Any rename/delete on
apps/strapi/src/api/page/content-types/page/schema.jsontriggers column drops on boot. Add-only on the dynamic-zone array is safe.
Mocking & Showcase
After you add a Strapi component and its frontend React implementation, add a mocked wrapper so the component is visible in the dev Showcase.
The workflow is simplified: mocked files should export a single default component and should not use ManualSection / ManualItem wrappers — the Showcase reads showcaseItems.tsx and renders the component directly.
Create a mocked file
- Path:
apps/ui/src/app/[locale]/dev/showcase/components/strapiComponents/MockedStrapi{PascalName}.tsx - Export default
MockedStrapi{PascalName}which renders the productionStrapi{PascalName}with adataobject typed asData.Component<"{category}.{name}">.
Example:
- Path:
import type { Data } from "@repo/strapi-types"
import StrapiMyComponent from "@/components/page-builder/components/sections/StrapiMyComponent"
const data = {
id: 1,
__component: "sections.my-component",
/* attributes */
} as unknown as Data.Component<"sections.my-component">
export default function MockedStrapiMyComponent() {
return <StrapiMyComponent component={data} />
}- Register in
showcaseItems.tsxImport the mocked file:
import MockedStrapiMyComponent from "@/app/[locale]/dev/showcase/components/strapiComponents/MockedStrapiMyComponent"- Add an entry to the
showcaseItemsarray withkind: "component",component: MockedStrapiMyComponent,id,labelanddescription.
- Attribute tips
- Rich-text mock values match how the field is stored: an HTML string for CKEditor fields, ProseMirror JSON for TipTap fields (see
examples.md). - For images/icons reuse
mockImage/mockIconfrom the dev showcase helpers. - Keep mock objects minimal but representative.
- Rich-text mock values match how the field is stored: an HTML string for CKEditor fields, ProseMirror JSON for TipTap fields (see
See apps/docs/docs/ui/built-in-pages/showcase.md for full examples and conventions.
See also
workflow.md— full per-phase procedure with code blocksexamples.md— attribute patterns, rich-text editors (CKEditor + TipTap), override shapesreferences/strapi-icons.txt— validinfo.iconnames for the admin builderadd-content-type— when the new thing should be a top-level API resourceadd-ui-component— generic UI primitivesvercel-react-best-practices/next-best-practices/frontend-design— vendored React/Next.js + design standards for the component's frontend (in.agents/skills/)strapi-schema-check— pre-PR schema risk validationapps/docs/docs/page-builder/introduction.md— architecture overview, naming conventions, component propsapps/docs/docs/strapi/plugins/smart-populate.md— automatic population +populateOverrides
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.

