client-typescript-react-reviewer

Expert code reviewer for TypeScript + React 17 applications. Use when reviewing React code, identifying anti-patterns, evaluating Redux + Saga state management, or assessing code maintainability. Triggers: code review requests, PR reviews, React architecture evaluation, identifying code smells, TypeScript type safety checks, useEffect abuse detection, Redux/Saga pattern review.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "client-typescript-react-reviewer" with this command: npx skills add lqsyyy/yach-skills/lqsyyy-yach-skills-client-typescript-react-reviewer

TypeScript + React 17 Code Review Expert

Expert code reviewer with deep knowledge of React 17, Redux, Redux-Saga, Ant Design 4, and TypeScript best practices.

Review Priority Levels

Critical (Block Merge)

These issues cause bugs, memory leaks, or architectural problems:

IssueWhy It's Critical
useEffect for derived stateExtra render cycle, sync bugs
Missing cleanup in useEffectMemory leaks (timers, event listeners)
Direct state mutation (.push(), .splice())Silent update failures (React/Redux)
Conditional hook callsBreaks Rules of Hooks
key={index} in dynamic listsState corruption on reorder
any type without justificationType safety bypass
Missing yield in SagasSaga won't wait for effect, logic breaks
Blocking effects in Sagascall or take blocking other loops unnecessarily
Illegal dependency_public, pages, plugins importing from im
Missing try-catchCritical in Sagas, JSON parsing, and async IO

High Priority

IssueImpact
Incomplete dependency arraysStale closures, missing updates
Props typed as anyRuntime errors
Unjustified useMemo/useCallbackUnnecessary complexity
Missing Error BoundariesPoor error UX
Controlled input initialized with undefinedReact warning
Missing error handling in SagasCrashes the generator/application

Architecture/Style

IssueRecommendation
Component > 300 linesSplit into smaller components
Prop drilling > 2-3 levelsUse composition or Redux
State far from usageColocate state
Custom hooks without use prefixFollow naming convention
Hardcoded constantsUse config files or constants.ts

Quick Detection Patterns

useEffect Abuse (Most Common Anti-Pattern)

// WRONG: Derived state in useEffect
const [firstName, setFirstName] = useState('');
const [fullName, setFullName] = useState('');
useEffect(() => {
  setFullName(firstName + ' ' + lastName);
}, [firstName, lastName]);

// CORRECT: Compute during render
const fullName = firstName + ' ' + lastName;
// WRONG: Event logic in useEffect
useEffect(() => {
  if (product.isInCart) showNotification('Added!');
}, [product]);

// CORRECT: Logic in event handler
function handleAddToCart() {
  addToCart(product);
  showNotification('Added!');
}

Redux + Saga Patterns

// WRONG: Missing error handling in Saga (Critical)
function* fetchDataSaga(action) {
  const data = yield call(api.fetchData, action.payload);
  yield put(actions.fetchSuccess(data));
}

// CORRECT (Mandatory): Try-catch in Saga
function* fetchDataSaga(action) {
  try {
    const data = yield call(api.fetchData, action.payload);
    yield put(actions.fetchSuccess(data));
  } catch (error) {
    yield put(actions.fetchFailure(error));
  }
}

TypeScript Red Flags

// Red flags to catch
const data: any = response;           // Unsafe any
const items = arr[10];                // Missing undefined check
const App: React.FC<Props> = () => {}; // Discouraged pattern

// Preferred patterns
const data: ResponseType = response;
const items = arr[10]; // with noUncheckedIndexedAccess
const App = ({ prop }: Props) => {};  // Explicit props

Review Workflow

  1. Scan for critical issues first - Check for the patterns in "Critical (Block Merge)" section
  2. Evaluate Redux/Saga usage - Check for proper effect usage and error handling in Sagas
  3. Assess ahooks usage - Check if ahooks (useMount, useUnmount, etc.) are used for readability
  4. Assess TypeScript safety - Generic components, discriminated unions, strict config
  5. Review for maintainability - Component size, hook design, folder structure

Reference Documents

For detailed patterns and examples:

State Management Quick Guide

Data TypeSolution
Persistent Server DataRedux + Redux-Saga
Cache/FetchingTanStack Query (v4)
UI/Complex Global StateRedux
Component-local stateuseState/useReducer
Performance Helpersahooks (useLatest, useUpdateEffect)

Specialized Review Rules

1. Localization (i18n)

Avoid hardcoded Chinese/English strings in JSX.

  • Wrong: <span>确定</span>
  • Correct: <span>{util.locale('common_ok')}</span>

2. Electron Cleanup

Always verify that IPC listeners and DOM event listeners have corresponding cleanup logic.

Redux Mutation Anti-Pattern

// NEVER mutate state in Reducers
case 'ADD_TODO':
  state.todos.push(action.payload);
  return state;

// Redux Toolkit or Immutable updates
case 'ADD_TODO':
  return { ...state, todos: [...state.todos, action.payload] };

TypeScript Config Recommendations

{
  "compilerOptions": {
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitReturns": true,
    "exactOptionalPropertyTypes": true
  }
}

noUncheckedIndexedAccess is critical - it catches arr[i] returning undefined.

Immediate Red Flags

When reviewing, flag these immediately:

PatternProblemFix
eslint-disable react-hooks/exhaustive-depsHides stale closure bugsRefactor logic
Component defined inside componentRemounts every renderMove outside
useState(undefined) for inputsUncontrolled warningUse empty string
React.FC with genericsGeneric inference breaksUse explicit props
Large Saga without takeLatestRace conditions / PerformanceUse takeLatest or takeEvery correctly

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

openclaw-version-monitor

监控 OpenClaw GitHub 版本更新,获取最新版本发布说明,翻译成中文, 并推送到 Telegram 和 Feishu。用于:(1) 定时检查版本更新 (2) 推送版本更新通知 (3) 生成中文版发布说明

Archived SourceRecently Updated
Coding

ask-claude

Delegate a task to Claude Code CLI and immediately report the result back in chat. Supports persistent sessions with full context memory. Safe execution: no data exfiltration, no external calls, file operations confined to workspace. Use when the user asks to run Claude, delegate a coding task, continue a previous Claude session, or any task benefiting from Claude Code's tools (file editing, code analysis, bash, etc.).

Archived SourceRecently Updated
Coding

ai-dating

This skill enables dating and matchmaking workflows. Use it when a user asks to make friends, find a partner, run matchmaking, or provide dating preferences/profile updates. The skill should execute `dating-cli` commands to complete profile setup, task creation/update, match checking, contact reveal, and review.

Archived SourceRecently Updated
Coding

clawhub-rate-limited-publisher

Queue and publish local skills to ClawHub with a strict 5-per-hour cap using the local clawhub CLI and host scheduler.

Archived SourceRecently Updated