- Home
- Skills
- Productivity
- Script Generator
Productivity
Script Generator
Generate shell or Python scripts for any development workflow in seconds.
Beginner Free Published: April 15, 2026
Compatible Tools claude-codechatgptgeminicopilotcursorwindsurfuniversal
The Problem
Writing utility scripts from scratch takes time — you need to handle argument parsing, error cases, edge conditions, and cross-platform quirks. Most scripts follow similar patterns, but developers rewrite them from memory each time, introducing subtle bugs and missing error handling.
The Prompt
You are a senior DevOps engineer who writes bulletproof utility scripts. Generate a script based on my requirements.
SCRIPT REQUIREMENTS:
- Purpose: [what the script should do]
- Language preference: [bash / python / node — or let AI choose]
- Input: [what the script receives — files, arguments, stdin]
- Output: [what the script produces — files, stdout, side effects]
- Error scenarios: [what could go wrong]
SCRIPT STANDARDS:
1. Include a usage/help message triggered by --help
2. Validate all inputs before processing
3. Use meaningful exit codes (0 = success, 1 = user error, 2 = system error)
4. Add color-coded output for success/warning/error
5. Support both interactive and piped usage
6. Include a header comment with purpose, usage, and examples
7. Follow the language best practices and style conventions
Generate the complete, production-ready script.
Example Output
#!/usr/bin/env python3
"""Find and report duplicate files by content hash.
Usage: python find-dupes.py ./src --min-size 1024
"""
import argparse, hashlib, sys
from pathlib import Path
from collections import defaultdict
def hash_file(path, chunk=8192):
h = hashlib.sha256()
with open(path, "rb") as f:
while chunk_data := f.read(chunk):
h.update(chunk_data)
return h.hexdigest()
def main():
parser = argparse.ArgumentParser(description="Find duplicate files")
parser.add_argument("directory", type=Path)
parser.add_argument("--min-size", type=int, default=0, help="Min file size in bytes")
args = parser.parse_args()
hashes = defaultdict(list)
for p in args.directory.rglob("*"):
if p.is_file() and p.stat().st_size >= args.min_size:
hashes[hash_file(p)].append(p)
dupes = {h: paths for h, paths in hashes.items() if len(paths) > 1}
for h, paths in dupes.items():
print(f"\n\033[93mDuplicate group ({len(paths)} files):\033[0m")
for p in paths:
print(f" {p}")
print(f"\n{len(dupes)} duplicate groups found." if dupes else "\nNo duplicates found.")
if __name__ == "__main__":
main()
When to Use
Use this skill whenever you need a utility script — file processing, data transformation, build helpers, deployment automation, or dev environment setup. Faster than writing from scratch with proper error handling included.
Pro Tips
- Specify the language — Bash for file ops and CLI glue, Python for data processing, Node.js for JS ecosystem tasks.
- Include edge cases in your prompt — mention empty directories, permission errors, or special characters so the AI handles them.
- Always request a dry-run flag — it saves you from destructive mistakes on the first run.