# Phase 3-4: Execute & Verify

## Group Files into Batches

- Maximum 3 files per batch
- Group by related functionality when possible

## Launch Snipper Agents in Parallel

For EACH batch, use Task tool with `subagent_type='Snipper'`:

```
Using the instructions in .claude/tasks/refactor-{id}/instructions.md, refactor these files:
- {file_1}
- {file_2}
- {file_3}

Read the instructions file first, then apply the refactor to each file.
```

**CRITICAL**: Launch ALL batches in a SINGLE message with multiple Task calls.

## Wait for Completion

- All Snipper agents run in parallel
- Collect results from each

## Validate Changes

```bash
# For TypeScript/JavaScript
pnpm lint || npm run lint
pnpm tsc || npx tsc

# For .NET
dotnet build
```

Fix any errors immediately.

## Summary Report

```
Refactor Complete: {title}

Files modified: {count}
Batches executed: {count}
Errors: {count}

Modified files:
- {file1}
- {file2}
...

Next steps:
- Review changes: git diff
- Run tests: pnpm test
- Commit: /gitflow commit
```

## Execution Rules

- **PARALLEL EXECUTION**: Launch all Snipper batches simultaneously
- **SINGLE INSTRUCTION FILE**: One instructions.md for all batches
- **MAX 3 FILES PER BATCH**: Keep Snipper agents focused
- **VALIDATE AFTER**: Run lint/typecheck after all batches complete
- **PRESERVE FUNCTIONALITY**: Never break existing behavior
