param-source-guard.en — Claude Code rule: what it does, how to install
The param-source-guard.en rule for Claude Code requires every new numeric parameter in code to include a source comment. It tracks limits, thresholds, and windows to ensure they trace back to user input, specs, or measurements.
Apache-2.0 ★ 262 updated 2026-11-17
.claude/rules/param-source-guard.en.mdWhat param-source-guard.en does
Every new name = number assignment in code needs a comment on the current or previous line explaining itsorigin. Valid markers include words like source, 来源, 实测, 数据, 用户, SPEC, and 沿用 to indicate measurements, user words, specs, or existing settings. Parameters lacking a source are either removed or require asking the user. The check ignores zeros, ones, negative ones, timeouts, ports, and test files.
The rule file is placed at .claude/rules/param-source-guard.en.md for Claude Code, with support for Cursor, GitHub Copilot, Windsurf, and Cline.
What it helps with
- require a source comment for every new numeric parameter
- flag limits and thresholds without a valid origin
- remove or question parameters lacking a source marker
- skip checks for ports, timeouts, and test files
Example prompts for the agent
- Add a limit and include a source comment for it
- Check if this new numeric threshold has a source comment
- Document where this window size comes from in a comment
How to install param-source-guard.en
Manually: put the files in place
.claude/rules/param-source-guard.en.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/param-source-guard.en.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/param-source-guard.en.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/param-source-guard.en.mdManually: put the files in place
.clinerules/param-source-guard.en.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about param-source-guard.en
How to install param-source-guard.en in Claude Code?
Place the rule file at .claude/rules/param-source-guard.en.md.
What does param-source-guard.en do?
It enforces source comments for all new numeric parameters in code while exempting ports, timeouts, and test files.
Which markers does the rule recognize?
It detects source markers including source, 来源, 实测, 数据, 用户, SPEC, and 沿用.
Source text
param-source-guard.en.md · Apache-2.0
- Numbers need a source (param-source-guard): every new `name = number` in code (limits, thresholds, windows, …) gets a comment on the same or previous line saying where it comes from — the user's words, data or a measurement, a SPEC, or an existing setting it follows (the words 来源/source/实测/数据/用户/SPEC/沿用 mark it). No source means you made it up: leave the parameter out or ask the user. 0, 1, -1, timeouts, ports and test files are not checked.
© zuiho-kai · Apache-2.0 · zuiho-kai/bothouse