create-react-component
Scaffolds Relay-connected React components, including GraphQL fragments and type definitions, based on existing codebase patterns.
Install
mkdir -p .claude/skills/create-react-component && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10130" && unzip -o skill.zip -d .claude/skills/create-react-component && rm skill.zipInstalls to .claude/skills/create-react-component
Activation
This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.
Use when: creating a new Relay-connected React component, defining a GraphQL fragment, or wiring a component to a queryKey capabilities
- →Create Relay-connected components
- →Define GraphQL fragments
- →Wire components to queries
- →Generate TypeScript types
- →Follow OpenCTI patterns
How it works
It guides the creation of React components that use Relay fragments for data fetching, ensuring consistency with OpenCTI platform patterns.
Inputs & outputs
When to use create-react-component
- →Building a new UI component for OpenCTI
- →Defining a new GraphQL fragment for data retrieval
- →Wiring a component to a Relay query
About this skill
Create React Component (Relay)
Prerequisites
- Parent Component: Knowing where this will be used.
- Fragment: The data requirements from GraphQL.
Procedure
Step 0 — Find an Existing Example
Use the Codebase Pattern Finder agent to locate a similar existing component in opencti-platform/opencti-front/src/private/components/ that uses useFragment. Model the new component after the existing one to stay idiomatic.
Step 1 — Create Component File
Location: opencti-platform/opencti-front/src/private/components/....
Step 2 — Define Fragment & Props
Use graphql tag and useFragment.
import React from 'react';
import { graphql, useFragment } from 'react-relay';
import { MyComponent_data$key } from './__generated__/MyComponent_data.graphql';
const myComponentFragment = graphql`
fragment MyComponent_data on EntityType {
id
name
description
}
`;
interface MyComponentProps {
data: MyComponent_data$key;
}
const MyComponent: React.FC<MyComponentProps> = ({ data }) => {
const node = useFragment(myComponentFragment, data);
return (
<div>
<h1>{node.name}</h1>
<p>{node.description}</p>
</div>
);
};
export default MyComponent;
Step 3 — Run Relay Compiler
Run yarn relay to generate the TypeScript types.
When not to use it
- →Non-Relay React components
Prerequisites
Limitations
- →Requires Relay compiler
How it compares
It provides a standardized workflow for Relay integration, reducing boilerplate and ensuring type safety.
Compared to similar skills
create-react-component side by side with the closest alternatives in the catalog.
| Skill | Installs | Updated | Safety | Difficulty |
|---|---|---|---|---|
| create-react-component (this skill) | 0 | 3mo | No flags | Intermediate |
| convex-realtime | 1 | 6mo | No flags | Intermediate |
| wagmi-development | 1 | 6mo | Review | Advanced |
| query-layer | 1 | 2mo | No flags | Advanced |
Try saying
Example prompts that trigger this skill in your AI assistant.
You might also like
convex-realtime
waynesutton
Patterns for building reactive apps including subscription management, optimistic updates, cache behavior, and paginated queries with cursor-based loading
wagmi-development
wevm
Creates Wagmi features across all layers - core actions, query options, framework bindings. Use when adding new actions, hooks, or working across packages/core, packages/react, packages/vue.
query-layer
EpicenterHQ
Query layer patterns for consuming services with TanStack Query, error transformation, and runtime dependency injection. Use when implementing queries/mutations, transforming service errors for UI, or adding reactive data management.
lifi-dev
mashharuki
>
use-x-chat
wangzi6224
专注讲解如何使用 useXChat Hook,包括自定义 Provider 的集成、消息管理、错误处理、多会话管理等
frontend-api-integration-patterns
TJSNDHU
Production-ready patterns for integrating frontend applications with backend APIs, including race condition handling, request cancellation, retry strategies, error normalization, and UI state management.