When should you use it?
- The agent repeats the same mistakes
- You approve too many commands by hand
- You already use a linter
Not for: Projects with no linting; Teams that cannot maintain custom rules
What do you need, and what do you get?
You need
- Linter and hook settings
- List of past mistakes
- Command rules
You get
- Custom rules with tests
- Lint after each edit
- Automatic command approvals
How does it work, step by step?
- Hook the linterRun lint after each file the agent writes or edits.
- Catch a mistakeWhen it does something wrong, describe it.
- Write a ruleHave the agent write a rule plus unit tests, with a message saying what to do instead.
- Parse commandsRun a pre-command script that approves, rejects or asks.
- Learn from asksWhen it asks, find out why and add a rule.
The prompt
Our own prompt, inspired by gojkoa on Hacker News and written to work in Claude Code. Values in lime are placeholders.
Fill in the blanks (optional; the copied prompt uses your values)
You just made this mistake: {mistake}. Write a custom lint rule that catches it, with unit tests showing a failing and a passing example.
The rule's error message must say what to do instead. Do not change other rules. Run the tests and show me the result.Inspired by gojkoa on Hacker News: Comment in Ask HN: Any Software Engineers here who enjoy their AI-native dev workflow?. The prompt above is written by playbooks.bot in our own words; nothing from the original is quoted.
What can go wrong?
- Thousands of rules need upkeep; test them.
- Rules without helpful messages leave the agent guessing.
- A parser can miss tricky shell syntax; keep risky commands on ask.
Our take
Prompts are suggestions; linters are enforcement. gojkoa's approach takes that difference seriously. Each time an agent makes a mistake, the response is not a longer instruction file but a rule that will catch the same error forever, and the agent itself writes the rule along with tests proving it works. Over time this turns a frustrating pattern of repeated errors into an accumulating safety net, which is why the rule count has grown so large. Running the linter as a hook after every edit means problems surface while the agent still has context to fix them. A clear message with each failure, saying what to do instead, saves a round of guessing. The command checker applies the same idea to shell use, approving safe commands, blocking dangerous ones and asking about the rest, which reduces the approval fatigue that leads people to click yes on everything. Start small: take five mistakes from last month, turn each into a rule with a test, and add more only as new mistakes appear.
Where the time goes back: Mistakes get fixed once instead of every session, and approvals stop interrupting you.
FAQ
Why not rules in the prompt?
What does the regulator do?
Source and credit
Inspired by gojkoa on Hacker News. We describe the idea in our own words, link to the original, and wrote the prompt ourselves; nothing is quoted.
- Inspired by
- Comment in Ask HN: Any Software Engineers here who enjoy their AI-native dev workflow?
- Creator
- gojkoa on Hacker News
- Published on
- Hacker News
- Original date
- Sep 6, 2026
- License
- Not openly licensed (the poster keeps all rights), so we quote nothing and link to the original
- Originally for
- Claude Code
- AI dry run
- Oct 23, 2026: passed. Dry-run tested by our AI test agent on sample input. PASS: Gates held on desk check; no live sends, bookings or purchases.
AI dry run on sample data; not run with live connected accounts. The playbooks.bot test agent filled the prompt with synthetic inputs, produced the output and checked it against the page's stated outputs and guardrails. - Verified
- Oct 23, 2026: source link resolves to the original, the credited creator published it, our excerpt or prompt matches it, and the license allows our use.
Are you the creator? Claim or correct this page.