jscodeshift codemod development best practices from Facebook/Meta. This skill should be used when writing, reviewing, or debugging jscodeshift codemods. Triggers on tasks involving AST transformation, code migration, automated refactoring, or codemod development.
A comprehensive best practices guide for jscodeshift codemod development, containing 40+ rules across 8 categories.
This skill provides performance optimization and correctness guidelines for writing jscodeshift codemods. Rules are prioritized by impact from critical (parser configuration, AST traversal) to incremental (advanced patterns).
jscodeshift/
├── SKILL.md # Entry point with quick reference
├── AGENTS.md # Compiled comprehensive guide
├── metadata.json # Version and reference information
├── README.md # This file
├── references/
│ ├── _sections.md # Category definitions
│ ├── parser-*.md # Parser configuration rules
│ ├── traverse-*.md # AST traversal rules
│ ├── filter-*.md # Node filtering rules
│ ├── transform-*.md # AST transformation rules
│ ├── codegen-*.md # Code generation rules
│ ├── test-*.md # Testing strategy rules
│ ├── runner-*.md # Runner optimization rules
│ └── advanced-*.md # Advanced pattern rules
└── assets/
└── templates/
└── _template.md # Rule template
pnpm install
pnpm build
pnpm validate
assets/templates/_template.md{prefix}-{description}.mdpnpm buildpnpm validate| Prefix | Category | Impact |
|--------|----------|--------|
| parser- | Parser Configuration | CRITICAL |
| traverse- | AST Traversal Patterns | CRITICAL |
| filter- | Node Filtering | HIGH |
| transform- | AST Transformation | HIGH |
| codegen- | Code Generation | MEDIUM |
| test- | Testing Strategies | MEDIUM |
| runner- | Runner Optimization | LOW-MEDIUM |
| advanced- | Advanced Patterns | LOW |
---
title: Rule Title
impact: CRITICAL|HIGH|MEDIUM|LOW-MEDIUM|LOW
impactDescription: Quantified impact (e.g., "2-10× improvement")
tags: prefix, technique, tool
---
## Rule Title
Brief explanation of WHY this matters (1-3 sentences).
**Incorrect (problem description):**
\`\`\`javascript
// Code showing the anti-pattern
\`\`\`
**Correct (benefit description):**
\`\`\`javascript
// Code showing the correct approach
\`\`\`
Reference: [Source](url)
Rule files follow the pattern: {prefix}-{kebab-case-description}.md
parser-, traverse-)parser-typescript-config.md, traverse-two-pass-pattern.md| Level | Description | Example | |-------|-------------|---------| | CRITICAL | Affects all transformations, cascading failures | Wrong parser breaks all transforms | | HIGH | Significant correctness or performance impact | Missing scope checks corrupt code | | MEDIUM | Moderate impact on quality or efficiency | Style preservation, testing coverage | | LOW-MEDIUM | Optimization for specific scenarios | Runner parallelization tuning | | LOW | Advanced patterns for edge cases | Multi-file state coordination |
| Script | Description |
|--------|-------------|
| pnpm build | Compiles references into AGENTS.md |
| pnpm validate | Validates skill structure and content |
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer