Lessons from real cron jobs that went wrong. Apply these when authoring or editing cron job prompts via cronjob(action='create') or cronjob(action='update').
LLM agents generating files will pattern-match existing directory structures and "helpfully" create files where they shouldn't. If a cron prompt says "write to auto/" but the agent sees a sibling curated/ directory with similar files, it may create files in curated/ too — even though the prompt never asked for it.
Wherever the prompt tells the agent to write a file, add an explicit "DO NOT" immediately after:
3. Write the auto-weekly retro to retros/auto/YYYY/YYYY-WXX.md ...
⚠️ DO NOT write anything to retros/curated/. That directory is reserved for Joseph's hand-written retros only.
1. Name the exact output path — not a directory, the full file pattern (auto/YYYY/YYYY-WXX.md).
2. Add a ⚠️ DO NOT guard for every sibling directory the agent could see but should never write to.
3. State who owns the forbidden path — "reserved for Joseph's hand-written X" is stronger than "don't write there."
4. Review the prompt from the agent's perspective — if you removed the negative constraint, would the agent still only write to the right place? If not, the guard is necessary.
Bad:
> Write the weekly retro to retros/auto/YYYY/YYYY-WXX.md.
Good:
> Write the weekly retro to retros/auto/YYYY/YYYY-WXX.md.
>
> ⚠️ DO NOT write anything to retros/curated/. That directory is reserved for Joseph's hand-written retros only.
monthly/, quarterly/, yearly/ subdirectories and decides to generate those too, even if the prompt only asked for weekly. Add: "Generate ONLY the weekly file. Do not create monthly, quarterly, or yearly files."