skills/react-18/SKILL.md
# React 18 Code Review Skill ## Overview This skill provides code review guidelines for React 18 applications, focusing on hooks, concurrent features, Suspense, and modern patterns. ## Key Review Areas ### 1. Hooks Best Practices **Check for proper hook usage:** - Follow the Rules of Hooks (only call at top level, only in React functions) - Use appropriate hooks for the use case - Ensure custom hooks start with `use` prefix - Check dependency arrays for completeness and correctness ```type
npx skillsauth add danieldeusing/reviewr-templates skills/react-18Install this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides code review guidelines for React 18 applications, focusing on hooks, concurrent features, Suspense, and modern patterns.
Check for proper hook usage:
use prefix// Good: Proper hook usage
function useUser(userId: string) {
const [user, setUser] = useState<User | null>(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
let cancelled = false;
fetchUser(userId).then(data => {
if (!cancelled) {
setUser(data);
setLoading(false);
}
});
return () => { cancelled = true; };
}, [userId]); // Correct dependency
return { user, loading };
}
// Avoid: Missing dependencies
useEffect(() => {
doSomething(userId); // userId not in deps
}, []); // ESLint will warn
Review state patterns:
useState for simple local stateuseReducer for complex state logic// Good: useReducer for complex state
type Action =
| { type: 'increment' }
| { type: 'decrement' }
| { type: 'reset'; payload: number };
function reducer(state: number, action: Action): number {
switch (action.type) {
case 'increment': return state + 1;
case 'decrement': return state - 1;
case 'reset': return action.payload;
}
}
function Counter() {
const [count, dispatch] = useReducer(reducer, 0);
// ...
}
Verify proper use of concurrent features:
useTransition for non-urgent updatesuseDeferredValue for deferring expensive renders// Good: useTransition for non-urgent updates
function SearchResults({ query }: { query: string }) {
const [isPending, startTransition] = useTransition();
const [results, setResults] = useState<Result[]>([]);
function handleSearch(query: string) {
startTransition(() => {
// This update won't block the input
setResults(searchData(query));
});
}
return (
<>
{isPending && <Spinner />}
<ResultsList results={results} />
</>
);
}
// Good: useDeferredValue
function List({ items }: { items: Item[] }) {
const deferredItems = useDeferredValue(items);
// Renders with old items while new ones are computed
return <ExpensiveList items={deferredItems} />;
}
Check Suspense patterns:
// Good: Suspense with lazy loading
const Dashboard = lazy(() => import('./Dashboard'));
function App() {
return (
<Suspense fallback={<Loading />}>
<Dashboard />
</Suspense>
);
}
// Good: Error boundary with Suspense
function DataSection() {
return (
<ErrorBoundary fallback={<ErrorMessage />}>
<Suspense fallback={<Skeleton />}>
<DataComponent />
</Suspense>
</ErrorBoundary>
);
}
Review for performance issues:
React.memo for expensive pure componentsuseMemo for expensive computationsuseCallback for stable function references// Good: Memoization
const ExpensiveComponent = memo(function ExpensiveComponent({ data }: Props) {
return <div>{/* expensive render */}</div>;
});
function Parent({ items }: { items: Item[] }) {
// Memoize expensive computation
const sortedItems = useMemo(
() => items.sort((a, b) => a.name.localeCompare(b.name)),
[items]
);
// Stable callback reference
const handleClick = useCallback((id: string) => {
selectItem(id);
}, []);
return <ExpensiveComponent data={sortedItems} onClick={handleClick} />;
}
// Avoid: Object creation in render
<Component style={{ color: 'red' }} /> // Creates new object every render
Verify component best practices:
// Good: Typed function component
interface ButtonProps {
variant: 'primary' | 'secondary';
children: React.ReactNode;
onClick?: () => void;
disabled?: boolean;
}
function Button({ variant, children, onClick, disabled }: ButtonProps) {
return (
<button
className={`btn btn-${variant}`}
onClick={onClick}
disabled={disabled}
>
{children}
</button>
);
}
Verify testing practices:
act() for state updates in tests// Good: Testing user behavior
test('submits form with user input', async () => {
const onSubmit = jest.fn();
render(<LoginForm onSubmit={onSubmit} />);
await userEvent.type(screen.getByLabelText(/email/i), '[email protected]');
await userEvent.type(screen.getByLabelText(/password/i), 'password123');
await userEvent.click(screen.getByRole('button', { name: /submit/i }));
expect(onSubmit).toHaveBeenCalledWith({
email: '[email protected]',
password: 'password123'
});
});
development
# FastAPI Code Review Skill ## Overview This skill provides code review guidelines for FastAPI applications, focusing on async patterns, Pydantic v2 models, dependency injection, and API best practices. ## Key Review Areas ### 1. Pydantic Models **Check for proper model usage:** - Use Pydantic v2 syntax and features - Define proper validation rules - Use appropriate field types - Separate request/response models when needed ```python # Good: Pydantic v2 model with validation from pydantic
development
# Django 5 Code Review Skill ## Overview This skill provides code review guidelines for Django 5 applications, focusing on async views, Django REST Framework, security best practices, and modern patterns. ## Key Review Areas ### 1. Async Views and ORM **Check for proper async usage:** - Use async views for I/O-bound operations - Use `sync_to_async` for ORM operations in async views - Consider `aiterator()` for large querysets - Be aware of connection pool exhaustion ```python # Good: Async
development
# Angular 19 Code Review Skill ## Overview This skill provides code review guidelines for Angular 19 applications, focusing on modern patterns including signals, standalone components, and the new control flow syntax. ## Key Review Areas ### 1. Signal-Based Reactivity **Check for proper signal usage:** - Use `signal()` for reactive state instead of BehaviorSubject where appropriate - Use `computed()` for derived values - Use `effect()` sparingly and only for side effects - Prefer `input()`
development
Maintainer-only workflow for handling GitHub Secret Scanning alerts on OpenClaw. Use when Codex needs to triage, redact, clean up, and resolve secret leakage found in issue comments, issue bodies, PR comments, or other GitHub content.