# Batch Regex Fix Import Syntax

> Detect and fix mid-import blank-line syntax breaks across multiple files using line-based regex

- Skill: `vamseeachanta/batch-regex-fix-import-syntax` (Agent Skill)
- Install (CLI): `npx skillmds@latest add vamseeachanta/batch-regex-fix-import-syntax`
- Raw SKILL.md: https://api.skillmd.com/api/skills/vamseeachanta/batch-regex-fix-import-syntax/raw
- Safety review: PASS (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: vamseeachanta (https://skillmd.com/u/vamseeachanta)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/vamseeachanta/batch-regex-fix-import-syntax

---


# Batch Regex Fix for Mid-Import Syntax Breaks

When migrations introduce blank lines within multi-line imports (e.g., `import (\n\n` instead of `import (\n`), use a line-based sed/awk fixer instead of single-pass regex. First identify the pattern across all files with grep, then apply a simple line-aware regex that matches `^import (` followed by a blank line, replacing with `import (` on the next non-blank line. Test parse afterward with `python -m py_compile` or equivalent to verify all 995+ files are clean before committing.
