Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问clear审计未展示

react-anti-patternsReact anti 模式

Agent Skill

用于辅助前端页面、组件、样式和交互逻辑的开发与维护。它适合让 Agent 生成或审查 React、Next.js、Vue、Tailwind、CSS 等相关代码,整理组件结构,或定位布局和性能问题。使用时需要结合项目现有设计系统、路由和构建方式,避免只生成孤立片段;涉及页面改动时,应配合本地预览和构建检查确认视觉效果。

总安装

722

周安装

31

GitHub Stars

公开资料未说明

下载量

253
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:react-anti-patterns(React anti 模式)
来源仓库:https://github.com/joacod/skills
仓库路径:skills/react-anti-patterns
安装命令:
npx skills add joacod/skills --skill "react-anti-patterns"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add joacod/skills --skill "react-anti-patterns"

简介

react-anti-patterns 用于辅助 React 前端开发与维护。

  • 它适合生成或审查组件代码,定位布局和性能问题。
  • 使用时需结合项目设计系统和路由结构,避免孤立片段。
  • 涉及页面改动时应配合本地预览确认视觉效果。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

name
react-anti-patterns
description
Introduce React anti-patterns and common mistakes into existing React codebases for training, review, or teaching. Use when asked to intentionally degrade React performance or code quality while keeping apps functional, or to generate anti-pattern examples for junior developer education.
user-invocable
true
invocation-phrases

React Anti-Patterns

Overview

Inject React anti-patterns and performance pitfalls into existing React apps while keeping them functional, so teams can practice identifying and fixing issues.

Parameters

Amount (how many modifications)

  • low: 1-3 subtle changes, app fully functional
  • medium (default): 5-8 changes, noticeable performance issues
  • high: 10+ changes, can cause build failures (TypeScript/lint errors allowed)

Level (experience targeting)

  • junior: Obvious issues - easy to spot during code review
  • semi-senior: Moderate complexity - requires React knowledge
  • senior: Subtle issues - requires profiling or deep knowledge
  • mixed (default): Combination of all levels

Flags

  • --comments: Add inline comments identifying the anti-pattern
  • --comments-hint: Add comments with a hint on how to fix
  • --comments-fix: Add comments with full fix explanation
  • --specific <category>: Target specific category only (e.g., --specific rerender)

Categories

React: rerender, state, effect, list, conditional, data

Next.js: waterfall, bundle, boundary, actions, rsc

Workflow

1. Framework Detection

Check if project is Next.js:

  • Look for next.config.js, next.config.mjs, or next.config.ts
  • Check package.json for next dependency

If Next.js detected, ask user:

"This is a Next.js project. Include Next.js-specific anti-patterns in addition to React patterns?"

2. Gather Parameters

If not specified in invocation, ask user:

Amount (default: medium): "How many anti-patterns should I introduce?"

  • low: 1-3 subtle changes
  • medium: 5-8 noticeable changes
  • high: 10+ changes, may break build

Level (default: mixed): "What experience level should patterns target?"

  • junior: obvious issues, easy to spot
  • semi-senior: moderate complexity, requires React knowledge
  • senior: subtle issues, requires profiling
  • mixed: combination of all levels

Comments (default: none): "Should I add comments explaining the anti-patterns?"

  • none: no comments added
  • --comments: identify only
  • --comments-hint: with hints
  • --comments-fix: with full fixes

3. Load Patterns

Based on selections, load relevant reference files:

references/anti-patterns-index.md     # Always load for pattern selection
references/react/junior.md            # If level includes junior
references/react/semi-senior.md       # If level includes semi-senior
references/react/senior.md            # If level includes senior
references/nextjs/junior.md           # If Next.js + level includes junior
references/nextjs/semi-senior.md      # If Next.js + level includes semi-senior
references/nextjs/senior.md           # If Next.js + level includes senior

4. Select Patterns

Using the index, select patterns based on:

  • Amount determines count
  • Level determines which files to pull from
  • --specific filters by category
  • Prioritize variety across categories unless --specific is set

Selection by amount:

  • low: 1-3 patterns from selected level(s)
  • medium: 5-8 patterns, spread across selected level(s)
  • high: 10+ patterns, include build-error patterns if available

When level=mixed: distribute patterns roughly evenly across junior/semi-senior/senior. When specific level selected: all patterns from that level only.

5. Apply Changes

For each selected pattern:

  1. Find suitable injection point in codebase
  2. Apply the "After" transformation from the pattern definition
  3. Add appropriate comment based on flag:

- --comments: // ANTI-PATTERN: pattern-id - --comments-hint: Add the hint comment from pattern - --comments-fix: Add the fix comment from pattern

  1. Verify the change doesn't break the app (unless high amount with build-error pattern)

6. Report

After all changes, provide summary:

## Anti-Patterns Applied

### Files Modified
- path/to/Component.tsx: 3 patterns
- path/to/hooks/useData.ts: 2 patterns

### Patterns Introduced
| Pattern | Level | Category | File |
|---------|-------|----------|------|
| list-keys-index | junior | list | Component.tsx:45 |
| usememo-inline-defeat | semi-senior | rerender | Component.tsx:23 |
...

### Next Steps
Run the app and use React DevTools Profiler to identify the performance issues,
or review the code to spot the anti-patterns.

Example Invocations

# Defaults (medium, mixed levels, no comments)
/react-anti-patterns

# Few junior patterns with hints
/react-anti-patterns --comments-hint low junior

# Many senior patterns with full explanations
/react-anti-patterns --comments-fix high senior

# Only waterfall patterns (Next.js)
/react-anti-patterns --specific waterfall

# Medium amount, semi-senior level, identify comments
/react-anti-patterns --comments medium semi-senior

Resources

  • Anti-pattern catalog: references/anti-patterns-index.md
  • React patterns: references/react/
  • Next.js patterns: references/nextjs/

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

26.85%
按下载量换算68

Codex

22.42%
按下载量换算57

Cursor

16.93%
按下载量换算43

OpenCode

12.73%
按下载量换算32

Antigravity

8.31%
按下载量换算21

github-copilot

3.44%
按下载量换算9

安全审计

暂无安全审计结果可展示。

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills