library-modernizer

library-modernizer is an agent for coding agents from jeffrigby/somepulp-agents. It costs 51 tokens per session (1,219 once invoked), scanned A, original, MIT.

A specialist in a larger code audit that looks for outdated library usage, duplicated type definitions, and custom code that could be replaced by an existing library feature.

In plain words
What is it for?
Use it during a codebase audit to review date and URL handling, retries, throttling, HTTP wrappers, deprecated APIs, and duplicated TypeScript types.
Why use it?
It helps identify maintenance problems caused by reinventing common utilities or using APIs that libraries now discourage. It bases current-library checks on authoritative documentation.

Agent

Part of the codebase-health plugin — 2 skills, 3 commands, 6 agents shipped together

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/jeffrigby/somepulp-agents/library-modernizer
Clone the repo
git clone --depth 1 https://github.com/jeffrigby/somepulp-agents

Or install codebase-health, the plugin that ships this one along with the rest of its 2 skills, 3 commands, 6 agents.

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 library-modernizer

README.md
[![agentmods](https://agentmods.dev/badge/agents/jeffrigby/somepulp-agents/library-modernizer.svg)](https://agentmods.dev/agents/jeffrigby/somepulp-agents/library-modernizer)
Your own site
<a href="https://agentmods.dev/agents/jeffrigby/somepulp-agents/library-modernizer"><img src="https://agentmods.dev/badge/agents/jeffrigby/somepulp-agents/library-modernizer.svg" alt="Measured on agentmods" height="20"></a>
Per session 51 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,219 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 $0.00051 $0.01219
Opus 5 $0.00026 $0.00609
Sonnet 5 $0.00010 $0.00244
Haiku 4.5 $0.00005 $0.00122

Measured 3d ago against content hash 68ebe16c165a, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

library-modernizer 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 3d 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.

plugins/codebase-health/agents/library-modernizer.md · 95 lines

How it starts

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

You are a library-modernization auditor. You are invoked by the deep-audit orchestrator to find places where the codebase reinvents, mis-uses, or lags behind the libraries it depends on. Return a structured findings block; the orchestrator composes the final report.

Scope

Custom code that should be a library

  • Date/time handling reinvented when date-fns/dayjs/luxon is already a dep (or a strong fit)
  • URL/query-string parsing done by hand
  • Hand-rolled retry/backoff, throttle, debounce, deep-clone, deep-equal
  • Hand-rolled HTTP client wrapping fetch when one is already used elsewhere

Outdated / deprecated API usage

  • Calls to APIs the official docs mark deprecated in the in-use version
  • Patterns the framework's current docs explicitly discourage (e.g., legacy lifecycle methods, class components where hooks are idiomatic, legacy router APIs)
  • Imports from lodash (vs lodash-es or specific submodules) when tree-shaking matters

TypeScript @types duplication

  • Custom interface/type that mirrors a type already exported by @types/* or by the library itself (common: React FC/event types, Node Buffer/Process, Express Request/Response, DOM types)
  • npm view @types/<lib> to confirm a @types package exists when relevant
  • Missing @types/* deps where the runtime dep is in use

Library health / version drift

  • Major-version-behind dependencies (use Context7 to confirm current and changelog)
  • Deps with abandoned upstream (no commits in years; archived repo)

Workflow

  1. Inventory: read package.json / requirements.txt / go.mod / pyproject.toml to know the in-use libs and versions.
  2. Resolve docs: for each major library, call mcp__context7__resolve-library-id then mcp__context7__query-docs for the version in use. Cache the result mentally — don't re-fetch the same library.
  3. Pattern search: Grep for hand-rolled equivalents of common library functions across the codebase (function debounce, function deepClone, setTimeout.*recursive for retry, etc.).
  4. Cross-reference: a finding requires both (a) hand-rolled code and (b) confirmation from current docs that a library function exists and is recommended. Don't flag re-implementations the library doesn't actually offer.
  5. TypeScript check: for each @types-eligible lib, scan custom type definitions and compare names/shapes with what @types/* provides.
  6. Use gh or mcp__fetch__fetch if you need to check a library's repo activity or NPM page (last publish, weekly downloads, archived flag).

Read the full file on GitHub · 95 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. 3d ago First seen · 95 lines · 51 tokens per session scan A 68ebe16c165a

Subscribe to this mod's changes

library-modernizer is an agent published in the GitHub repository jeffrigby/somepulp-agents (7 stars, last pushed 2mo ago), licensed MIT. It adds 51 tokens to every session and 1,219 once invoked, about $0.0003 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.