重要前提
安装AI Skills的关键前提是:必须科学上网,且开启TUN模式,这一点至关重要,直接决定安装能否顺利完成,在此郑重提醒三遍:科学上网,科学上网,科学上网。查看完整安装教程 →
jscodeshift by pproenca/dot-skills
npx skills add https://github.com/pproenca/dot-skills --skill jscodeshift面向 AI 代理和 LLM 的 jscodeshift codemod 开发综合最佳实践指南。包含 8 个类别共 40 条规则,按影响程度从关键(解析器配置、AST 遍历)到渐进式(高级模式)进行优先级排序。每条规则都包含详细解释、实际示例和具体的影响指标。
在以下情况下参考本指南:
| 优先级 | 类别 | 影响程度 | 前缀 |
|---|---|---|---|
| 1 | 解析器配置 | 关键 | parser- |
| 2 | AST 遍历模式 | 关键 | traverse- |
| 3 | 节点过滤 | 高 |
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
filter- |
| 4 | AST 转换 | 高 | transform- |
| 5 | 代码生成 | 中 | codegen- |
| 6 | 测试策略 | 中 | test- |
| 7 | 运行器优化 | 低-中 | runner- |
| 8 | 高级模式 | 低 | advanced- |
parser-typescript-config - 为 TypeScript 文件使用正确的解析器parser-flow-annotation - 为 Flow 类型化代码使用 Flow 解析器parser-babel5-compat - 避免为现代语法使用默认的 babel5compatparser-export-declaration - 从转换模块导出解析器parser-astexplorer-match - 使 AST Explorer 解析器与 jscodeshift 解析器匹配traverse-find-specific-type - 在 find() 调用中使用特定的节点类型traverse-two-pass-pattern - 对复杂转换使用两阶段模式traverse-early-return - 无需转换时尽早返回traverse-find-filter-pattern - 使用带过滤对象的 find() 而非 filter() 链traverse-closest-scope - 对作用域感知的转换使用 closestScope()traverse-avoid-repeated-find - 避免对同一节点类型重复调用 find()filter-path-parent-check - 转换前检查父路径filter-import-binding - 跟踪导入绑定以实现准确的用法检测filter-nullish-checks - 在属性访问前添加空值检查filter-jsx-context - 区分 JSX 上下文与常规 JavaScriptfilter-computed-properties - 在过滤器中处理计算属性键transform-builder-api - 使用构建器 API 创建 AST 节点transform-replacewith-callback - 对上下文感知的转换使用 replaceWith 回调transform-insert-import - 在正确位置插入导入transform-preserve-comments - 替换节点时保留注释transform-renameto - 使用 renameTo 进行变量重命名transform-remove-unused-imports - 转换后移除未使用的导入codegen-tosource-options - 配置 toSource() 以实现一致的格式化codegen-preserve-style - 使用 recast 保留原始代码风格codegen-template-literals - 使用模板字面量创建复杂节点codegen-print-width - 为长行设置合适的打印宽度test-inline-snapshots - 使用 defineInlineTest 进行输入/输出验证test-negative-cases - 首先编写负面测试用例test-dry-run-exploration - 使用试运行模式探索代码库test-fixture-files - 对复杂测试用例使用夹具文件test-parse-errors - 测试解析错误处理runner-parallel-workers - 配置工作线程数以实现最佳并行化runner-ignore-patterns - 使用忽略模式跳过非源文件runner-extensions-filter - 按扩展名过滤文件runner-batch-processing - 分批处理大型代码库runner-verbose-output - 使用详细输出调试转换advanced-compose-transforms - 将多个转换组合成管道advanced-scope-analysis - 使用作用域分析进行安全的变量转换advanced-multi-file-state - 通过选项跨文件共享状态advanced-custom-collections - 创建自定义集合方法阅读各个参考文件以获取详细解释和代码示例:
如需包含所有规则的单一综合文档,请参阅 AGENTS.md。
| 文件 | 描述 |
|---|---|
| AGENTS.md | 包含所有规则的完整编译指南 |
| references/_sections.md | 类别定义和排序 |
| assets/templates/_template.md | 新规则模板 |
| metadata.json | 版本和参考信息 |
每周安装次数
82
代码仓库
GitHub 星标数
86
首次出现
2026年1月22日
安全审计
安装于
gemini-cli70
codex70
opencode68
claude-code66
cursor65
github-copilot64
Comprehensive best practices guide for jscodeshift codemod development, designed for AI agents and LLMs. Contains 40 rules across 8 categories, prioritized by impact from critical (parser configuration, AST traversal) to incremental (advanced patterns). Each rule includes detailed explanations, real-world examples, and specific impact metrics.
Reference these guidelines when:
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Parser Configuration | CRITICAL | parser- |
| 2 | AST Traversal Patterns | CRITICAL | traverse- |
| 3 | Node Filtering | HIGH | filter- |
| 4 | AST Transformation | HIGH | transform- |
| 5 | Code Generation | MEDIUM | codegen- |
| 6 | Testing Strategies | MEDIUM | test- |
| 7 | Runner Optimization | LOW-MEDIUM | runner- |
| 8 | Advanced Patterns | LOW | advanced- |
parser-typescript-config - Use correct parser for TypeScript filesparser-flow-annotation - Use Flow parser for Flow-typed codeparser-babel5-compat - Avoid default babel5compat for modern syntaxparser-export-declaration - Export parser from transform moduleparser-astexplorer-match - Match AST Explorer parser to jscodeshift parsertraverse-find-specific-type - Use specific node types in find() callstraverse-two-pass-pattern - Use two-pass pattern for complex transformstraverse-early-return - Return early when no transformation neededtraverse-find-filter-pattern - Use find() with filter object over filter() chaintraverse-closest-scope - Use closestScope() for scope-aware transformsfilter-path-parent-check - Check parent path before transformationfilter-import-binding - Track import bindings for accurate usage detectionfilter-nullish-checks - Add nullish checks before property accessfilter-jsx-context - Distinguish JSX context from regular JavaScriptfilter-computed-properties - Handle computed property keys in filterstransform-builder-api - Use builder API for creating AST nodestransform-replacewith-callback - Use replaceWith callback for context-aware transformstransform-insert-import - Insert imports at correct positiontransform-preserve-comments - Preserve comments when replacing nodestransform-renameto - Use renameTo for variable renamingcodegen-tosource-options - Configure toSource() for consistent formattingcodegen-preserve-style - Preserve original code style with recastcodegen-template-literals - Use template literals for complex node creationcodegen-print-width - Set appropriate print width for long linestest-inline-snapshots - Use defineInlineTest for input/output verificationtest-negative-cases - Write negative test cases firsttest-dry-run-exploration - Use dry run mode for codebase explorationtest-fixture-files - Use fixture files for complex test casestest-parse-errors - Test for parse error handlingrunner-parallel-workers - Configure worker count for optimal parallelizationrunner-ignore-patterns - Use ignore patterns to skip non-source filesrunner-extensions-filter - Filter files by extensionrunner-batch-processing - Process large codebases in batchesrunner-verbose-output - Use verbose output for debugging transformsadvanced-compose-transforms - Compose multiple transforms into pipelinesadvanced-scope-analysis - Use scope analysis for safe variable transformsadvanced-multi-file-state - Share state across files with optionsadvanced-custom-collections - Create custom collection methodsRead individual reference files for detailed explanations and code examples:
For a single comprehensive document containing all rules, see AGENTS.md.
| File | Description |
|---|---|
| AGENTS.md | Complete compiled guide with all rules |
| references/_sections.md | Category definitions and ordering |
| assets/templates/_template.md | Template for new rules |
| metadata.json | Version and reference information |
Weekly Installs
82
Repository
GitHub Stars
86
First Seen
Jan 22, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
gemini-cli70
codex70
opencode68
claude-code66
cursor65
github-copilot64
通过 LiteLLM 代理让 Claude Code 对接 GitHub Copilot 运行 | 高级变通方案指南
48,700 周安装
traverse-avoid-repeated-findtransform-remove-unused-imports