fdk-react-migrate

A migration command that converts a Platform 3.0 vanilla JavaScript app into a React app using the Meta framework and React Router for navigation.

In plain words
What is it for?
Use it to inventory an existing app, map its front-end logic into React components, add the required Meta configuration, and preserve server handlers and request settings.
Why use it?
It provides a defined path from older front-end code to React while preserving the app's server and configuration work.

Command

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 commands/freshworks-developers/fw-dev-tools/fdk-react-migrate
Clone the repo
git clone --depth 1 https://github.com/freshworks-developers/fw-dev-tools
Per session 42 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,462 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 1 finding. 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.00042 $0.01462
Opus 5 $0.00021 $0.00731
Sonnet 5 $0.00008 $0.00292
Haiku 4.5 $0.00004 $0.00146

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

Security

Grade C, and why

fdk-react-migrate scanned grade C with 1 finding 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 2d 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.

Recursive force deletehighDestructive command

rm -rf with a variable or a broad path is one typo away from removing the wrong tree.

rm -rf node_modules coverage .fdk
skills/fw-app-dev/commands/fdk-react-migrate.md · 124 lines

How it starts

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

FDK React Migrate — Vanilla JS → React Meta

Usage: /fdk-react-migrate

Converts a Platform 3.0 vanilla JS app (Crayons + app/scripts/app.js) to the Meta framework with React + DEW.

Not for Platform 2.x: If platform-version is not "3.0", run /fdk-migrate first, then return to this command.

Step 1: Locate app and verify platform version

  1. Find manifest.json in the workspace.
  2. If multiple apps → ask user which to migrate.
  3. Read platform-version:
    • Not "3.0" → STOP → /fdk-migrate first.
    • metaConfig.framework already "react" → inform user; offer /fdk-fix only.

Step 2: Prerequisites

Follow SKILL.md toolchain gate: Node 24.x + FDK 10.x (10.1.0+ for Meta).

Step 3: Inventory existing app

Document before changing files:

  • Locations and HTML shells (app/index.html, multi-placeholder names)
  • Server handlers in server/server.js — keep all needed SMI/events
  • config/requests.json, oauth_config.json, iparams.json
  • Frontend logic in app/scripts/app.js — map to React components

See references/react-meta/js-to-react-migration-checklist.md.

Step 4: Add Meta manifest + package

  1. Add to manifest.json:
    "metaConfig": {
      "framework": "react",
      "packageManager": "npm"
    }
    
  2. Raise engines.fdk to 10.1.0 minimum if lower.
  3. Create/update package.json:
    • react, react-dom (^19)
    • @freshworks/dew-components, @freshworks/dew-styles
    • react-router-dom
    • Preserve other legitimate deps (axios manifest-pinned, etc.)

Step 5: Restructure frontend

  1. Keep app/index.html at app root (update to #root shell; retain {{{appclient}}} if SMI/Data/Request used).
  2. Remove Crayons CDN scripts from HTML.
  3. Create app/index.jsx entry importing DEW styles + App component.
  4. Move UI logic from app/scripts/app.js into app/components/ as React components.
  5. Add React Router with path="*" home route and /app/... feature routes — specific /app/... routes before the path="*" catch-all.
  6. Remap all navigation paths (CRITICAL — UI breaks if skipped):
    • Grep app/ for old paths: href=, window.location, navigate(, <Link to=, click handlers that change views.
    • Map each vanilla page/view to a React Router route under /app/... (e.g. /demo/app/demo).
    • Add a matching <Route path="/app/..."> for every feature page; update every Link / navigate() to the new path.
    • Do not leave stale vanilla-only paths — fdk validate can pass while the UI stays blank or routes fail.
  7. Multi-location HTML: For each manifest location.url (e.g. index.html, ticketSidebar.html), ensure the file exists at app/ root (not under components/) with #root and {{{appclient}}} when SMI/Data/Request is used.
  8. Replace Crayons / plain HTML with DEW components from @freshworks/dew-components + @freshworks/dew-styles.
  9. Delete or archive app/scripts/app.js after logic is ported (Meta bundles via Vite).
  10. Update icon path in manifest if moving icon to app/icon.svg.

Read the full file on GitHub · 124 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. 2d ago First seen · 124 lines · 42 tokens per session scan C 2390ed6bb12c

Subscribe to this mod's changes

fdk-react-migrate is a command published in the GitHub repository freshworks-developers/fw-dev-tools (5 stars, last pushed 8d ago), licensed MIT. It adds 42 tokens to every session and 1,462 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 1 finding (recursive force delete). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.