| name | python-script-developer |
| version | 1.0.0 |
| description | Write production-ready Python CLI tools, automation scripts, and batch file processors
with type hints, structured `logging` (never `print` for diagnostics), `argparse`
interfaces, `pathlib` for filesystem work, specific exception handling, and
cross-platform support (Linux, macOS, Windows). Use this skill whenever the user asks to
create a Python script, `.py` utility, CLI tool, automation, batch processor, or data
pipeline — including casual phrasings like "write a python script that ...", "automate
this in python", "I need a small tool", or "give me a one-off processor". Also use when
reviewing or hardening an existing Python script.
|
| license | MIT |
| compatibility | claude-code opencode |
| allowed-tools | ["Read","Write","Edit","Grep","Glob","Bash"] |
| metadata | {"author":"MKAbuMattar","requirements":"Python 3.9+ on Linux, macOS, or Windows. Generated scripts target the same range."} |
Python Script Developer
Production-ready Python. Type-hinted + logged + argparsed + pathlib + specific exceptions.
When to use
- The user asks for any
.py script, CLI tool, automation, or batch processor.
- The user wants to harden, refactor, or review an existing Python script.
- A task chain ends in "and put it in a python script".
Required structure
Every script you write starts from this skeleton. Do not omit type hints, the if __name__ == '__main__' guard, or the sys.exit(main()) pattern.
"""<one-line description>.
<longer description if needed>
"""
from __future__ import annotations
import argparse
import logging
import sys
from pathlib import Path
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(levelname)s %(message)s",
datefmt="%Y-%m-%d %H:%M:%S",
)
logger = logging.getLogger(__name__)
SCRIPT_DIR = Path(__file__).resolve().parent
def parse_args() -> argparse.Namespace:
p = argparse.ArgumentParser(description=__doc__)
p.add_argument("input", type=Path, help="Input file path")
p.add_argument("-o", "--output", type=Path, help="Output file path")
p.add_argument("-v", "--verbose", action="store_true", help="Enable debug logging")
return p.parse_args()
def main() -> int:
args = parse_args()
if args.verbose:
logger.setLevel(logging.DEBUG)
:
FileNotFoundError e:
logger.error(, e)
Exception:
logger.exception()
__name__ == :
sys.exit(main())