Hey, point by point:
- A ready-made repo with the full setup
There isn’t a single official canonical example. Each feature has its own docs:
-
AGENTS.md in a subdirectory equals an .mdc rule with globs
Not exactly. AGENTS.md has no frontmatter and no glob scoping. It’s loaded when the agent works with files in that directory, and it applies in full, not per file type. With.cursor/rules/*.mdcandglobs:you get finer control by extension, auto-attach, and descriptions for on-demand loading. Related thread: Agents.md isolated within a subdirectory is applied to root?. -
Style guides for Python, Java, TypeScript
Yep,.cursor/rules/*.mdcwith globs is the best approach:
.cursor/rules/python-style.mdc→globs: ["**/*.py"].cursor/rules/java-style.mdc→globs: ["**/*.java"].cursor/rules/typescript-style.mdc→globs: ["**/*.ts", "**/*.tsx"]
In a monorepo it’s the same idea, plus you can put local .cursor/rules/ inside subprojects too. More: Cursor Rules in Monorepos.
- Skills vs Hooks vs Rules
Quick version:
- Rules are style and context hints, auto-attached via globs. The model can ignore them.
- Skills are multi-step workflows you sometimes want to run. The agent may call them, or you can call them with
@. Still optional for the model. - Hooks are deterministic scripts that run on specific lifecycle events. Key difference is the model can’t ignore a hook since it runs programmatically.
Full write-up with examples: Rules vs Skills vs Commands vs Hooks.
About RTK your follow-up
Your logic is basically right. A hook gives you two things a skill won’t:
- Determinism: the command will always run on the trigger, no chance the LLM decides to do something else.
- No tokens spent on reasoning: a hook doesn’t use the model at all, it’s just a script on an event.
A skill would only work if the model remembers to call it, plus it costs tokens for reasoning and parameters. So for deterministic enforcement like formatting, linting, guards, use a hook. For an sometimes run this multi-step process workflow, use a skill.