fw-setup-downgrade

fw-setup-downgrade is a command for coding agents from freshworks-developers/fw-dev-tools. It costs 37 tokens per session (6,729 once invoked), scanned C, original, MIT.

A command for moving the Freshworks Development Kit (FDK) to an earlier version: another 10.x release or the older 9.x line.

In plain words
What is it for?
Use it to downgrade within FDK 10 on Node.js 24, or move to FDK 9 on Node.js 18 with a deprecation warning.
Why use it?
It helps when an app or project requires an older FDK version, while showing the Node.js version and support implications.

Command

Part of the fw-setup plugin — 1 skill, 7 commands shipped together

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/fw-setup-downgrade
Clone the repo
git clone --depth 1 https://github.com/freshworks-developers/fw-dev-tools

Or install fw-setup, the plugin that ships this one along with the rest of its 1 skill, 7 commands.

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 fw-setup-downgrade

README.md
[![agentmods](https://agentmods.dev/badge/commands/freshworks-developers/fw-dev-tools/fw-setup-downgrade.svg)](https://agentmods.dev/commands/freshworks-developers/fw-dev-tools/fw-setup-downgrade)
Your own site
<a href="https://agentmods.dev/commands/freshworks-developers/fw-dev-tools/fw-setup-downgrade"><img src="https://agentmods.dev/badge/commands/freshworks-developers/fw-dev-tools/fw-setup-downgrade.svg" alt="Measured on agentmods" height="20"></a>
Per session 37 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 6,729 The whole file, excluding the scripts and references it only reads on demand.
Security scan C 2 findings. 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.00037 $0.06729
Opus 5 $0.00018 $0.03365
Sonnet 5 $0.00007 $0.01346
Haiku 4.5 $0.00004 $0.00673

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

Security

Grade C, and why

fw-setup-downgrade scanned grade C with 2 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 3d 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 ~/.fdk

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

HTTP=$(curl -sS -o /dev/null -w "%{http_code}" -L -I "$FDK_URL" || echo "000")
skills/fw-setup/commands/fw-setup-downgrade.md · 662 lines

How it starts

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

FDK setup — downgrade (/fw-setup-downgrade)

/fw-setup-downgrade supports:

  1. FDK 10.x → 10.0.y (e.g., 10.1.0 → 10.0.1) on Node 24
  2. FDK 10.x → 9.x (e.g., 10.x → 9.8.2) on Node 18 with deprecation notice

DEPRECATION WARNING (FDK 9.x): FDK 9.x + Node 18.x support ends May 31, 2026. Publishing to marketplace requires FDK 10.x + Node 24.x.

Agent pre-step

If the user gave no version argument (bare /fw-setup-downgrade with no semver), set __FDK_DOWNGRADE_TARGET__ to latest — do not ask the developer for a target version.

Replace __FDK_DOWNGRADE_TARGET__ in the Task prompts:

  • latest — user did not pass a semver (use latest FDK 9.x on Node 18)
  • 10.x.y — from /fw-setup-downgrade 10.0.1 (downgrade within FDK 10.x line, stays on Node 24)
  • 9.x.y — from /fw-setup-downgrade 9.6.0 or --to 9.6.0. Strip leading v.

Execution

macOS/Linux (Bash/Zsh) - Single-step execution

Note: This version is tested and working on macOS/Linux. Terminal output is cleaner on Unix systems, so a single-step approach works well.

Task({
  subagent_type: "shell",
  model: "fast",
  description: "Downgrade FDK version (10.x → 10.0.y or 10.x → 9.x)",
  prompt: `
Downgrade FDK to a specific version - auto-detects installation method (nvm, Homebrew, Chocolatey).

TARGET_VER="__FDK_DOWNGRADE_TARGET__"
# Host must replace with: "latest" OR "9.6.0" OR "10.0.1" etc.

# Detect installation method
detect_install_method() {
  if command -v brew >/dev/null 2>&1 && brew list fdk >/dev/null 2>&1; then
    echo "homebrew"
  elif command -v choco >/dev/null 2>&1 && choco list --local-only fdk 2>/dev/null | grep -q "^fdk"; then
    echo "chocolatey"
  elif [ -s "$HOME/.nvm/nvm.sh" ]; then
    echo "nvm"
  elif command -v nvm >/dev/null 2>&1 && [[ "$OSTYPE" =~ ^(msys|win32|cygwin) ]]; then
    echo "nvm-windows"
  else
    echo "npm-global"
  fi
}

INSTALL_METHOD=$(detect_install_method)
echo "Installation method: $INSTALL_METHOD"

# Load nvm if available
if [[ "$INSTALL_METHOD" == "nvm" ]]; then
  export NVM_DIR="$HOME/.nvm"
  [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
fi

# Determine target major version
if [[ "$TARGET_VER" == latest ]] || [[ "$TARGET_VER" =~ ^9\\. ]]; then
  IS_NINE=1
  echo "========================================="
  echo "WARNING: FDK 9.x + Node 18.x DEPRECATED"
  echo "========================================="
  echo "Support ends: May 31, 2026"
  echo "Publishing requires FDK 10.x + Node 24.x"
  echo "Documentation: https://developers.freshworks.com/docs/app-sdk/v3/freshworks-app-sdk/"
  echo ""
  read -p "Continue with FDK 9.x downgrade? (y/N): " confirm
  if [[ "$confirm" != [yY] ]]; then
    echo "Downgrade cancelled."
    exit 0
  fi
  NODE_VER="18.20"
else
  IS_NINE=0
  NODE_VER="24.11"
fi

if [[ "$TARGET_VER" == latest ]]; then
  FDK_URL="https://cdn.freshdev.io/fdk/latest.tgz"
else
  FDK_URL="https://cdn.freshdev.io/fdk/v${TARGET_VER}.tgz"
fi

HTTP=$(curl -sS -o /dev/null -w "%{http_code}" -L -I "$FDK_URL" || echo "000")
if [[ "$HTTP" != "200" ]]; then
  echo "========================================="
  echo "ERROR: FDK tarball not available"
  echo "========================================="
  echo "URL: $FDK_URL"
  echo "HTTP Status: $HTTP"
  echo ""
  if [[ "$TARGET_VER" =~ ^9\\. ]]; then
    echo "This FDK 9.x version may not be published to the CDN."
    echo "Try: /fw-setup-downgrade (no version, uses latest 9.x)"
    echo "Or check https://cdn.freshdev.io/fdk/ for available versions"
  fi
  exit 1
fi

echo "Downgrading to FDK $TARGET_VER"

# Handle Homebrew (system-wide, no multi-version support)
if [[ "$INSTALL_METHOD" == "homebrew" ]]; then
  if [[ "$IS_NINE" == 1 ]]; then
    echo "ERROR: Homebrew does not support FDK 9.x downgrade"
    echo "FDK 9.x is deprecated. Use brew to stay on FDK 10.x or switch to nvm for multi-version support"
    exit 1
  fi
  
  echo "Downgrading FDK via Homebrew (system-wide)..."
  brew uninstall fdk 2>/dev/null || true
  
  if [[ "$TARGET_VER" == latest ]]; then
    brew install fdk || exit 1
  else
    # Homebrew doesn't easily support pinned versions via formula
    echo "WARNING: Homebrew may not support specific FDK 10.0.y versions"
    echo "Attempting install from CDN tarball..."
    npm install -g "$FDK_URL" || exit 1
  fi
  
  fdk version
  echo "Downgrade complete (Homebrew/system-wide)"
  exit 0
fi

# Handle Chocolatey (system-wide, no multi-version support)
if [[ "$INSTALL_METHOD" == "chocolatey" ]]; then
  echo "Downgrading FDK via Chocolatey (system-wide)..."
  choco uninstall fdk -y 2>/dev/null || true
  
  if [[ "$TARGET_VER" == latest ]]; then
    if [[ "$IS_NINE" == 1 ]]; then
      echo "WARNING: FDK 9.x deprecated (ends May 31, 2026)"
      # Chocolatey latest may be FDK 10.x; explicitly request 9.x if available
      choco install fdk --version=9.8.2 -y || exit 1
    else
      choco install fdk -y || exit 1
    fi
  else
    if [[ "$IS_NINE" == 1 ]]; then
      echo "WARNING: FDK 9.x deprecated (ends May 31, 2026)"
    fi
    choco install fdk --version=$TARGET_VER -y || exit 1
  fi
  
  refreshenv 2>/dev/null || true
  fdk version
  echo "Downgrade complete (Chocolatey/system-wide)"
  exit 0
fi

# For nvm/nvm-windows/npm-global: multi-version support via npm install
echo "Downgrading to FDK $TARGET_VER on Node $NODE_VER"

# Remove FDK from current Node
npm uninstall -g @freshworks/fdk 2>/dev/null || true
npm uninstall -g fdk 2>/dev/null || true
rm -rf ~/.fdk
npm cache clean --force

if [[ "$IS_NINE" == 1 ]]; then
  # Downgrading to FDK 9.x: remove FDK 10.x from Node 24 (exclusive operation)
  if nvm list | grep -q "v24"; then
    echo "Removing FDK 10.x from Node 24 (exclusive downgrade to FDK 9.x)..."
    nvm use 24 2>/dev/null || nvm use 24.11 2>/dev/null || true
    npm uninstall -g @freshworks/fdk 2>/dev/null || true
    npm uninstall -g fdk 2>/dev/null || true
  fi
  
  nvm list | grep v18 || nvm install 18.20
  nvm use 18.20
  NODE_VER="18.20"
else
  # Downgrading within FDK 10.x line: remove FDK 9.x from Node 18 if exists
  if nvm list | grep -q "v18"; then
    echo "Removing FDK 9.x from Node 18 (staying on FDK 10.x line)..."
    nvm use 18 2>/dev/null || nvm use 18.20 2>/dev/null || true
    npm uninstall -g @freshworks/fdk 2>/dev/null || true
    npm uninstall -g fdk 2>/dev/null || true
  fi
  
  nvm list | grep "v24\\.11" || nvm install 24.11
  nvm use 24.11
  NODE_VER="24.11"
fi
node --version

npm install -g "$FDK_URL" || exit 1

if [[ "$IS_NINE" == 1 ]]; then
  fdk version | grep -E '^9\\.' || { echo "FAILED: Not FDK 9.x"; exit 1; }
  
  # Get actual installed Node 18 version
  NODE_18_VER=$(nvm current)
  nvm alias default "$NODE_18_VER"
  
  echo "Downgrade complete: FDK 9.x on $NODE_18_VER (DEPRECATED)"
  echo ""
  echo "nvm alias default set to $NODE_18_VER — new terminals will use Node 18"
  echo "Current terminal: already on $NODE_18_VER"
else
  fdk version | grep -E '^10\\.' || { echo "FAILED: Not FDK 10.x"; exit 1; }
  nvm alias default 24.11
  echo "Downgrade complete: FDK 10.x on Node 24.11"
fi

MANDATORY VERIFICATION (auto-decline FDK upgrade prompts):
  printf 'n\\n' | fdk version || echo "FAILED: FDK not in current shell"
  if [[ "$IS_NINE" == 1 ]]; then
    printf 'n\\n' | fdk version | grep -q "Installed: 9\\." || echo "FAILED: Not FDK 9.x"
    node --version | grep -E '^v18\\.' || echo "FAILED: Not Node 18"
    nvm current | grep -E '^v18\\.' || echo "FAILED: nvm current is not Node 18"
  else
    printf 'n\\n' | fdk version | grep -q "Installed: 10\\." || echo "FAILED: Not FDK 10.x"
    node --version | grep -E '^v24\\.11\\.' || echo "WARNING: Node 24.11.x recommended"
    nvm current | grep -E '^v24\\.' || echo "FAILED: nvm current is not Node 24"
  fi
  zsh -c 'export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"; nvm use $NODE_VER >/dev/null; printf "n\\n" | fdk version' || bash -c 'export NVM_DIR="$HOME/.nvm"; [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"; nvm use $NODE_VER >/dev/null; printf "n\\n" | fdk version' || echo "FAILED: Not persistent"

REPORT:
  echo "FDK downgrade complete — URL: $FDK_URL"
  echo "Return to FDK 10.x: /fw-setup-upgrade (latest or --to 10.x.y) or /fw-setup-install"

SLASH_COMMAND_CLOSEOUT: Return after REPORT (or abort). No fdk run/tunnel in this Task.
  `
})

Read the full file on GitHub · 662 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. 3d ago First seen · 662 lines · 37 tokens per session scan C 055e5285e3ee

Subscribe to this mod's changes

fw-setup-downgrade is a command published in the GitHub repository freshworks-developers/fw-dev-tools (5 stars, last pushed 9d ago), licensed MIT. It adds 37 tokens to every session and 6,729 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it C with 2 findings (recursive force delete, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.