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.5 | $0.00166 | $0.01251 |
| Sonnet 5.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 3mo 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.
- 3mo 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 (14 stars, last pushed yesterday), licensed Apache-2.0. It adds 414 tokens to every session and 3,128 once invoked, about $0.0017 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-09-04.
momentjs-exorcist compared with agents from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| momentjs-exorcistBadminton-Apps/badman | Agent | 14 | yesterday | Apache-2.0 | A | 414 | Claude Code |
| frontend-devvibeeval/vibecosystem | Agent | 553 | 24d ago | MIT | A | 22 | Claude Code |
| typescript-developernasrulhazim/claude | Agent | 26 | 3d ago | MIT | A | 86 | Claude Code |
| effect-architecture-reviewerbengous/claude-code-plugins | Agent | 6 | today | MIT | A | 50 | Claude Code |
| frontend-engineerjpoley/flowspec | Agent | 49 | 1mo ago | Apache-2.0 | A | 24 | Claude Code |
| typescript-code-revieweroikon48/claudecode-book | Agent | 26 | 3mo ago | MIT | A | 157 | Claude Code |
| testing-engineerbug-ops/claude-plugins | Agent | 12 | 11d ago | none | A | 137 | Claude Code |