Agent skill

shebangpython

Validates Python shebangs and PEP 723 inline script metadata. Use when creating or validating standalone executable Python scripts. Ensures shebang matches script type.

Stars 33
Forks 4

Install this agent skill to your Project

npx add-skill https://github.com/Jamie-BitFlight/claude_skills/tree/main/plugins/python-engineering/skills/shebangpython

SKILL.md

Shebang & PEP 723 Validation

Validate the shebang for ALL Python scripts based on their dependencies.

Input

File: $ARGUMENTS

Rules

Script Type Shebang PEP 723
Stdlib-only #!/usr/bin/env python3 None (nothing to declare)
With dependencies #!/usr/bin/env -S uv --quiet run --active --script Required (lists deps)
Package executables #!/usr/bin/env python3 None (deps via package manager)
Library modules No shebang None

Actions

  1. Analyze imports to determine dependency type
  2. Correct shebang if wrong
  3. Add PEP 723 metadata if external deps detected
  4. Remove PEP 723 metadata if stdlib-only
  5. Set execute bit if needed

Didn't find tool you were looking for?

Be as detailed as possible for better results