tamirs-superpowers / rules
Cursor rule2 starsChanged 4 months agoMITView on GitHub
Constraints and patterns for editing hook scripts — use when modifying hooks/*.sh or hooks/hooks.json
Where files are headingNew Cursor rule files have more rules about planning and tracking tasks, and fewer about code style.
Of the Cursor rule files we read, the 1,533 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .cursor/rules/commit-conventions.mdcCursor rule
- .cursor/rules/cross-platform-handoff.mdcCursor rule
- .cursor/rules/dev-files-workspace.mdcCursor rule
- .cursor/rules/gh-cli-preference.mdcCursor rule
- .cursor/rules/github-repository-policy.mdcCursor rule
- .cursor/rules/git-worktree-agent-workflow.mdcCursor rule
- .cursor/rules/plugin-structure.mdcCursor rule
- .cursor/rules/plugin-version-bump.mdcCursor rule
- .cursor/rules/skill-frontmatter.mdcCursor rule
- .cursor/rules/skill-quality-standards.mdcCursor rule
- .cursor/rules/skills-guide.mdcCursor rule
- .cursor/rules/user-facing-script-standards.mdcCursor rule
- run-tamirs-superpowersSkill
- field-notebook-uiSkill
- diagnose-refusalSkill
- targeted-debugSkill
- decisionSkill
- deliver-devSkill
- orchestrate-devSkill
- plan-devSkill
- pr-devSkill
- start-devSkill
- switch-devSkill
- worker-devSkill
- changelog-reviewSkill
- dark-terminal-docSkill
- docs-reviewSkill
- platform-syncSkill
- mcp-builderSkill
- mcp-paginationSkill
- cleanupSkill
- github-policySkill
- multi-agent-repoSkill
- repo-scaffoldSkill
- repo-standardsSkill
- capture-configSkill
- find-skillSkill
- notify-setupSkill
- retroSkill
- session-reportSkill
- skill-creatorSkill
- usage-captureSkill
The file
We split this hooks-guide.mdc into the rules it gives an agent
2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Must pass shellcheck — make lint before committing
- Very specific: line 41
Never use echo — stray stdout corrupts hook response parsing.
≈ “Common” is an estimate: at least 1 in 5 of the 3,030 Cursor rule files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
---
description: "Constraints and patterns for editing hook scripts — use when modifying hooks/*.sh or hooks/hooks.json"
alwaysApply: false
globs: "hooks/**/*"
---
# Hooks guide
Hooks are shell scripts registered in `hooks/hooks.json` and run at lifecycle events with JSON on stdin. **Cursor does not load `hooks/hooks.json`** — Claude Code and Codex do. Editing a hook from Cursor is normal; relying on one firing in a Cursor session is not. Check `core/capabilities/platforms.json` before assuming hook support anywhere.
Script standards (non-blocking stdin, no `echo` in hooks, dependency detection): `rules/dev/user-facing-script-standards.md`.
## Critical rule
**Never modify `hooks/lib/worktree-common.sh`** without:
1. `shellcheck hooks/lib/worktree-common.sh`
2. Manually testing `capture-task-slug.sh` and `worktree-create.sh`
It is sourced by multiple hooks — a syntax error there silently breaks all worktree behavior.
## hooks.json format
```json
{
"hooks": {
"PreToolUse": [
{
"matcher": "Bash",
"hooks": [{ "type": "command", "command": "bash hooks/my-hook.sh" }]
}
]
}
}
```
## Writing a hook
- Must pass `shellcheck` — `make lint` before committing
- Parse stdin JSON with `jq`; never block when stdin is empty or an idle TTY
- Never use `echo` — stray stdout corrupts hook response parsing. Use `printf` or the helpers in `hooks/lib/`
- Exit 0 = allow; non-zero = deny (PreToolUse)
The authoritative list of wired events is `hooks/hooks.json` itself — read it rather than a copy that drifts.
`scripts/github-mcp.sh` launches the GitHub MCP server via `.mcp.json`; it is **not** a lifecycle hook and does not belong in `hooks.json`.
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
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.

