From auto-claude-skills
Bulk file operations using claude -p with manifest, dry-run, and log-based retry. Use when transforming, migrating, or refactoring many files at once.
npx claudepluginhub damianpapadopoulos/auto-claude-skillsThis skill uses the workspace's default tool permissions.
Structured protocol for bulk file operations using `claude -p`. Teaches a safe, resumable pattern — not a framework.
Generates design tokens/docs from CSS/Tailwind/styled-components codebases, audits visual consistency across 10 dimensions, detects AI slop in UI.
Records polished WebM UI demo videos of web apps using Playwright with cursor overlay, natural pacing, and three-phase scripting. Activates for demo, walkthrough, screen recording, or tutorial requests.
Delivers idiomatic Kotlin patterns for null safety, immutability, sealed classes, coroutines, Flows, extensions, DSL builders, and Gradle DSL. Use when writing, reviewing, refactoring, or designing Kotlin code.
Structured protocol for bulk file operations using claude -p. Teaches a safe, resumable pattern — not a framework.
Build the full file list FIRST. Show it to the user. Get explicit approval before proceeding.
# Session-scoped working directory — prevents concurrent session collisions
BATCH_DIR=$(mktemp -d /tmp/agent-batch-XXXXXX)
# Generate manifest — adapt the glob/grep to the specific task
find src -name "*.ts" -not -path "*/node_modules/*" > "$BATCH_DIR/manifest.txt"
echo "Found $(wc -l < "$BATCH_DIR/manifest.txt") files. Review the list:"
cat "$BATCH_DIR/manifest.txt"
Never skip manifest review. The user must see and approve the file list.
Process 2-3 representative files first. Show full diffs. Get user approval before the full run.
# Pick representative files (first, middle, last)
head -1 "$BATCH_DIR/manifest.txt" | xargs -I{} claude -p "Transform {} as follows: [PROMPT]. Output ONLY the transformed file content." > "$BATCH_DIR/dry-run-output.txt"
diff /path/to/original "$BATCH_DIR/dry-run-output.txt"
If the dry run does not look right, adjust the prompt and re-run. Do NOT proceed to the full batch with a bad prompt.
Loop over the manifest. Log pass/fail per file. Use atomic writes (write to .tmp, then move).
while IFS= read -r file; do
if claude -p "Transform $file as follows: [PROMPT]. Output ONLY the file content." > "${file}.tmp" 2>/dev/null; then
mv "${file}.tmp" "$file"
echo "OK: $file" >> "$BATCH_DIR/results.log"
else
rm -f "${file}.tmp"
echo "FAIL: $file" >> "$BATCH_DIR/results.log"
fi
done < "$BATCH_DIR/manifest.txt"
After the batch, check the log. Re-run only the failures.
# Check results
echo "Results:"
grep -c "^OK:" "$BATCH_DIR/results.log"
grep -c "^FAIL:" "$BATCH_DIR/results.log"
# Retry failures
grep "^FAIL:" "$BATCH_DIR/results.log" | cut -d' ' -f2 > "$BATCH_DIR/retry.txt"
# Re-run step 3 with $BATCH_DIR/retry.txt as input
After the full batch completes, run the project's test suite and linter. Review the full git diff.
# Run tests
[project test command]
# Review scope of changes
git diff --stat
git diff # full diff for review
# Clean up session directory
rm -rf "$BATCH_DIR"
For 100+ files, process in chunks of 20. Pause between chunks for user confirmation.
split -l 20 "$BATCH_DIR/manifest.txt" "$BATCH_DIR/chunk-"
for chunk in "$BATCH_DIR/chunk-"*; do
echo "Processing chunk: $chunk ($(wc -l < "$chunk") files)"
# Run step 3 loop on this chunk
echo "Chunk complete. Continue? [y/n]"
done
grep FAIL is your resume mechanism.claude -p handles its own rate limiting. If you hit limits, reduce chunk size or wait.wc -l "$BATCH_DIR/results.log" tells you where you are.verification-before-completion after batch completesdispatching-parallel-agents instead