scoring-patterns — Claude Code rule: what it does, how to install
scoring-patterns defines coding rules for the src/scoring/** directory. It keeps scoring checks deterministic without external network calls or random values.
MIT ★ 1,319 updated 2026-09-24
.claude/rules/scoring-patterns.mdWhat scoring-patterns does
This rule scopes changes within src/scoring/**. It enforces purely deterministic logic: no LLM queries, no network operations, and no randomness. Every check function must return Check[] defined in src/scoring/index.ts.
Hardcoding point numbers inside scoring functions is forbidden. Point values belong in src/scoring/constants.ts, alongside CLAUDE_ONLY_CHECKS, CURSOR_ONLY_CHECKS, CODEX_ONLY_CHECKS, and COPILOT_ONLY_CHECKS sets for filterChecksForTarget(). Grade boundaries use GRADE_THRESHOLDS, while category limits rely on CATEGORY_MAX.
Shared logic uses helpers from src/scoring/utils.ts, including readFileOrNull(), collectPrimaryConfigContent(), and estimateTokens(). Introducing network calls or random inputs breaks npx vitest run src/scoring/__tests__/accuracy.test.ts.
What it helps with
- keep scoring checks deterministic without network I/O
- separate platform checks using target sets
- store points and grade thresholds in central constants
- verify check accuracy with Vitest
Example prompts for the agent
- Implement a new scoring check returning
Check[]insrc/scoring/index.ts - Add target platform restrictions to
src/scoring/constants.ts - Run scoring accuracy tests using the Vitest command
How to install scoring-patterns
Manually: put the files in place
.claude/rules/scoring-patterns.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/scoring-patterns.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/scoring-patterns.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/scoring-patterns.mdManually: put the files in place
.clinerules/scoring-patterns.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about scoring-patterns
How do I install scoring-patterns in Claude Code?
Place the rule file at .claude/rules/scoring-patterns.md in your repository.
What does scoring-patterns do?
It enforces deterministic scoring check architecture across src/scoring/**, keeping points in constants and banning network calls.
How are scoring tests executed?
Run npx vitest run src/scoring/__tests__/accuracy.test.ts in your terminal.
Source text
scoring-patterns.md · MIT
--- paths: - src/scoring/** --- # Scoring Check Patterns - All checks are deterministic — no LLM calls, no network I/O, no randomness - Check functions return `Check[]` from `src/scoring/index.ts` - Point constants in `src/scoring/constants.ts` — never hardcode values - `filterChecksForTarget()` uses sets: `CLAUDE_ONLY_CHECKS`, `CURSOR_ONLY_CHECKS`, `CODEX_ONLY_CHECKS`, `COPILOT_ONLY_CHECKS` in `src/scoring/constants.ts` - Helpers: `readFileOrNull()`, `collectPrimaryConfigContent()`, `estimateTokens()` in `src/scoring/utils.ts` - Display: `src/scoring/display.ts` · History: `src/scoring/history.ts` · Dismissed: `src/scoring/dismissed.ts` - Grade thresholds in `GRADE_THRESHOLDS`, category max in `CATEGORY_MAX` - Test: `npx vitest run src/scoring/__tests__/accuracy.test.ts`
© caliber-ai-org · MIT · caliber-ai-org/ai-setup