agentleFS
Seriora-ResearchSeriora-Research/seri-agent/.cursor/rules/hooks.mdc

seri-agent / rules

Cursor rule0 starsChanged 2 months agoApache-2.0View on GitHub

Hook authoring rules for remaining Cursor hooks.

The file

Files
hooks.mdc
---
description: Hook authoring rules for remaining Cursor hooks.
globs: .cursor/hooks/**,.cursor/hooks.json
alwaysApply: false
---

# Hook authoring rules

`hooks.json` only wires `block-dangerous` (beforeShellExecution) and
`block-env-read` (beforeReadFile). Those two are the product's hook-interop
reference, not a conductor. Do not re-add engineering-loop hooks
(`goal-audit-gate`, `log-trajectory`, `protect-loop-core`, `verify-gate`,
`record-session`, `format-and-typecheck`). See
[0014](../../docs/decisions/0014-pstack-only-no-engineering-loop.md).

## Hook input arrives as JSON on stdin

Cursor delivers the payload on stdin, not as environment variables. Scripts must
`ConvertFrom-Json` / parse stdin. A hook that only reads `$env:SOMETHING` is a
no-op.

## `.cursor/hooks/*.ps1` must be ASCII-only

Windows PowerShell 5.1 decodes a `.ps1` with no BOM as cp1252, so a non-ASCII
character inside a string literal breaks the script.

## Do not chain `bash || pwsh`

A failing bash script with a missing `pwsh` would hide the real exit code.
`hooks.json` calls each `.ps1` via `powershell -File`. `grep -c '||' .cursor/hooks.json`
returns 0 and must stay 0.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.