Create React components following Darkroom standards. Use when: - User says "create component", "new component", "add component" - User wants to build a UI element, widget, or reusable piece - User mentions a component name like "Button", "Header", "Card"
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.
Read package.json:
dependencies.next present → Next.js / satus conventionsdependencies["react-router"] or devDependencies["@react-router/dev"] → React Router / novus conventions| 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> (or project's wrapper if it exists) | import { Link } from 'react-router' | ~/ |
// components/<name>/index.tsx
// 'use client' — only add if component needs:
// - useState, useEffect, or other hooks
// - Event handlers (onClick, onChange, etc.)
// - Browser APIs (window, document, etc.)
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>
)
}
// components/<name>/index.tsx
// React Router components are isomorphic — no directive needed.
// They run on server during SSR and on client after hydration.
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>
)
}
.<name> {
/* Component styles */
}
If this component wraps or uses an external library (Radix, Framer Motion, GSAP, etc.):
mcp__context7__resolve-library-id → get-library-docs) for the current API in Claude or when the user configured it in standalone Codex. Otherwise use official docs through native browsing or inspect the pinned local package. cc-settings does not auto-run unpinned registry MCP packages in Codex.bun info <package> before installing.Never implement against external library APIs from memory.
s — always import as s for consistency.className for composition.export function, not export default.'use client' if needed.import { Image } from '@/components/image'.import { Link } from '@/components/link'.'use client' directive.~/, not @/.import { Link } from 'react-router' (declarative routing).<img> with explicit width/height/fetchPriority. No project-level wrapper unless the project added one.$ARGUMENTS — Component name (e.g., "Button", "Header")--client flag (Next.js only) — Force client componentUser: "create a Button component"
→ detect stack → satus → creates components/button/index.tsx + button.module.css with @/-aliased imports
User: "create a Button component" (in novus repo)
→ detect stack → novus → creates same files but with ~/-aliased imports and no 'use client' directive
npx skills add darkroomengineering/component下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer