alibaba/hooks is a TypeScript library of React Hooks, including basic utilities and Hooks shaped by common application development needs. React developers use it in applications that may also require server-side rendering and predictable static types. The catalogue entries provide rules and instructions for using the library.
Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/alibaba/hooksWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/alibaba/hooks/git)<a href="https://agentmods.dev/rules/alibaba/hooks/git"><img src="https://agentmods.dev/badge/rules/alibaba/hooks/git/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/alibaba/hooks/git"><img src="https://agentmods.dev/badge/rules/alibaba/hooks/git.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00963 | $0.00963 |
| Opus 5.5 | $0.00385 | $0.00385 |
| Sonnet 5.5 | $0.00193 | $0.00193 |
| Haiku 4.5 | $0.00096 | $0.00096 |
Grade A, and why
git scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
Git 规范
开发流程
- 从保护分支(通常是
master)创建新的功能分支 - 在新分支上进行开发
- 提交 Pull Request 到目标分支
- 等待 Code Review 和 CI 通过
- 合并到目标分支
分支命名规范
- 功能开发:
feat/description-of-feature- 例如:
feat/add-dark-mode - 例如:
feat/improve-table-performance
- 例如:
- 问题修复:
fix/issue-number-or-description- 例如:
fix/button-style-issue - 例如:
fix/issue-1234
- 例如:
- 文档更新:
docs/what-is-changed- 例如:
docs/update-api-reference - 例如:
docs/fix-typos
- 例如:
- 代码重构:
refactor/what-is-changed- 例如:
refactor/button-component - 例如:
refactor/remove-deprecated-api
- 例如:
- 样式修改:
style/what-is-changed- 例如:
style/update-button-tokens - 例如:
style/improve-mobile-layout
- 例如:
- 测试相关:
test/what-is-changed- 例如:
test/add-button-test - 例如:
test/improve-coverage
- 例如:
- 构建相关:
build/what-is-changed- 例如:
build/upgrade-webpack - 例如:
build/fix-ts-config
- 例如:
- 持续集成:
ci/what-is-changed- 例如:
ci/add-e2e-test - 例如:
ci/fix-deploy-script
- 例如:
- 性能优化:
perf/what-is-changed- 例如:
perf/optimize-render - 例如:
perf/reduce-bundle-size
- 例如:
- 依赖升级:
deps/package-name-version- 例如:
deps/upgrade-react-19 - 例如:
deps/update-dependencies
- 例如:
分支命名注意事项
- 使用小写字母
- 使用连字符(-)分隔单词
- 简短但具有描述性
- 避免使用下划线或其他特殊字符
- 如果与 Issue 关联,可以包含 Issue 编号
Pull Request 规范
PR 标题
- PR 标题始终使用英文
- 遵循格式:
类型: 简短描述 - 例如:
fix: fix button style issues in Safari browser - 例如:
feat: add dark mode support
PR 内容
- PR 内容默认使用英文
- 尽量简洁清晰地描述改动内容和目的
- 可以视需要在英文描述后附上中文说明
PR 提交注意事项
-
审核流程:
- PR 需要由至少一名维护者审核通过后才能合并
- 确保所有 CI 检查都通过
- 解决所有 Code Review 中提出的问题
-
PR 质量要求:
- 确保代码符合项目代码风格
- 添加必要的测试用例
- 更新相关文档
- 大型改动需要更详细的说明和更多的审核者参与
-
工具标注:
- 如果是用 Cursor 提交的代码,请在 PR body 末尾进行标注:
> Submitted by Cursor
- 如果是用 Cursor 提交的代码,请在 PR body 末尾进行标注:
新增内容
- Pull Request 标题格式:[组件名]: 描述
- 从 master 分支创建新分支
- 分支命名规范:
- feature/xxx:新特性
- fix/xxx:Bug 修复
- docs/xxx:文档更新
- PR 说明中选择改动类型:
- 🆕 新特性提交
- 🐞 Bug 修复
- 📝 文档改进
- 📽️ 演示代码改进
- 💄 样式/交互改进
- 🤖 TypeScript 更新
- 📦 包体积优化
- ⚡️ 性能优化
- 🌐 国际化改进
- 提供改动背景和解决方案
- 更新日志同时提供英文和中文版本
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 111 lines · 963 tokens per session scan A df2490cba8b5
git is a cursor rule published in the GitHub repository alibaba/hooks (14,973 stars, last pushed 9d ago), licensed MIT. It adds 963 tokens to every session, about $0.0039 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-01.
Other cursor rules, from other repositories
release-lanes
Promote Plate beta releases, sync main back to next and verify published npm/GitHub state with release authority.
changeset
Write and verify package release changesets, registry changelog entries, and the PR’s managed auto-release choice. Use before deciding whether a package edit needs a changeset, including skipping one.
appbuilder-sdk
Workflow for AppBuilderSdk / AppBuilderShared (repos, git, line endings, checks). Do not add feature notes here.
worktree-shared-repo
Bootstrap AppBuilderShared in new Cursor worktrees so Shared diffs show in Changes.
release-process
Use the documented Windows and macOS release flow.
git-flow
Branching, commits and PR hygiene. Always applies.