New component
Scaffold a typed responsive React component using shadcn/ui primitives with a unit testFrom its SKILL.md
npx -y skills add dqube/frondend --skill new-componentAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- no licenseNo license file was found in the repository. Code published without one is not open source by default, so using it at work is a question for whoever answers licensing questions where you are.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
2.3 KB, as published. Nobody here has run it
Scaffold a typed, responsive React component for the ModernStores project.
Arguments
$ARGUMENTS format: <scope> <ComponentName> [description]
<scope>:ui(sharedpackages/ui) |store|admin<ComponentName>: PascalCase name[description]: optional description of what the component does
Examples:
/new-component ui ProductCard "Product image, name, price and add-to-cart"/new-component store CartDrawer "Slide-over cart with line items and total"/new-component admin DataTable "Generic sortable paginated table"
Target directory
ui→packages/ui/src/components/<ComponentName>/store/admin→apps/<scope>/components/<ComponentName>/
Files to create
<ComponentName>.tsx
import { cn } from '@modernstores/ui/lib/utils'
interface <ComponentName>Props {
className?: string
// add typed props derived from [description]
}
export function <ComponentName>({ className, ...props }: <ComponentName>Props) {
return (
<div className={cn('', className)}>
{/* implementation — use shadcn/ui primitives, never raw HTML buttons/inputs */}
</div>
)
}
<ComponentName>.test.tsx
import { render, screen } from '@testing-library/react'
import { describe, it, expect } from 'vitest'
import { <ComponentName> } from './<ComponentName>'
describe('<ComponentName>', () => {
it('renders without crashing', () => {
render(<ComponentName />)
expect(screen.getByRole('...')).toBeInTheDocument()
})
})
index.ts
export { <ComponentName> } from './<ComponentName>'
export type { <ComponentName>Props } from './<ComponentName>'
Additional steps
- If scope is
ui: also add the export topackages/ui/src/index.ts - Always use
cn()for className merging - Build mobile-first: default styles target mobile, use
md:andlg:prefixes for larger screens - Use shadcn/ui primitives (Button, Card, Badge, Input, etc.) — never raw HTML form elements
- Interactive elements must be at least 44×44px (
min-h-11 min-w-11)