copy-component
Skill316 starsChanged 5 months agoMITView on GitHub
Use to replicate a page-builder section from a reference — a text description, a screenshot, or an HTML/code snippet. Triggers: "copy component", "replicate component", "recreate this section", "build from screenshot", "make a component like this", "convert this HTML/JSX into a component", "port this section". Not for generic UI primitives (use `add-ui-component`) or API resources (use `add-content-type`).
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
- 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
- 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
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 29
Run find-component with the reference.
≈ “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
Copy / Replicate a Component
Turn a reference — a text description, a screenshot, or an HTML/code snippet — into a full Strapi + React page-builder section that fits this codebase.
This skill derives a field spec + layout intent from the reference, then delegates: reuse-check to find-component, scaffolding (schema · dynamic zone · smart-populate · React skeleton · PageContentComponents mapping · types · showcase mock) to create-content-component. It does not re-implement those flows.
Routing
- Replicate from a reference → this skill.
- Just check whether one already exists →
find-component. - Build from an explicit attribute spec (no reference to match) →
create-content-component. - New top-level API resource →
add-content-type.
Step 1 — Reuse-check first
Run find-component with the reference. If it returns a fit, reuse as-is, or extend it additively via create-content-component (a schema change → run strapi-schema-check). Only build new when there's no fit — don't duplicate an existing section.
Step 2 — Derive a field spec from the input
- Text description → intent + named fields.
- Screenshot / image → read the image; identify layout, repeats (cards / rows / columns), media, CTAs, headings, and rich-text blocks.
- HTML / code snippet → parse the markup or JSX: element/prop → field;
.map()→ repeatable;?./ conditionals → optional; conditional class or variant →enumeration;set:html/dangerouslySetInnerHTML/ an RTE component → a rich-text field, never a plain string.
Map to Strapi types and reuse existing utilities instead of inventing equivalents: links → utilities.link; images → utilities.basic-image (clickable → utilities.image-with-link); repeatable bullet text → utilities.text; accordion / FAQ → utilities.accordions; rich text → a rich-text customField or a utilities.* rich-text component. Full type table + rich-text options: the create-content-component skill's examples.md.
Step 3 — Scaffold via create-content-component
Hand off the category + kebab-case name + attribute spec. That skill owns the Strapi schema, dynamic-zone registration, smart-populate, the React skeleton + mapping, type regen, and the showcase mock. Pick an info.icon from create-content-component/references/strapi-icons.txt.
Step 4 — Implement to match the reference
Flesh out the React component to the reference using this codebase's conventions (see add-ui-component for the full set):
- Typography —
<Typography tag variant>from@/components/typographyfor all text; never raw<h1>–<h6>/<p>. Variants live inapps/ui/src/components/typography/config.ts. - Rich text — render with
StrapiTipTapEditorContentorStrapiCkEditorContent(@/components/page-builder/components/utilities/). Formats differ — TipTap stores ProseMirror JSON, CKEditor HTML — match that when mocking/seeding (seeexamples.md). - Links / images — reuse
StrapiLink,StrapiBasicImage,StrapiImageWithLink(same utilities dir). - Layout — wrap in
<Container>; design tokens only, no raw hex or arbitrary Tailwind values. Translate any source CSS/SCSS to Tailwind tokens. - Static copy — visible labels, aria-labels, and fallback text go in
apps/ui/locales/en.jsonunder<category>.<name>.*viauseTranslations; only CMS-driven text comes from the schema. - Accessibility — aria on interactive/structural elements (accordion:
aria-expanded/aria-controls; images: realalt; icon-only buttons:aria-label). - shadcn — match interactive patterns to primitives (collapsible → Accordion, tabs → Tabs, modal → Dialog, carousel → Carousel) via
add-ui-component; install only with user approval. - Apply the vendored
vercel-react-best-practices/next-best-practices/frontend-designstandards. - Component schemas take no
pluginOptions.i18n— they localize through the parent page's localized dynamic zone.
Step 5 — Verify & optionally seed
pnpm --filter @repo/strapi generate:types → pnpm --filter @repo/ui exec tsc --noEmit → pnpm --filter @repo/ui lint. Run strapi-schema-check if you extended an existing schema. Optionally run seed-content to populate a demo entry.
Not handled
Complex animations, form-submission logic, and inline SVGs — extract the structure and report the rest for manual follow-up.
See also
find-component·create-content-component·add-ui-component·seed-content·strapi-schema-check- the
create-content-componentskill'sexamples.md— attribute + rich-text patterns apps/docs/docs/page-builder/introduction.md
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.

