Back to list
carlos-algms

react

by carlos-algms

shareable dotfiles configuration for mac, linux and windows

1🍴 0📅 Jan 25, 2026

SKILL.md


name: react description: Writes React components and hooks using TypeScript. Use when creating or modifying React components, hooks, or JSX.

React Protocol

Component Structure

  • Functional components only (no classes)
  • No import React from 'react' — import individually
  • Never use React.* namespace (e.g., React.useState, React.ReactNode)
  • Export default in single expression
  • No return types for components (TypeScript infers)
// ✓ Good
import { useState, type ReactNode } from 'react';

export default function MyComponent() {
  return <div>Hello</div>;
}

// ✗ Bad
import React from 'react';
function MyComponent(): JSX.Element { ... }
export default MyComponent;

Hooks

  • useState generic only for unions/complex types (not for string, boolean, number)
  • No useCallback for same-component functions
  • useCallback acceptable for functions returned from custom hooks
  • Named functions (not arrows) for async/complex logic inside hooks
// ✓ Good
const [name, setName] = useState(''); // no generic needed
const [status, setStatus] = useState<'a' | 'b'>('a'); // union needs generic

useEffect(() => {
  async function fetchData() {
    const res = await fetch('/api');
  }
  void fetchData();
}, []);

Other Rules

  • Follow accessibility best practices
  • displayName only for forwardRef components
  • Fragment <> only for multiple siblings
// ✓ forwardRef with displayName
const MyInput = forwardRef<HTMLInputElement, Props>((props, ref) => (
  <input ref={ref} {...props} />
));
MyInput.displayName = 'MyInput';

// ✓ Fragment for siblings
return (
  <>
    <div>First</div>
    <div>Second</div>
  </>
);

// ✗ Unnecessary fragment
return (
  <>
    <div>Only child</div>
  </>
);

Score

Total Score

65/100

Based on repository quality metrics

SKILL.md

SKILL.mdファイルが含まれている

+20
LICENSE

ライセンスが設定されている

+10
説明文

100文字以上の説明がある

0/10
人気

GitHub Stars 100以上

0/15
最近の活動

1ヶ月以内に更新

+10
フォーク

10回以上フォークされている

0/5
Issue管理

オープンIssueが50未満

+5
言語

プログラミング言語が設定されている

+5
タグ

1つ以上のタグが設定されている

+5

Reviews

💬

Reviews coming soon