DEV Community

Discussion on: How My Coworker Who Didn't Know 'cd' Shipped to Production

Collapse
 
mattstratton profile image
Matty Stratton

The Don't do git push in Claude.md is stopped by the hook. So why keep it in Claude.md?

Yeah I think I didn’t write that part of the post very clearly; that’s exactly correct and it shouldn’t be there. It started there for me/us and then it became apparent that didn’t work.

And the CLAUDE.md doesn’t say “don’t push to main” it says “don’t push to origin directly/try to make up your own way of doing PRs, use the skill”. And guess what, it still sometimes doesn’t use the skill. But it’s not the end of the world if it doesn’t use the skill; it just isn’t as good. Many of the things the skill does (from a safety perspective) will be done by the CI as well; but having the agent do them before the push saves having the CI then fail it, and wasting the time.

The critical safety thing that cannot be done differently is the pushing to the wrong branch, that's why that one is a hook and I think what I was trying to illustrate by the golden rules was almost a little bit of irony that it's called a golden rule and that's almost the most direct way to refer to them in something like a Claude.md. Even then they can get bypassed so that's why things are layered.