Rules vs Skills vs Commands vs Hooks

Ok, I get rules as they’ve been around for a while - but after looking through the settings after a recent update - what the hell?

We now have Rules (user / project split is a nice UI touch), Skills, Commands, and separately Hooks.

I have zero idea of the differences or potential use-cases for these

1 Like

There are some good videos on youtube about it. I don’t think hooks are standardized across AI coding tools so would only work in Cursor, I think. I think they allow you to interrupt the Agent during its tasks for custom behavior, like injecting content.

1 Like

edit: i just tested the glob scoping and it’s worth calling out. if you create a rule like:

---
globs: ["*.tsx"]
alwaysApply: false
---
Always add a data-testid to root elements

that rule only fires when the agent is working on .tsx files. i asked it to create the same component as both .tsx and .js, and the .tsx version got the data-testid, the .js one didn’t. the glob scoping actually works.

for comparison, if you put the same instruction in AGENTS.md (no frontmatter, just the text), it applies to everything. there’s no way to scope it to specific file types. so if you need rules that only kick in for certain files, .mdc with globs is the way to go.

yeah i feel this. i’ve been using rules files for a while now and they work, but every time cursor updates there’s some new layer on top and i’m never sure if i should migrate to it or keep doing what works.

skills and commands seem like they’re aimed at more structured workflows? like if you want the agent to run specific tools or follow a multi-step process. rules are more “here’s how i want you to write code.” at least that’s my read on it but i haven’t actually tried skills yet so i might be off.

hooks i genuinely don’t understand the use case for. if anyone’s using them i’d love to hear what for.