Component Scaffold
Both tools generate components that match project conventions when pointed to a reference component. Cursor previews the component inline. Claude Code can also create the file structure and update exports automatically.
Create a new {{component_type}} component called {{component_name}} for a {{framework}} project. Purpose: {{component_purpose}} Location: {{target_directory}} Requirements: - Props interface with JSDoc descriptions for each prop - Match existing component patterns in the project (check {{reference_component}} for style) - Include: loading state, error state, empty state - Responsive: mobile-first, works from 320px to 1440px - Accessible: proper ARIA labels, keyboard navigation, focus management - Use {{styling_approach}} for styling (match project conventions) File structure: - {{component_name}}.tsx — main component - Types inline if simple, separate {{component_name}}.types.ts if >5 props - Export from directory index if barrel exports exist Do not: - Add features not specified in the requirements - Install new dependencies without asking - Use inline styles when the project uses {{styling_approach}} After creating the component, show a usage example with realistic props.
Variables to customize
Why this prompt works
Both tools generate components that match project conventions when pointed to a reference component. Cursor previews the component inline. Claude Code can also create the file structure and update exports automatically.
Save this prompt to your library
Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.
Related prompts
Get thorough code reviews with actionable feedback tailored to your language, framework, and standards.
Context-Aware Code CompletionProviding the surrounding code and project context lets the model match existing patterns exactly. The constraint against modifying existing code prevents unwanted side effects.
Inline Code SuggestionConstraining suggestions to match existing style and scope produces insertions that feel native to the codebase. The 'no explanation' rule mimics real inline completion behavior.
Code ExplanationThe audience level parameter adjusts complexity automatically. Requiring a usage example ensures the explanation is practical, not just theoretical.