بنقرة واحدة
react-components
Patterns and utilities for building React components in house-maint-ai
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Patterns and utilities for building React components in house-maint-ai
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Automatically extract reusable patterns from Claude Code sessions and save them as learned skills for future use.
Instinct-based learning system that observes sessions via hooks, creates atomic instincts with confidence scoring, and evolves them into skills/commands/agents.
Research-before-coding workflow. Search for existing tools, libraries, and patterns before writing custom code. Invokes the researcher agent.
MECE+ methodology for breaking problems into independently-solvable atomic tasks
Recursive sandboxing for 100+ iterations before human review
Simulate-Deploy-Augment loop replacing traditional PDCA
| name | React Components |
| description | Patterns and utilities for building React components in house-maint-ai |
This skill provides patterns, templates, and best practices for creating React components in the house-maint-ai project.
All components should follow this structure:
src/components/
├── ComponentName.jsx # Component implementation
├── ComponentName.test.jsx # Component tests
└── index.js # Optional barrel export
import { useState } from 'react';
/**
* ComponentName - Brief description
*
* @param {Object} props
* @param {string} props.title - The title to display
* @param {function} props.onClick - Click handler
*/
export default function ComponentName({ title, onClick }) {
const [isActive, setIsActive] = useState(false);
const handleClick = () => {
setIsActive(true);
onClick?.();
};
return (
<div className="p-4 rounded-lg bg-white shadow-sm">
<h2 className="text-lg font-semibold text-gray-800">
{title}
</h2>
<button
onClick={handleClick}
className={`mt-2 px-4 py-2 rounded-md transition-colors ${
isActive
? 'bg-blue-600 text-white'
: 'bg-gray-100 text-gray-700 hover:bg-gray-200'
}`}
>
Click me
</button>
</div>
);
}
Use these utility patterns:
| Purpose | Classes |
|---|---|
| Card container | p-4 rounded-lg bg-white shadow-sm |
| Primary button | px-4 py-2 bg-blue-600 text-white rounded-md hover:bg-blue-700 |
| Secondary button | px-4 py-2 bg-gray-100 text-gray-700 rounded-md hover:bg-gray-200 |
| Heading | text-lg font-semibold text-gray-800 |
| Body text | text-sm text-gray-600 |
Always design mobile-first:
<div className="px-4 md:px-6 lg:px-8">
<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
{/* Content */}
</div>
</div>
Header - Top navigation headerBottomNav - Bottom navigation barSearchBar - Search input componentQuickActions - Quick action buttons gridActivityCard - Activity display cardSuggestionList - List of suggestionsLoadingSpinner - Loading indicatorimport { render, screen, fireEvent } from '@testing-library/react';
import { describe, it, expect, vi } from 'vitest';
import ComponentName from './ComponentName';
describe('ComponentName', () => {
it('renders with title', () => {
render(<ComponentName title="Test Title" />);
expect(screen.getByText('Test Title')).toBeInTheDocument();
});
it('calls onClick when button clicked', () => {
const handleClick = vi.fn();
render(<ComponentName title="Test" onClick={handleClick} />);
fireEvent.click(screen.getByRole('button'));
expect(handleClick).toHaveBeenCalled();
});
});