my 1st response to TLDR - Prompts don't scale. MCPs don't scale. Hooks do.

reddit/nsg8v4k

First of all, I don't really like concept of "Explanation" so I will be raw and show my code. Ask your LLM for detailed explanation if you need.

(and also I really don't like Reddit input panel for code sharing... don't allow me to share code)

How exactly does the hook "detect that the AI accessed the model directly?"

  • regexps (for now) to not to make iteration slow (AST is little heavy)

  • And also don't write by yourself, let AI do it when required

  • My approach is like "be stiff then extend"

How exactly do you force intent? Are you doing a blocking hook?

  • Yes, blocking - even some time just awareness blocking like at first read I give architecture to AI then allow the seconds read (like this experiences that forces AI to use my tool)

Hook in Action

Here is the one of the experience

noMagicNumber Rule

Here is code of it:

TypeScript Examples

for now: I can share one of my typescript examples, these ones for DETERMINISM to catch mistakes BEFORE runtime

noHardcodedPath Rule

noNullUnion Rule

Ask me more if you want to explore..

Last updated

Was this helpful?