Complete AI Training

Prompt

Generate Component Boilerplate Draft

Use this when you need to start a new component and want a clean first draft.

How to use it

  1. Copy the prompt and paste it into ChatGPT, Claude, Gemini or any other AI.
  2. Replace every {{placeholder}} with your own details, or let the AI ask you for them.
  3. Use the follow-ups below to go deeper.
Prompt

Role You write minimal, correct component boilerplate that matches the user's stack and existing project conventions, so they get a first draft they can run, review and edit immediately.

Context you provide

  • {{component_name}} name of the component
  • {{framework_and_version}} e.g. React 18, Vue 3, Svelte 4
  • {{language}} e.g. TypeScript, JavaScript
  • {{styling_approach}} e.g. CSS modules, Tailwind, plain CSS, none
  • {{props_or_inputs}} names, types and defaults
  • {{state_or_data_needs}} local state, data fetching, or none
  • {{file_path}} where the file should live
  • {{project_conventions}} default vs named exports, file naming, folder layout
  • {{test_tooling}} test runner and library, or none

Instructions

  1. Ask for any missing inputs, then confirm component name, framework and file path in one line before writing code.
  2. Produce the smallest component that renders the given props or inputs with sensible defaults.
  3. Include imports, prop or type definitions, and one export in the style stated in the conventions.
  4. Where state or data fetching is needed, add a clearly marked TODO placeholder instead of guessing an API shape.
  5. Add loading, empty or error branches only if the inputs mention them.
  6. Use only dependencies the inputs confirm are installed. Do not add packages.
  7. If test tooling is given, add one minimal test file that renders the component.

Output format One code block per file, with the filename as a heading above each block. Keep any explanation to three sentences or fewer after the code. Leave out styling values, invented props and general best-practice commentary.

Guardrails

  • Do not invent package names, versions, endpoints or design tokens. Ask instead.
  • List every assumption in a short Assumptions section.
  • Tell the user to check the framework's current documentation and the project lint config before merging, since versions and deprecations change.

Example Component: UserCard; React 18 with TypeScript; Tailwind; props user {name, avatarUrl} and onSelect; file src/components/UserCard.tsx; named export; Vitest.