用 Pre-commit 钩子限制 AI 生成文件体积的提示词
Matt Pocock 分享一条提示词:用 pre-commit 钩子拦截超 5000 token 的文件,迫使 Agent 拆分模块、保持代码库整洁。
Prompt of the day: Create a pre-commit hook that prevents files over 5,000 tokens. Tokens = bytes/4. Run only on staged files. Ignore files which are not authored by agents, like lockfiles or codegen. Provide explicit instructions on how to split files in the error message. The simplest investment I ever made in my codebase. So good.
