rules-test-requirements

A repository rule requiring tests whenever Go files change in the transformer, runner, writer, or parser areas. The rule covers regression tests for data expansion, control flow, and file-writing behavior.

In plain words
What is it for?
Use it when modifying those Go components to add the required tests, then run the full test suite, race checks for the runner, and the project’s formatting, lint, and test command.
Why use it?
It helps prevent bugs from spreading across the project’s many targets and ensures changes are checked against both existing and newly reproduced failures.

Cursor rule

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.

agentmods
npx agentmods add rules/stringke/std-agent/rules-test-requirements
Clone the repo
git clone --depth 1 https://github.com/StringKe/std-agent
Per session 343 This file is loaded in full into every session.
When invoked 343 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
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 $0.00343 $0.00343
Opus 5 $0.00171 $0.00171
Sonnet 5 $0.00069 $0.00069
Haiku 4.5 $0.00034 $0.00034

Measured yesterday against content hash 207da2fabe1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

rules-test-requirements 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 yesterday.

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.

internal/transformer/testdata/golden/cursor/rules-test-requirements.mdc · 25 lines

What it actually says


globs: "internal/transformer//*.go,internal/runner//.go,internal/writer/**/.go,internal/parser/**/*.go" description: 改 transformer / runner / writer / parser 必带 _test.go 防回归

测试要求

stdagent 是个"机械扩散器",bug 修一次要管 11 个 target。任何对 transformer / runner / writer / parser 的改动都必须带测试:

  • 新增 target:至少要有 plan 单测覆盖所有 type(rules / skills / commands / references / subagents)的 fanout 路径。
  • 修 transformer bug:测试要能复现 bug(先红后绿),不能只在原有用例上加断言。
  • 改 runner 控制流(如 prune / dry-run / strict):单测要覆盖 flag 开/关、第一次/第二次 sync、submodule 边界等行为。
  • 改 writer 落盘逻辑:测试要含 unchanged / overwrite / atomic 三类路径。

跑测试:

go test ./...                          # 全量
go test -race ./internal/runner/...    # race detector,runner 必跑
mise run check                         # fmt + lint + test,提 PR 前必跑

发现已存在的 bug 但你不在改它:要么修,要么开 issue 记录,不要装作没看见。

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. yesterday First seen · 25 lines · 343 tokens per session scan A 207da2fabe1a

Subscribe to this mod's changes

rules-test-requirements is a cursor rule published in the GitHub repository StringKe/std-agent (8 stars, last pushed 11d ago), licensed MIT. It adds 343 tokens to every session, about $0.0017 per session on Opus 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-31.

Related

Other cursor rules, from other repositories

kotlin-ktor-development-cursorrules-prompt-file

Cursor rule "kotlin-ktor-development-cursorrules-prompt-file" from ItamarZand88/awesome-agent-conventions, covering core principles, technology stack, application structure (feature-based), application logic design and entities & data classes.

ItamarZand88/awesome-agent-conventions · 2,123 tokens

solidity-foundry-cursorrules-prompt-file

Cursor rule "solidity-foundry-cursorrules-prompt-file" from ItamarZand88/awesome-agent-conventions, covering do not compile tests when compiling via-ir and don't pollute bytecode with metadata.

ItamarZand88/awesome-agent-conventions · 1,586 tokens

java-springboot-jpa-cursorrules-prompt-file

description: "Cursor rules for Java development with Springboot and JPA integration." globs: / alwaysApply: false.

ItamarZand88/awesome-agent-conventions · 1,052 tokens

rust

Cursor rule "rust" from ItamarZand88/awesome-agent-conventions, covering rust + solana (anchor) best practices, program structure, anchor framework, serialization and testing.

ItamarZand88/awesome-agent-conventions · 1,058 tokens

swiftui-guidelines-cursorrules-prompt-file

Cursor rule "swiftui-guidelines-cursorrules-prompt-file" from ItamarZand88/awesome-agent-conventions, covering role & perspective, code generation guidelines, 1. general principles, 2. swiftui best practices (performance first) and 3. swift 6 concurrency & threading.

ItamarZand88/awesome-agent-conventions · 1,129 tokens

laravel-php-83-cursorrules-prompt-file

description: "Cursor rules for Laravel development with PHP 8.3 integration." globs: / alwaysApply: false.

ItamarZand88/awesome-agent-conventions · 452 tokens