본문으로 건너뛰기
Skillpedia
일반 코딩8.2k · #12525

batch-operations

하는 일

이 스킬을 쓰면 AI가 프로젝트의 여러 파일에 같은 수정을 일관되게 적용할 수 있습니다. 모든 곳에 같은 이름 바꾸기나 업데이트가 필요한 개발자를 위한 스킬입니다.

사용하는 경우

  • ✓코드베이스에서 함수나 컴포넌트를 쓰는 모든 곳의 이름을 바꾸고 싶을 때.
  • ✓여러 파일에 걸쳐 버전 번호나 import를 업데이트해야 할 때.
  • ✓여러 파일에 걸쳐 한 라이브러리에서 다른 라이브러리로 옮기는 경우.

스킬 링크

https://github.com/vudovn/ag-kit/blob/main/.agents/skills/batch-operations/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/vudovn/ag-kit/blob/main/.agents/skills/batch-operations/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“제 프로젝트의 모든 파일에서 getUser 함수를 fetchUser로 이름 바꿔 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

이 스킬은 먼저 조건에 맞는 모든 파일을 찾아 변경 사항을 미리 보여 줍니다. 그다음 같은 바꾸기를 해당 파일들에 적용합니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Batch Operations — Multi-File Changes

Apply consistent changes across many files at once. One pattern, many targets.

When to Use

✅ Good for:

  • Renaming a function/component across all files that use it
  • Adding an import to every file in a directory
  • Updating version numbers across package files
  • Applying the same code pattern to multiple similar files
  • Migrating from one API to another across the codebase
  • Adding/removing a field from all similar data structures

❌ Not for:

  • Single-file edits (use direct editing)
  • Unique changes per file (handle individually)
  • Changes that need per-file judgment (use an agent per domain)

Batch Operation Protocol

Step 1: Define the Pattern

What:     [exact text/pattern to find]
Replace:  [exact replacement text]
Scope:    [file glob pattern, e.g., "src/**/*.tsx"]
Exclude:  [files to skip, e.g., "**/*.test.tsx"]

Step 2: Preview Before Executing

# Find all affected files FIRST
grep -rl "oldPattern" src/ --include="*.ts"

# Count matches
grep -rc "oldPattern" src/ --include="*.ts" | grep -v ":0$"

# Show context for each match
grep -rn "oldPattern" src/ --include="*.ts"

🔴 NEVER batch-modify without previewing first. Show the user what will change.

Step 3: Execute the Batch

For text replacements:

# On Linux/macOS
find src -name "*.ts" -exec sed -i 's/oldPattern/newPattern/g' {} +

# On Windows (PowerShell)
Get-ChildItem -Path src -Recurse -Filter *.ts |
  ForEach-Object { (Get-Content $_) -replace 'oldPattern','newPattern' | Set-Content $_ }

For structural changes (adding imports, wrapping code):

  • Use the Edit tool on each file
  • Process files in a consistent order (alphabetical or by dependency)

Step 4: Verify the Batch

# Confirm no missed instances
grep -rl "oldPattern" src/ --include="*.ts"
# Should return empty

# Confirm replacements are correct
grep -rn "newPattern" src/ --include="*.ts" | head -5

# Run tests to catch breakage
npm run test
npm run build

Common Batch Patterns

Operation Command Pattern
Rename import Find all import { X } → replace with import { Y }
Update version Find "version": "1.0" → replace across all package.json
Add export Append export { X } to all index files
Remove deprecated Find deprecatedFn() → replace with newFn()
Add header Prepend license header to all source files
Type migration Find interface X → replace with type X =

Safety Rules

  1. Preview first — always show affected files before modifying
  2. Git safety — ensure clean working directory (git stash or commit first)
  3. Exclude tests — often tests need different treatment than source
  4. Verify after — run build + tests after every batch operation
  5. Report changes — list every file modified with change summary
자주 묻는 질문

파일이 바뀌기 전에 일치하는 항목을 검토할 수 있나요?

네. 영향받는 모든 파일을 볼 수 있도록 미리 보기 단계를 먼저 거칩니다.

파일 하나만 바꿀 때도 유용한가요?

아닙니다. 스킬도 설명하듯, 파일 하나라면 직접 수정하는 것이 더 간단합니다.

파일마다 판단이 필요한 변경도 되나요?

아닙니다. 이런 경우는 한 파일씩 처리하는 것이 낫다고 스킬이 설명합니다.

상세 정보

작성자의 원본 설명

Apply operations across multiple files simultaneously. Pattern-based bulk modifications, search-and-replace across codebases, consistent changes to many files at once.

repo: vudovn/ag-kit

인기도

GitHub 스타
8.2k
순위
#12525
라이선스
MIT
업데이트
2026. 10. 18.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬