pre-commit-validation

pre-commit-validation is a cursor rule for Cursor from darknessomi/musicbox. It costs 185 tokens per session, scanned A, original, MIT.

A pre-commit rule requiring local code checks before creating a Git commit. CI, or continuous integration, is the automated checking system that runs for the project.

In plain words
What is it for?
Use it to run Ruff checks and formatting, Ty type checks, and the full pytest test suite before committing.
Why use it?
It catches formatting, type, and test failures on the developer’s machine before they reach CI or other contributors.

Cursor rule for Cursor

Written for Cursor: installed under .cursor/.

Good fit Use it to run Ruff checks and formatting, Ty type checks, and the full pytest test suite before committing.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/darknessomi/musicbox/pre-commit-validation
About the project

NetEase-MusicBox is a Python command-line client for searching, streaming, and managing music from NetEase Cloud Music. It is for terminal users who want music playback, playlists, recommendations, comments, lyrics, and playback controls, including on some older or low-powered devices. Its catalogue skill and instruction let coding agents operate MusicBox.

darknessomi/musicbox · 9,854 stars · on GitHub

Install

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.

Clone the repo
git clone --depth 1 https://github.com/darknessomi/musicbox

Made for: Cursor.

Wrote 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.

agentmods badge for pre-commit-validation

README.md
[![agentmods](https://agentmods.dev/badge/rules/darknessomi/musicbox/pre-commit-validation/github.svg)](https://agentmods.dev/rules/darknessomi/musicbox/pre-commit-validation)
Your own site
<a href="https://agentmods.dev/rules/darknessomi/musicbox/pre-commit-validation"><img src="https://agentmods.dev/badge/rules/darknessomi/musicbox/pre-commit-validation/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.

agentmods 80×15 button for pre-commit-validation

Your own site · 80×15
<a href="https://agentmods.dev/rules/darknessomi/musicbox/pre-commit-validation"><img src="https://agentmods.dev/badge/rules/darknessomi/musicbox/pre-commit-validation.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 185 This file is loaded in full into every session.
When invoked 185 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5.1 $0.00185 $0.00185
Opus 5.5 $0.00074 $0.00074
Sonnet 5.5 $0.00037 $0.00037
Haiku 4.5 $0.00018 $0.00018

Measured 1mo ago against content hash c8c84fb29ea7, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pre-commit-validation 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.

.cursor/rules/pre-commit-validation.mdc · 20 lines

What it actually says

提交前本地验证

每次 git commit 前,必须先在本机跑完与 .github/workflows/ci.yml 等价的检查;任一失败则先修复再提交。

uv run ruff check
uv run ruff format --check   # 失败则先 uv run ruff format 再重跑
uv run ty check
uv run pytest -s

格式问题优先用 uv run ruff format 自动修复,不要只改代码却跳过 format。

若已安装 pre-commit hook(uv run pre-commit install),git commit 会自动跑 ruff 与 ty;仍应在提交前手动跑完整 pytest。

Changes

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.

  1. 1mo ago First seen · 20 lines · 185 tokens per session scan A c8c84fb29ea7

Subscribe to this mod's changes

pre-commit-validation is a cursor rule published in the GitHub repository darknessomi/musicbox (9,854 stars, last pushed 6d ago), licensed MIT. It adds 185 tokens to every session, about $0.0007 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-08-30.