~/agent-config
Browse
Hook

Format on Save Hook

Runs Prettier (or your formatter) automatically after the agent edits a file, so every change lands already formatted. Drop into your Cursor hooks.json.

#hooks #formatting #prettier #automation

Snippet

{
  "version": 1,
  "hooks": {
    "afterFileEdit": [
      {
        "command": "npx prettier --write \"$CURSOR_FILE_PATH\""
      }
    ]
  }
}

Where it installs

Default config location for each supported agent.

Best for

CursorGeneralDevops

Related resources

Setting

Prettier + ESLint Preset

A sane Prettier config plus the ESLint integration so formatting and linting never fight. Drop into your project root and let the agent follow it.

#settings #prettier #eslint +1

Cursor, Claude Code, Windsurf +3

Details
Hook

Sample Hooks Config

Example Cursor hooks.json for running scripts on agent events like before shell commands or after file edits.

#hooks #automation #cursor

Cursor

Details