← Browse by Chapter
Get the Book →
#55Check no test file is empty
I'm launching a long-running session for [describe task — e.g., "migrating 63 files from ORM v1 to v2"]. Write a Stop hook script that validates the output before the session exits. The hook should check: (1) [primary validation — e.g., "schema consistency across all migrated files"], (2) [secondary validation — e.g., "no empty or boilerplate-only files"], (3) [integration check — e.g., "the test suite still passes"]. Output the shell script and the `.claude/settings.json` entry to register it.

Mastering Claude Code
These prompts are excerpts from the book. Get the full collection with explanations and use cases.