mcpField
J
jscodeshift

jscodeshift

github.com/pproencaDevelopment218413 installsUpdated 11w ago
Repository

About jscodeshift

A best-practices reference for AI agents and LLMs developing jscodeshift codemods. Its prioritized rules address parser setup, AST traversal and transformation, code generation, testing, and runner tuning.

Key features

  1. 0140 rules across eight categories
  2. 02Parser configuration and AST traversal
  3. 03Node filtering and transformation patterns
  4. 04Code generation and style preservation
  5. 05Testing and runner optimization

Use cases

  1. 01Writing code migration codemods
  2. 02Debugging transform failures
  3. 03Testing transforms for edge cases
  4. 04Reviewing codemods for correctness

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/pproenca/dot-skills --skill jscodeshift

After installing, type/jscodeshiftin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

AGENTS.md
metadata.json
README.md
assets/templates/
_template.md
references/
_sections.md
advanced-compose-transforms.md
advanced-custom-collections.md
advanced-multi-file-state.md
advanced-scope-analysis.md
codegen-preserve-style.md
codegen-print-width.md
codegen-template-literals.md
codegen-tosource-options.md
filter-computed-properties.md
filter-import-binding.md
filter-jsx-context.md
filter-nullish-checks.md
filter-path-parent-check.md
parser-astexplorer-match.md
parser-babel5-compat.md
parser-export-declaration.md
parser-flow-annotation.md
parser-typescript-config.md
runner-batch-processing.md
runner-extensions-filter.md
runner-ignore-patterns.md
runner-parallel-workers.md
runner-verbose-output.md
test-dry-run-exploration.md
test-fixture-files.md

Details

From the project README

Facebook/Meta jscodeshift Best Practices

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.

When to Apply

Reference these guidelines when:

  • Writing new jscodeshift codemods for code migrations
  • Debugging transform failures or unexpected behavior
  • Optimizing codemod performance on large codebases
  • Reviewing codemod code for correctness
  • Testing codemods for edge cases and regressions

Rule Categories by Priority

PriorityCategoryImpactPrefix
1Parser ConfigurationCRITICALparser-
2AST Traversal PatternsCRITICALtraverse-
3Node FilteringHIGHfilter-
4AST TransformationHIGHtransform-
5Code GenerationMEDIUMcodegen-
6Testing StrategiesMEDIUMtest-
7Runner OptimizationLOW-MEDIUMrunner-
8Advanced PatternsLOWadvanced-

Quick Reference

1. Parser Configuration (CRITICAL)
2. AST Traversal Patterns (CRITICAL)
3. Node Filtering (HIGH)
4. AST Transformation (HIGH)
5. Code Generation (MEDIUM)
6. Testing Strategies (MEDIUM)
7. Runner Optimization (LOW-MEDIUM)
8. Advanced Patterns (LOW)

How to Use

Read individual reference files for detailed explanations and code examples:

Full Compiled Document

For a single comprehensive document containing all rules, see AGENTS.md.

Reference Files

FileDescription
AGENTS.mdComplete compiled guide with all rules
references/_sections.mdCategory definitions and ordering
assets/templates/_template.mdTemplate for new rules
metadata.jsonVersion and reference information

Comments

Markdown supported