Agent skill

component

React Nativeの再利用可能なUIコンポーネントを作成する。「コンポーネントを作って」「ボタンを作成」などのリクエストで使用する。

Stars 163
Forks 31

Install this agent skill to your Project

npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/component

SKILL.md

コンポーネント作成

src/components/ に React Native の関数コンポーネントを作成する。

手順

  1. src/components/ ディレクトリが存在しなければ作成する
  2. PascalCase のファイル名で .tsx ファイルを作成する(例: $ARGUMENTS.tsx)
  3. 既存コンポーネントのスタイルと一貫性を保つ

テンプレート

tsx
import React from 'react';
import { StyleSheet, View, Text } from 'react-native';

interface Props {
  // props をここに定義
}

export const ComponentName: React.FC<Props> = ({}) => {
  return (
    <View style={styles.container}>
      <Text>ComponentName</Text>
    </View>
  );
};

const styles = StyleSheet.create({
  container: {},
});

ルール

  • export default ではなく名前付きエクスポートを使う
  • Props は interface で定義する
  • スタイルは StyleSheet.create() で定義する
  • React Native のコンポーネント(View, Text, TouchableOpacity 等)を使う(HTML 要素は使わない)
  • 不要な依存パッケージを追加しない

Expand your agent's capabilities with these related and highly-rated skills.

Didn't find tool you were looking for?

Be as detailed as possible for better results