feat(skills): make skill scripts self-executing with uv hashbang

The Python scripts in mpi-pptx-translate, mpi-pdf-to-docx-conversion, and
mpi-chinese-text-normalize previously required users to type
manually. That is easy to forget and adds friction every time the skill runs.

Switch all four scripts to a  shebang,
so they can be invoked directly: . The
 PEP 723 metadata blocks remain, so uv still installs the
dependencies automatically. Also made the scripts executable and updated
their usage messages and SKILL.md instructions to match the direct-execution
style.
This commit is contained in:
iacore
2026-07-15 13:05:34 +08:00
parent 894d769051
commit bc17471635
7 changed files with 25 additions and 22 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
@@ -77,6 +78,6 @@ def build(yaml_path, src_path, out_path):
if __name__ == "__main__":
if len(sys.argv) != 4:
print("Usage: uv run build.py <strings.yaml> <input.pptx> <output.pptx>", file=sys.stderr)
print("Usage: ./build.py <strings.yaml> <input.pptx> <output.pptx>", file=sys.stderr)
sys.exit(1)
build(sys.argv[1], sys.argv[2], sys.argv[3])
+2 -1
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.9"
# dependencies = [
@@ -71,7 +72,7 @@ def extract(pptx_path):
if __name__ == "__main__":
if len(sys.argv) != 3:
print("Usage: uv run extract.py <input.pptx> <output.yaml>", file=sys.stderr)
print("Usage: ./extract.py <input.pptx> <output.yaml>", file=sys.stderr)
sys.exit(1)
entries = extract(sys.argv[1])
with open(sys.argv[2], "w") as f: