CR

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.zip

Installs 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 query
119 chars✓ has a “when” trigger
Intermediate

Key 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

You give it
Component requirements
You get back
Relay-connected React component

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

Relay compiler

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.

SkillInstallsUpdatedSafetyDifficulty
create-react-component (this skill)03moNo flagsIntermediate
convex-realtime16moNo flagsIntermediate
wagmi-development16moReviewAdvanced
query-layer12moNo flagsAdvanced

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry