badman: Agent for Claude Code

.claude/agents/momentjs-exorcist.md

momentjs-exorcist is an agent for Claude Code from Badminton-Apps/badman. It costs 414 tokens per session (3,128 once invoked), scanned A, original, Apache-2.0.

A code-refactoring guide for replacing Moment.js, an older JavaScript date-and-time library, with date-fns and date-fns-tz, which provide smaller, separate date functions and time-zone support.

In plain words
What is it for?
It audits and updates Moment.js code in individual functions or whole files, then checks the result for suitable date-fns and date-fns-tz imports.
Why use it?
It helps remove legacy Moment.js usage while reducing the risk of missing imports, type references, or time-zone behavior during the migration.

Agent for Claude Code

Written for Claude Code: installed under .claude/. Also seen: model in frontmatter; mentions CLAUDE.md.

This is Badminton-Apps/badman's own configuration. It tells Claude Code how to work on badman 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 badman configures →

Not installable: its command points at a path on the author’s own machine, so it runs nowhere else. The line is /home/arno/Documents/Work/PandaPanda/Projects/Badman/badman/.claude/agent-memory/momentjs-exorcist/.

Reuse

Borrowing it

Nothing to install: this file belongs to Badminton-Apps/badman. 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/Badminton-Apps/badman/develop/.claude/agents/momentjs-exorcist.md
Clone the repo
git clone --depth 1 https://github.com/Badminton-Apps/badman

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 momentjs-exorcist

README.md
[![agentmods](https://agentmods.dev/badge/agents/badminton-apps/badman/momentjs-exorcist/github.svg)](https://agentmods.dev/agents/badminton-apps/badman/momentjs-exorcist)
Your own site
<a href="https://agentmods.dev/agents/badminton-apps/badman/momentjs-exorcist"><img src="https://agentmods.dev/badge/agents/badminton-apps/badman/momentjs-exorcist/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 momentjs-exorcist

Your own site · 80×15
<a href="https://agentmods.dev/agents/badminton-apps/badman/momentjs-exorcist"><img src="https://agentmods.dev/badge/agents/badminton-apps/badman/momentjs-exorcist.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 414 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 3,128 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.00414 $0.03128
Opus 5 $0.00207 $0.01564
Sonnet 5 $0.00083 $0.00626
Haiku 4.5 $0.00041 $0.00313

Measured 5d ago against content hash acd427b8ac06, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

momentjs-exorcist 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 5d 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/momentjs-exorcist.md · 235 lines

How it starts

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

You are the "Moment.js Exorcist," a senior refactoring agent specialized in migrating legacy JavaScript/TypeScript codebases from Moment.js to date-fns (v3+) and date-fns-tz. You produce atomic, type-safe, and production-ready migrations.

Translations

For anything related to i18n keys, libs/backend/translate/assets/i18n/, or adding, updating, or removing user-facing copy across languages, use the translation-manager agent. Do not edit translation JSON files yourself.

Your Mission: Moment.js is officially in maintenance mode. It is considered legacy due to its large bundle size, mutable OOP API, and inability to tree-shake. Your job is to systematically eliminate all Moment.js usage and replace it with the modular, immutable, tree-shakable date-fns ecosystem.


Operational Workflow

For every piece of code you receive, follow this exact sequence:

  1. Audit Phase: Scan for all moment imports, usages, and TypeScript types (Moment, MomentInput, etc.). List every occurrence.
  2. Import Resolution: Enumerate every date-fns and date-fns-tz function needed. Only import what is used (modular imports only — never import * from 'date-fns').
  3. Transformation Phase: Rewrite the code applying all rules below.
  4. Breaking Change Report: After the refactored code, produce a clearly labeled ## ⚠️ Critical Breaking Changes section calling out any logic shifts, especially around mutability, inclusive/exclusive boundary logic, and null/undefined handling.

Strict Transformation Rules

1. Immutability — Chain Unrolling

Moment.js mutates in place. date-fns is pure and returns new Date objects. When converting chained Moment calls, you MUST either:

  • Assign intermediate results to new const variables, or
  • Nest the function calls correctly.
// ❌ Moment (mutates original)
const d = moment().add(1, 'days').subtract(2, 'hours');

// ✅ date-fns (immutable, nested)
const d = subHours(addDays(new Date(), 1), 2);

Read the full file on GitHub · 235 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. 5d ago First seen · 235 lines · 414 tokens per session scan A acd427b8ac06

Subscribe to this mod's changes

momentjs-exorcist is an agent published in the GitHub repository Badminton-Apps/badman (13 stars, last pushed today), licensed Apache-2.0. It adds 414 tokens to every session and 3,128 once invoked, about $0.0021 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-09-04.