migration-refactor

Refactor ESLint Date-rule violations into gmt Temporal-based helper calls.

6|Updated Mar 10, 2026
One-click install
npx skills add https://github.com/northguild/gmt --skill migration-refactor-northguild
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: migration-refactor
Source: https://github.com/northguild/gmt/tree/main/packages/gmt-eslint/skills/migration-refactor
Command: npx skills add https://github.com/northguild/gmt --skill migration-refactor-northguild

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? When @northguild/gmt-eslint flags Date-related violations in a codebase, developers need a safe, behavior-preserving way to replace native Date APIs and legacy date libraries with @northguild/gmt equivalents without breaking output shape, timezone intent, or boundary behavior. ## Core Features & Use Cases - Guided violation resolution: Maps common Date APIs (Date.now, new Date, Date.parse, Date.UTC) to the appropriate gmt plain/zoned helpers. - Legacy library migration: Replaces imports of moment, moment-timezone, dayjs, luxon, date-fns, date-fns-tz, and spacetime (including require, dynamic import, and re-export forms) with gmt equivalents. - Missing-helper workflow: When no gmt helper exists, directs you to open a GitHub issue with expected behavior, or implement a custom Temporal-based method with robust tests and a PR. - Use Case: After enabling gmt-eslint on a project that uses date-fns, you run ESLint, see dozens of violations, and use this Skill to systematically convert each call site while flagging semantic differences like date-fns setYear rolling to March 1 versus Temporal clamping to February 28. ## Quick Start Ask the assistant to fix the gmt-eslint Date violations in your project by replacing them with @northguild/gmt helpers while preserving existing behavior.

Frequently Asked Questions about migration-refactor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix gmt-eslint Date rule violations?▼

Replace each flagged Date API with the corresponding @northguild/gmt helper: Date.now becomes getUnixNow or getNow, new Date becomes a gmt parsing or conversion path, and Date.parse or Date.UTC become gmt conversion helpers. Re-run ESLint and tests to confirm behavior is preserved.

How do I migrate from moment or date-fns to gmt?▼

Replace each call site from moment, moment-timezone, dayjs, luxon, date-fns, date-fns-tz, or spacetime with gmt equivalents, then remove the import entirely. Re-exports are also flagged by no-restricted-imports, so do not route around the rule with a local wrapper module.

What should I do when gmt has no helper for my use case?▼

Open a GitHub issue describing the expected behavior with examples, since gmt ships Temporal and the capability is achievable. If you implement it now, add a custom gmt method with robust tests and submit a PR.

Does gmt arithmetic behave the same as date-fns setYear?▼

No. gmt follows Temporal semantics, so adding one year to 2024-02-29 clamps to 2025-02-28, while date-fns setYear rolls to March 1. Flag this behavior change to the user instead of silently copying the old result.

Is @js-joda/core blocked by the gmt-eslint import restrictions?▼

No. @js-joda/core is intentionally allowed by the no-restricted-imports configuration, unlike moment, dayjs, luxon, date-fns, and spacetime, which are flagged including subpaths, require calls, and dynamic imports.