Hermes python script wrapper for shell cron

From Dirtytrii/codex-skills · View interactive version

Hermes python script wrapper for shell cron is an AI agent skill from the GitHub repository Dirtytrii/codex-skills. Diagnose and safely document Hermes cron script interpreter mismatches, especially when shell scripts are executed as Python or Python wrappers are executed as shell.

How to use this skill

Skill file

Hermes Python Wrapper for Shell Cron

Purpose

Provide a safe workflow for diagnosing Hermes cron script= interpreter mismatches. The common failure modes are shell syntax being interpreted by Python, or Python code being interpreted by shell. The default workflow only diagnoses and proposes a wrapper plan; writing wrapper files requires user approval.

When to use

Safety rules

Read-only workflow

  1. Identify the failing Hermes cron job and script path from metadata or user-provided error context.
  2. Read the error summary and classify the mismatch:
  1. Inspect cron metadata to determine how the scheduler invokes script= for that job.
  2. Inspect only the minimum safe lines of the entry script needed to identify its language and shebang.
  3. Compare the entry script language, extension, shebang, and scheduler invocation mode.
  4. Produce a wrapper plan using placeholders, without writing files.
  5. Include a verification plan that compares direct implementation execution with scheduler-style entry execution.

Evidence to collect

Stop conditions

Optional user-approved actions

Only after explicit user approval:

Generic wrapper patterns

Use these only as templates after approval.

Python entry that delegates to shell:

#!/usr/bin/env python3
import subprocess
import sys

SCRIPT = "<IMPLEMENTATION_SCRIPT>"
result = subprocess.run(["/usr/bin/env", "bash", SCRIPT] + sys.argv[1:])
raise SystemExit(result.returncode)

Shell entry that delegates to shell implementation:

#!/usr/bin/env bash
set -euo pipefail
SCRIPT="<IMPLEMENTATION_SCRIPT>"
exec /usr/bin/env bash "$SCRIPT" "$@"

Final report format

Summary: <interpreter mismatch diagnosis>
Job: <redacted job name/id>
Script: <SCRIPT_PATH>
Observed error: <safe summarized error>
Detected mismatch: <shell-as-python / python-as-shell / unknown>
Read-only evidence: <bullets>
Wrapper plan: <high-level plan with placeholders>
Verification plan: <syntax/direct/scheduler-style checks>
Needs approval before changes: yes
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.