suggesting-cursor-hooks — Cursor skill: what it does, how to install
Watches for repetitive check requests and suggests automating them with Cursor hooks. Useful when you find yourself repeatedly asking the agent to run linters or tests.
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a claude-codeWhat suggesting-cursor-hooks does
This skill operates in the background with user-invocable: false, so you do not invoke it manually. It monitors your workflow and triggers when you ask for the same validation check twice or tell the assistant to always run checks after editing.
Once you confirm the suggestion, the agent generates or updates .cursor/hooks.json and writes shell scripts to .cursor/hooks/. It supports afterFileEdit for tasks like eslint --fix or tsc --noEmit, beforeShellExecution to safeguard .env secrets, and stop for quick build verifications. Existing configurations are merged rather than overwritten.
Scripts must finish within 5 seconds. Otherwise, the agent feels sluggish during everyday edits. Hook scripts must exit with code 0 and send output to stdout so they never block execution unless specifically instructed.
What it helps with
- format modified files automatically using eslint --fix or prettier
- run TypeScript type checks with tsc --noEmit on change
- execute related test suites after file modifications
- protect sensitive .env files before terminal commands run
- perform a quick build check on the stop event
Example prompts for the agent
- run lint and check types
- always run tests after editing
- make sure it builds
How to install suggesting-cursor-hooks
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a claude-code2Manually: put the files in place
~/.claude/skills/suggesting-cursor-hooks/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/suggesting-cursor-hooks/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a codex2Manually: put the files in place
.agents/skills/suggesting-cursor-hooks/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a cursor2Manually: put the files in place
.cursor/skills/suggesting-cursor-hooks/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install spencerpauly/awesome-cursor-skills suggesting-cursor-hooks2Manually: put the files in place
.github/skills/suggesting-cursor-hooks/SKILL.md1Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a gemini-cli2Platform CLI
gemini skills install https://github.com/spencerpauly/awesome-cursor-skills --path resources/suggesting-cursor-hooksManually: put the files in place
.devin/skills/suggesting-cursor-hooks/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about suggesting-cursor-hooks
How do I install suggesting-cursor-hooks in Cursor?
Run npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a cursor in your terminal.
What does suggesting-cursor-hooks do?
It spots repetitive manual commands like testing or formatting and prompts you to configure automated hooks in .cursor/hooks.json.
What constraints apply to suggested hook scripts?
Scripts must execute in under 5 seconds, exit with code 0, and write output to stdout so the agent remains responsive.
Source text
SKILL.md · CC0-1.0
---
name: suggesting-cursor-hooks
description: When the user keeps asking for the same check to run (lint, tests, type-check), suggest a Cursor hook to automate it.
user-invocable: false
---
# Suggesting Cursor Hooks
Watch for repeated manual requests. When the user keeps asking you to run the same command after changes, suggest a hook to automate it.
## Triggers
Suggest a hook when you notice:
- The user asks you to **run the same check 2+ times** (e.g. "run lint", "run tests", "check types")
- The user says "always run X after editing" or "make sure to test after changes"
- You keep forgetting to run a validation step and the user catches it
- A CI failure could have been caught locally with a post-edit check
## How to Suggest
```
You've asked me to run [command] after edits a few times. Want me to
set up a Cursor hook so it runs automatically?
```
If they say yes, create `.cursor/hooks.json` and the script:
```json
{
"hooks": [
{
"event": "afterFileEdit",
"script": ".cursor/hooks/<name>.sh",
"pattern": "<glob>"
}
]
}
```
## Common Hooks to Suggest
| User keeps asking... | Hook |
|---------------------|------|
| "run lint" / "fix formatting" | `afterFileEdit` → `eslint --fix` or `prettier --write` |
| "check types" | `afterFileEdit` → `tsc --noEmit` on `.ts`/`.tsx` |
| "run tests" | `afterFileEdit` → run related test file |
| "don't touch .env" | `beforeShellExecution` → warn on secrets files |
| "make sure it builds" | `stop` → quick build check |
## Rules
- Only suggest after a real repeated pattern, not preemptively
- Hook scripts must be fast (under 5 seconds) or the agent feels slow
- Scripts should exit 0 and report via stdout — don't block the agent unless the user explicitly wants that
- Check for existing `.cursor/hooks.json` first — merge, don't overwrite
- Keep it casual — "want me to automate this?" not a formal proposal
© spencerpauly · CC0-1.0 · spencerpauly/awesome-cursor-skills