Skip to content
Back to skills

Component

ASecurity

Create a UI component. Triggers "create component", "new component", "add component", or naming a component to build (Button, Header, Card).

  • 56 stars
  • 0 votes
  • 0 copies
  • 16 views
  • Added February 7, 2026
developmentreactnextjsnodeapidocumentation

Works with

  • cli
  • api

Security analysis

A100/100

Scanned December 4, 2026

npx -y skills add darkroomengineering/cc-settings --skill component --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Component?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Component
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/darkroomengineering-component/badge)](https://www.skillsdirectory.com/skills/darkroomengineering-component)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: component
description: Create a UI component. Triggers "create component", "new component", "add component", or naming a component to build (Button, Header, Card).
argument-hint: "[ComponentName]"
---

# Create Darkroom Component

Create a React component following Darkroom conventions. **Detect the stack first** — satus (Next.js) and novus (React Router) have different conventions for client/server boundaries, image/link wrappers, and path aliases.

## Step 1 — Detect stack

Read `package.json`:
- `dependencies.next` present → Next.js / satus conventions
- `dependencies["react-router"]` or `devDependencies["@react-router/dev"]` → React Router / novus conventions
- Neither → ask user, or assume satus if unclear

## Step 2 — Resolve target paths

| Stack | Component path | CSS module path | Image wrapper | Link wrapper | Path alias |
|---|---|---|---|---|---|
| satus (Next.js) | `components/<name>/index.tsx` | `components/<name>/<name>.module.css` | `import { Image } from '@/components/image'` | `import { Link } from '@/components/link'` | `@/` |
| novus (React Router) | `components/<name>/index.tsx` | `components/<name>/<name>.module.css` | Native `<img>` with explicit `width`/`height`/`fetchPriority` (or project's wrapper if it exists) | `import { Link } from 'react-router'` | `~/` |

## Step 3 — Emit template

```tsx
// components/<name>/index.tsx
// satus (Next.js): Server Component by default. Add 'use client' only if the
// component needs hooks, event handlers, or browser APIs (--client forces it).
// novus (React Router): components are isomorphic, never add 'use client'.

import s from './<name>.module.css'

interface <Name>Props {
  children?: React.ReactNode
  className?: string
}

export function <Name>({ children, className }: <Name>Props) {
  return (
    <div className={`${s.<name>} ${className ?? ''}`}>
      {children}
    </div>
  )
}
```

```css
/* components/<name>/<name>.module.css */
.<name> {
  /* Component styles */
}
```

## Before you start

If this component wraps or uses an external library (Radix, Framer Motion, GSAP, etc.):
1. **Fetch docs first.** Use Context7 in Claude or follow the [Codex documentation lookup](../README.md#documentation-lookup) in standalone Codex.
2. **Check version** — run `bun info <package>` before installing.

Never implement against external library APIs from memory.

## Conventions

1. **CSS Module as `s`** — always import as `s` for consistency.
2. **Props interface** — define explicitly, include `className` for composition.
3. **Named export** — use `export function`, not `export default`.
4. **No memoization** — React Compiler handles it.

## Arguments

- `$ARGUMENTS` — Component name (e.g., "Button", "Header")
- `--client` flag (Next.js only) — Force client component

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in development →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.