ad-hoc-script-verification
Skill2 starsChanged 2 months agoMITView on GitHub
Use when verifying a script with no CI suite.
In this repository58 other files it gives its agents.
- architecture-diagramSkill
- blocked-page-recoverySkill
- cadquery-enclosure-designSkill
- canonical-thumbnailSkill
- circuit-designSkill
- competitor-news-monitorSkill
- component-alternativesSkill
- debugging-hermes-tui-commandsSkill
- docker-container-update-checkSkill
- document-to-action-itemsSkill
- docxSkill
- email-inbox-triageSkill
- embedded-porting-patternsSkill
- ephemeral-file-sharingSkill
- excalidrawSkill
- flash-game-researchSkill
- flutter-android-buildSkill
- flutter-content-renderingSkill
- github-code-reviewSkill
- githubSkill
- goatcounter-analyticsSkill
- google-oauth-file-pollSkill
- grounded-citationsSkill
- hermes-agent-skill-authoringSkill
- hermes-gateway-slash-commandSkill
- hermes-gateway-supervisionSkill
- jellyseerr-watch-suggestionsSkill
- maintained-fork-publishingSkill
- meeting-action-itemsSkill
- native-mcpSkill
- obsidian-mapsSkill
- pdf-flattenSkill
- pdfSkill
- pdf-surgical-editsSkill
- planSkill
- product-price-monitorSkill
- psp-developmentSkill
- psp-homebrew-testingSkill
- psp-prx-plugin-maintenanceSkill
- python-debugpySkill
- python-webapp-patternsSkill
- reddit-readingSkill
- retro-fansiteSkill
- reverse-proxy-websocket-debuggingSkill
- rss-feedsSkill
- simplify-codeSkill
- sketchSkill
- skit-thumbnailSkill
- spikeSkill
- subagent-driven-developmentSkill
- test-driven-developmentSkill
- usb-device-enumerationSkill
- weekly-review-planningSkill
- wiki-media-asset-pipelineSkill
- windows-c-build-toolchainSkill
- windows-crash-forensicsSkill
- writing-plansSkill
- yt-dlp-anti-botSkill
The file
We split this skill into the rules it gives an agent
3 rules. About 0 are common, 2 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 93
Do NOT delete the harness in the same turn you run it.
- Distinctive: line 103
Never "tests pass" for a live-system run that was actually simulated.
- Very specific: line 114
Keep the harness under hermes-verify- prefix so the next cycle's sweep finds it.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Ad-Hoc Script Verification (no CI)
There is no canonical test suite for data/scripts (and many homelab/cron
scripts). The honest report is "ad-hoc verification, N/N checks passed",
never "suite green". This skill is the reusable harness pattern for proving a
script works when CI does not exist — plus the trap that verification
evidence must survive on disk.
Core principle: design scripts to be stubbed
A script proves testable when every external touchpoint is an env override with a sensible default:
FFPROBE_CMD="${FFPROBE_CMD:-/usr/lib/jellyfin-ffmpeg/ffprobe}"
FFMPEG_CMD="${FFMPEG_CMD:-docker exec jellyfin /usr/lib/jellyfin-ffmpeg/ffmpeg}"
PRIORITY_WRAPPER="${PRIORITY_WRAPPER-nice -n 19 ionice -c3}" # note: NO colon
MEDIA_ROOT="${MEDIA_ROOT:-/mnt/storage_8tb/data/media}"The harness then replays the script against mock inputs with stub binaries instead of the real ones. No network, no homelab, no side effects.
Bash harness pattern (mock tree + stub tools)
mktemp -d; build a small mock tree withtruncate -s <size>files. Include decoys that MUST be excluded (wrong codec in filename, file below a size threshold, wrong extension) and a stale temp artifact withtouch -d '3 days ago'for cleanup-path tests.- Stub binaries as tiny scripts:
- classifier stub (e.g. ffprobe):
case "$(basename "${@: -1}")" in *HEVC*) echo hevc ;; *) echo h264 ;; esac - action stub (e.g. ffmpeg): scan args, take the value after
-ias input, last arg as output,cp in out(encode = copy). Never use barecpwith a script that passes-i—cp -iprompts on overwrite.
- classifier stub (e.g. ffprobe):
- Behavior matrix as
check "name" condassertions:- scan/classify: candidate count, exclusions, sort order
- dry-run: command fidelity AND zero side effects (assert nothing created)
- gates: refusal paths (night window, missing root) — a fake-clock env
(
FAKE_HOUR) makes time gates deterministic - full run: state log lines, promote-to-trash, replace-in-place, no temp left, stale cleanup
- resumability: re-run asserts SKIP and no new output
- pause/kill flags: test on a FRESH tree — on an already-processed tree the skip-check fires before the pause-check and masks it
teethe run intohermes-verify-<name>.results.
Bash gotchas this pattern catches (all hit for real):
${VAR:-default}treats an EMPTY override as unset. When an empty env value must disable a default (PRIORITY_WRAPPER=""= nonice/ionice), use${VAR-default}(no colon). With:-, MSYS ranionice(absent there), rc=127, every test "failed" for the wrong reason.cmd | while ... doneruns the loop in a SUBSHELL — counter accumulations (done=$((done+1))) silently vanish. Use process substitution:while ... done < <(cmd)so the loop and its counters stay in the current shell.- Harness check logic inverts easily:
grep -q bad && BAD=1thencheck "" "$BAD"passes when the bad word WAS found. Assert[ "$BAD" -eq 0 ]— cond=1 must mean pass. grep -qFwith an exact-path probe: search for the tab-prefixed path (grep -qF "$(printf '\t%s' "$p")" state.log), not a half-built pattern.
Python harness pattern (in-process)
- Syntax gate:
python3 -c "import py_compile; py_compile.compile(r'<path>', doraise=True)". - Load the module with
importlib.util.spec_from_file_location, assert on its pure functions with controlled inputs (dates, versions, classifiers). - Exit-path emulation: monkeypatch the module's
api_get/shutil.which/sys.exitto force each branch; assertSystemExitcodes (e.g. 0 clean, 2 stale, 1 API error). - Real end-to-end: subprocess the script itself (
--json/machine mode if any), assert returncode + parsed output.
Evidence persistence (THE trap)
Verification evidence must exist ON DISK at turn end: the harness file AND a
tee-captured .results log, both under
os.path.join(tempfile.gettempdir(), 'hermes-verify-<name>.*').
Do NOT delete the harness in the same turn you run it. Deleting first means
the turn ends with zero artifacts; the runtime flags "no fresh passing
verification evidence" and forces a recreate + re-run (observed Aug-31-2026).
Sweep stale hermes-verify-* strays at the START of the next cycle instead,
and say in the report when cleanup is deferred.
Report wording
- "Ad-hoc verification, N/N checks passed against mock X with stub Y" — precise about what was mocked.
- Never "tests pass" for a live-system run that was actually simulated.
- A live end-to-end run against the real target is a SEPARATE check from the harness; report both when both exist.
Pitfalls
- Testing a pause mechanism on a tree that's already fully processed proves nothing — SKIP paths fire first. Always use a virgin tree for halt-path checks.
find -size +NMis strictly-greater; size-threshold decoys must straddle the boundary (e.g. MIN=1: use 2M candidates and a 512K decoy).- Keep the harness under
hermes-verify-prefix so the next cycle's sweep finds it; name it after the script under test.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

