rangeLink: Agent for Claude Code

.claude/agents/test-scope-fixer.md

test-scope-fixer is an agent for Claude Code from couimet/rangeLink. It costs 25 tokens per session (2,196 once invoked), scanned A, original, MIT.

An agent that reviews Jest tests—tests commonly used in JavaScript and TypeScript projects—to find cases that check a helper function's internal behaviour instead of the surrounding class's use of that helper.

In plain words
What is it for?
Use it to detect and fix overly detailed tests by mocking delegated utilities and checking only the class's delegation and resulting behaviour.
Why use it?
It keeps tests focused on the code they are meant to protect and avoids duplicating a utility's own tests.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter.

This is couimet/rangeLink's own configuration. It tells Claude Code how to work on rangeLink itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything rangeLink configures →

Needs its repository: it reads a path above its own folder, which exists only inside the repository. The line is jest.mock('../utils/isValidInput');.

Reuse

Borrowing it

Nothing to install: this file belongs to couimet/rangeLink. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/couimet/rangeLink/main/.claude/agents/test-scope-fixer.md
Clone the repo
git clone --depth 1 https://github.com/couimet/rangeLink

Made for: Claude Code.

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 test-scope-fixer

README.md
[![agentmods](https://agentmods.dev/badge/agents/couimet/rangelink/test-scope-fixer/github.svg)](https://agentmods.dev/agents/couimet/rangelink/test-scope-fixer)
Your own site
<a href="https://agentmods.dev/agents/couimet/rangelink/test-scope-fixer"><img src="https://agentmods.dev/badge/agents/couimet/rangelink/test-scope-fixer/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 test-scope-fixer

Your own site · 80×15
<a href="https://agentmods.dev/agents/couimet/rangelink/test-scope-fixer"><img src="https://agentmods.dev/badge/agents/couimet/rangelink/test-scope-fixer.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 25 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,196 The whole file, excluding the scripts and references it only reads on demand.
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.00025 $0.02196
Opus 5.5 $0.00010 $0.00878
Sonnet 5.5 $0.00005 $0.00439
Haiku 4.5 $0.00003 $0.00220

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

Security

Grade A, and why

test-scope-fixer 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 2mo 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.

.claude/agents/test-scope-fixer.md · 302 lines

How it starts

The opening of the file, as written. The whole thing — 302 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Test Scope Fixer Agent

You are an expert at identifying and fixing badly scoped tests in Jest test suites.

Your Mission

Detect tests that are "badly scoped" - tests that verify implementation details of utility functions instead of mocking those utilities and testing only the delegation logic.

Pattern You're Looking For

Badly Scoped Test Pattern:

// Class method that delegates to utilities
class SomeClass {
  async doSomething(input: string): Promise<boolean> {
    if (!isValidInput(input)) {
      // ← Utility function
      return false;
    }
    const processed = processInput(input); // ← Utility function
    // ... use processed value
  }
}

// ❌ BADLY SCOPED TEST (tests utility implementation details)
it('should reject empty strings', async () => {
  const result = await instance.doSomething('');
  expect(result).toBe(false);
});

it('should reject whitespace-only strings', async () => {
  const result = await instance.doSomething('   ');
  expect(result).toBe(false);
});

it('should add padding to input without spaces', async () => {
  await instance.doSomething('text');
  expect(someMock).toHaveBeenCalledWith(' text ');
});

These tests should be in the utility function's test file (isValidInput.test.ts, processInput.test.ts), NOT in the class test.

Correctly Scoped Test Pattern:

// ✅ CORRECTLY SCOPED TEST (mocks utilities, tests only delegation)
jest.mock('../utils/isValidInput');
jest.mock('../utils/processInput');

it('should return false when input is invalid', async () => {
  (isValidInput as jest.Mock).mockReturnValue(false);

  const result = await instance.doSomething('any-input');

  expect(result).toBe(false);
  expect(isValidInput).toHaveBeenCalledWith('any-input');
  expect(processInput).not.toHaveBeenCalled();
});

it('should process valid input', async () => {
  (isValidInput as jest.Mock).mockReturnValue(true);
  (processInput as jest.Mock).mockReturnValue('processed-value');

  await instance.doSomething('valid-input');

  expect(isValidInput).toHaveBeenCalledWith('valid-input');
  expect(processInput).toHaveBeenCalledWith('valid-input');
  expect(someMock).toHaveBeenCalledWith('processed-value');
});

Read the full file on GitHub · 302 lines

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. 2mo ago First seen · 302 lines · 25 tokens per session scan A 07e622b346d9

Subscribe to this mod's changes

test-scope-fixer is an agent published in the GitHub repository couimet/rangeLink (10 stars, last pushed 8d ago), licensed MIT. It adds 25 tokens to every session and 2,196 once invoked, about $0.0001 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-31.

Related

Other agents, from other repositories

test-generator

Generates comprehensive test suites using TDD patterns. Use when writing tests, improving coverage, or implementing test-first development.

travisjneuman/.claude · 27 tokens

review-tests-minitest

Minitest test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-minitest in repos that test with minitest. Reads the tests and the code they claim to cover in full — coverage in mention is not coverage in meaning.

hoblin/claude-ruby-marketplace · 67 tokens

review-tests-rspec

RSpec test quality and coverage reviewer for PR audits. Spawned by /rpi:review-pr as subagenttype rpi:review-tests-rspec in repos that test with RSpec. Reads the specs and the code they claim to cover in full — coverage in mention is not coverage in meaning.

hoblin/claude-ruby-marketplace · 65 tokens

tester

Use when designing or generating tests for new code, fixes, or refactors. Dispatched primarily by the test-first skill. Produces test code with red→green discipline, targeting unit-first coverage and explicit failure-mode cases. Pastes runner output as evidence. Context: A new endpoint is being added. user: "Add tests…

duthaho/claudekit · 167 tokens

test-writer

Writes comprehensive, meaningful tests for recently changed code.

sefaertunc/Worclaude · 13 tokens

ios-test-writer

Use this agent when the user requests test creation, improvement, or generation for iOS code. Trigger this agent when:\n\n- User explicitly asks to "write tests", "create tests", "generate tests", or "add test coverage"\n- User mentions testing-related keywords: "XCTest", "unit test", "test suite", "test coverage"…

carloshpdoc/ios-workflow-claude · 0 tokens