AST-based code pattern analysis using ast-grep for security, performance, and structural issues. Use when (1) reviewing code for security vulnerabilities, (2) analyzing React hook dependencies or performance patterns, (3) detecting structural anti-patterns across large codebases, (4) needing systematic pattern matching beyond manual inspection.
--- name: ast-code-analysis-superpower description: 使用 ast-grep 进行基于 AST 的代码模式分析,解决安全、性能和结构问题。适用于 (1) 审查代码以查找安全漏洞,(2) 分析 React hook 依赖项或性能模式,(3) 检测大型代码库中的结构性反模式,(4) 需要超越手动检查的系统模式匹配时。 --- # AST-Grep 代码分析 AST 模式匹配通过结构识别来识别代码问题...