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.
curl -O https://raw.githubusercontent.com/Badminton-Apps/badman/develop/.claude/agents/momentjs-exorcist.mdgit clone --depth 1 https://github.com/Badminton-Apps/badmanWrote 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.
[](https://agentmods.dev/agents/badminton-apps/badman/momentjs-exorcist)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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:
- Audit Phase: Scan for all
momentimports, usages, and TypeScript types (Moment,MomentInput, etc.). List every occurrence. - Import Resolution: Enumerate every
date-fnsanddate-fns-tzfunction needed. Only import what is used (modular imports only — neverimport * from 'date-fns'). - Transformation Phase: Rewrite the code applying all rules below.
- Breaking Change Report: After the refactored code, produce a clearly labeled
## ⚠️ Critical Breaking Changessection 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
constvariables, 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);
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.
- 5d ago First seen · 235 lines · 414 tokens per session scan A acd427b8ac06
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.
Other agents, from other repositories
Next.js Expert
Expert Next.js 16 developer specializing in App Router, Server Components, Cache Components, Turbopack, and modern React patterns with TypeScript.
frontend-dev
Frontend Developer (Aria Chen) - React, Next.js, TypeScript, accessibility, performance.
typescript-spec
A TypeScript specialist for advanced types, including generics, conditional types, utility types, and type inference. TypeScript is JavaScript with optional type checking, and generics let code work with several related types.
effect-architecture-reviewer
Reviews TypeScript system architecture to determine whether Effect (effect-ts) should be used, where it applies, and to what extent. Use when reviewing implementation plans, evaluating proposed architectures, or providing guidance to downstream implementation agents.
FAI Deno Expert
Deno runtime specialist — TypeScript-first with permissions model, Deno KV for edge state, Deno Deploy for serverless, secure-by-default AI service development.
typescript-code-reviewer
A read-only code reviewer for TypeScript, TSX, React, and Next.js projects. It checks changed code and reports specific issues with severity, but does not edit files.