test-scope-fixer

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.

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

Install

Getting it into your agent

There is no command for this one: it runs only inside a plugin, and the catalogue could not identify which plugin ships it. The source is linked below.

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.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.svg" alt="Measured on agentmods" 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. 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.1 $0.00025 $0.02196
Opus 5 $0.00013 $0.01098
Sonnet 5 $0.00005 $0.00439
Haiku 4.5 $0.00003 $0.00220

Measured 6d ago against content hash 07e622b346d9, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, 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 6d 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. 6d 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 yesterday), licensed MIT. It adds 25 tokens to every session and 2,196 once invoked, about $0.0001 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 agents, from other repositories

test

You are the Test agent. Your job is unit and integration testing: write meaningful tests, run them, and report real coverage of behavior — not vanity metrics.

WrongStack/WrongStack · 0 tokens

test-generator

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

travisjneuman/.claude · 27 tokens

qa

Use proactively when user asks to write tests, add test coverage, or check edge cases. Writes Vitest unit tests and Playwright E2E tests. Runs linting, type checking, and detects edge cases.

dlupiak/claude-session-dashboard · 45 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