Skip to main content
rule CX Codex

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

Install into Claude Code · Manually: put the files in place All methods and platforms ↓
.claude/rules/scoring-patterns.md
Open on GitHub

What 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[] in src/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.md

The paths frontmatter field limits the files

Step 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

Similar IDE rules

All IDE rules for Testing and QA →

From the same set17

The whole set →
llm-layer llm-layer pins the conventions for model-provider code: the LLMProvider interface, config lookup, seat-based handling and usage tracking. Scoped to src/llm/**. CX Codex +1 ★ 1,319repo stars testing Defines Vitest testing patterns for Caliber, enforcing colocated test suites, environment isolation, and global LLM mocks. CX Codex +1 ★ 1,319repo stars caliber-conventions The caliber-conventions rule sets conventions for Caliber TypeScript CLI development. Use it to guide an agent working on project code, tests, and commits. CX Codex +1 ★ 1,319repo stars testing-patterns testing-patterns is a Claude Code rule for Vitest conventions: test locations, LLM mocks, and running a single spec. CX Codex +1 ★ 1,319repo stars llm-patterns The llm-patterns rule sets patterns for LLM providers in a project. Use it when provider interfaces, model settings, CLI errors, or streamed responses need consistent handling. CX Codex +1 ★ 1,319repo stars caliber-pre-commit caliber-pre-commit — a commit-time rule: it checks for the Caliber git hook and, when the hook is absent, syncs and stages your agent config files. CX Codex +1 ★ 1,319repo stars find-skills find-skills discovers community skills from the Caliber registry and installs them directly into your coding session. CX Codex +1 ★ 1,319repo stars save-learning save-learning turns a user's lasting preferences into project learnings. Use it when an agent should carry a rule from one session into the next. CX Codex +1 ★ 1,319repo stars

Project sponsors

Companies that keep this analytics open