logoalt Hacker News

JohnnyMarcone • yesterday at 6:52 PM • 1 reply • view on HN

Can you share more about the guardrails you have to keep AI in check?


Replies

Merad • today at 2:13 AM

This repo I started yesterday has most of the patterns I like to use: https://github.com/mbcrawfo/SqlSource

Really the single biggest piece I use today is using a tool like superpowers to ensure your task is well defined. Added bonuses are its TDD implementation skills and multiple review steps baked into the workflow. Before I discovered superpowers I was manually telling claude to do these workflows, the plugin makes it easy.

In the repo itself:

* Keep agents.md focused; claude likes to really bloat it by default. The "Adding guidance for AI agents" rules go into every project and have worked pretty well.

* Aggressively use nested agents.md files. Focused rules located where they're relevant seem to do much better than having a large whole-project rule dump in the root agents.md.

* Recently I've started using the tech debt and deferred work documentation rules. Claude frequently decides on its own that some piece of functionality or issue is "deferred until later" or "out of scope". These rules help make it clear so that you can make it fix the item or at least have it documented for a followup session.

* Have it test all the things. Most of my personal projects with claude have about a 3:1 ratio of test:application code and high coverage. Claude make it easy to build test harnesses for things that most of us wouldn't have bothered with 5 years ago.

* Strict type checking, linting, static analysis, warnings as errors, etc. Anything you can turn on or add to block questionable code, do it.

* Use a claude pre-tool hook to run all of your checks before you allow a git commit command. Left on its own it can and will decide that it has a valid reason to bypass git commit hooks (husky) to commit broken code or tests.