Skip to main content
skill CX Codex

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.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add spencerpauly/awesome-cursor-skills --skill suggesting-cursor-hooks -a claude-code
Open on GitHub

What 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-code

2Manually: put the files in place

~/.claude/skills/suggesting-cursor-hooks/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/suggesting-cursor-hooks/

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

Similar skills

All skills for Agent setup: memory, context, orchestration →

From the same set60

api-smoke-testing Finds API endpoints across your codebase, spins up the local dev server, and tests every route with curl. Spots unmounted 404 routes and 500 server crashes before release. CX Codex +1 495installs saving-workspace-context The skill writes research, decisions and templates into your workspace files, so the next session starts with context instead of a blank slate. CX Codex +1 495installs codebase-onboarding Fires five explore subagents in parallel to cover architecture, data models, APIs, auth and deployment, then merges their findings into one onboarding doc. CX Codex +1 476installs auditing-performance A skill that audits app performance: bundle size, rendering, database queries and Core Web Vitals. Useful when pages load slowly or the UI stutters. CX Codex +1 476installs building-skills-from-patterns Turns repeated multi-step workflows into reusable SKILL.md files. It triggers when an agent re-derives the same routine or needs the same user correction three times. CX Codex +1 466installs creating-pr A skill that walks the agent through opening a pull request: branch prep, title, structured description, self-review and reviewer requests. CX Codex +1 465installs database-design Designs relational database schemas, foreign keys, indexes, and constraints from raw requirements, with output tailored for SQL, Prisma, or Drizzle. CX Codex +1 462installs parallel-exploring Launches several explore subagents at once so you can map a large codebase fast. Useful for onboarding and for tracing a feature across layers. CX Codex +1 459installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor