react-audit-grep-patterns
它能做什么
这组命令可以帮你在把 React 代码升级到新版本(18.3.1 或 19)之前,先检查一遍代码。它会查找代码中可能需要调整的部分。
适用场景
- ✓当你计划升级 React 项目时。
- ✓当你想确认旧代码在新版本中仍能正常运行时。
- ✓当你想找出测试文件中的特定问题时。
技能链接
https://github.com/github/awesome-copilot/blob/main/skills/react-audit-grep-patterns/SKILL.md复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。
使用方法
最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。
可直接粘贴的消息
适用于 Claude Code、Codex 或 Cursor:在项目文件夹中运行,即可安装该技能。
下载 SKILL.md,放进智能体的技能文件夹。
可以这样问 AI
“我想为升级到 React 19 做一次代码检查,应该怎么做?”
每周 5 个新技能,1 分钟读完。
工作原理
它使用一个叫 grep 的工具,在你的所有代码文件中搜索特定的文本模式。它知道该查找哪些模式,比如旧的函数或兼容性问题。
技术内容(原始 SKILL.md)
作者在 GitHub 上的英文原文。
React Audit Grep Patterns
Complete scan command library for React 18.3.1 and React 19 migration audits.
Usage
Read the relevant section for your target:
references/react18-scans.md- all scans for React 16/17 → 18.3.1 auditreferences/react19-scans.md- all scans for React 18 → 19 auditreferences/test-scans.md- test file specific scans (used by both auditors)references/dep-scans.md- dependency and peer conflict scans
Base Patterns Used Across All Scans
# Standard flags used throughout:
# -r = recursive
# -n = show line numbers
# -l = show filenames only (for counting affected files)
# --include="*.js" --include="*.jsx" = JS/JSX files only
# | grep -v "\.test\.\|\.spec\.\|__tests__" = exclude test files
# | grep -v "node_modules" = safety (usually handled by not scanning node_modules)
# 2>/dev/null = suppress "no files found" errors
# Source files only (exclude tests):
SRC_FLAGS='--include="*.js" --include="*.jsx"'
EXCLUDE_TESTS='grep -v "\.test\.\|\.spec\.\|__tests__"'
# Test files only:
TEST_FLAGS='--include="*.test.js" --include="*.test.jsx" --include="*.spec.js" --include="*.spec.jsx"'
常见问题
什么是“grep 扫描”?
这是一种同时在大量代码文件中搜索特定文本的方法。
为什么升级前要先检查代码?
新版本的软件可能会修改或删除一些旧的部分,如果你不做相应调整,代码就可能出错。
什么是 API?
API 就像 React 提供给你在代码里使用的“命令”或“工具”。其中一些在新版本中可能会被删除或修改。
详情
作者的原始描述
Provides the complete, verified grep scan command library for auditing React codebases before a React 18.3.1 or React 19 upgrade. Use this skill whenever running a migration audit - for both the react18-auditor and react19-auditor agents. Contains every grep pattern needed to find deprecated APIs, removed APIs, unsafe lifecycle methods, batching vulnerabilities, test file issues, dependency confli
repo: github/awesome-copilot
热度
- GitHub 星标
- 40k
- 排名
- #7381
- 许可证
- MIT
- 更新时间
- 2026/10/15
评论
- …
同一仓库的更多技能
acquire-codebase-knowledge
40k帮你的智能体理解并编写现有代码项目的文档。它有助于新成员快速上手,或者快速了解项目架构。
acreadiness-assess
40k让你的智能体评估一个项目对 AI 的准备程度,并生成报告。它有助于了解项目在使用 AI 工具方面的准备情况。
acreadiness-generate-instructions
40k帮你的智能体根据评估结果编写 AI 工具的指令文件。它有助于改善 AI 与代码的交互方式,并弥补已发现的不足。
acreadiness-policy
40k让你的智能体协助制定或应用 AI 项目评估的政策。它有助于规范项目的评估方式,并确保合规。