lokalise-upgrade-migration
Analyze, plan, and execute Lokalise SDK upgrades with breaking change detection. Use when upgrading Lokalise SDK versions, detecting deprecations, or migrating to new API versions. Trigger with phrases like "upgrade lokalise", "lokalise migration", "lokalise breaking changes", "update lokalise SDK", "analyze lokalise version".
Best use case
lokalise-upgrade-migration is best used when you need a repeatable AI agent workflow instead of a one-off prompt.
Analyze, plan, and execute Lokalise SDK upgrades with breaking change detection. Use when upgrading Lokalise SDK versions, detecting deprecations, or migrating to new API versions. Trigger with phrases like "upgrade lokalise", "lokalise migration", "lokalise breaking changes", "update lokalise SDK", "analyze lokalise version".
Teams using lokalise-upgrade-migration should expect a more consistent output, faster repeated execution, less prompt rewriting.
When to use this skill
- You want a reusable workflow that can be run more than once with consistent structure.
When not to use this skill
- You only need a quick one-off answer and do not need a reusable workflow.
- You cannot install or maintain the underlying files, dependencies, or repository context.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/lokalise-upgrade-migration/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How lokalise-upgrade-migration Compares
| Feature / Agent | lokalise-upgrade-migration | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | Unknown | N/A |
Frequently Asked Questions
What does this skill do?
Analyze, plan, and execute Lokalise SDK upgrades with breaking change detection. Use when upgrading Lokalise SDK versions, detecting deprecations, or migrating to new API versions. Trigger with phrases like "upgrade lokalise", "lokalise migration", "lokalise breaking changes", "update lokalise SDK", "analyze lokalise version".
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Best AI Skills for Claude
Explore the best AI skills for Claude and Claude Code across coding, research, workflow automation, documentation, and agent operations.
ChatGPT vs Claude for Agent Skills
Compare ChatGPT and Claude for AI agent skills across coding, writing, research, and reusable workflow execution.
SKILL.md Source
# Lokalise Upgrade Migration
## Current State
!`npm list @lokalise/node-api 2>/dev/null | grep lokalise || echo 'SDK not installed'`
!`lokalise2 --version 2>/dev/null || echo 'CLI not installed'`
!`node --version 2>/dev/null || echo 'Node.js not available'`
!`cat package.json 2>/dev/null | grep -E '"type"|"module"' || echo 'No package.json type field'`
## Overview
Upgrade the `@lokalise/node-api` SDK between major versions with full breaking change detection, automated code transformation, and verification. The most significant migration is v8 (CommonJS) to v9+ (ESM-only), which requires changes to imports, module configuration, and potentially your build pipeline.
## Prerequisites
- Existing project using `@lokalise/node-api` (any version 6.x through 9.x)
- Node.js 18+ for SDK v9 (Node.js 14+ for v8 and below)
- Git repository with clean working tree (for safe rollback)
- Test suite that exercises Lokalise API calls
## Instructions
### Step 1: Assess Current Version and Target
```bash
set -euo pipefail
echo "=== Current SDK Version ==="
CURRENT=$(npm list @lokalise/node-api --json 2>/dev/null | node -e "
const d = JSON.parse(require('fs').readFileSync(0,'utf8'));
const v = d.dependencies?.['@lokalise/node-api']?.version || 'not found';
console.log(v);
")
echo "Installed: ${CURRENT}"
echo -e "\n=== Latest Available ==="
LATEST=$(npm view @lokalise/node-api version)
echo "Latest: ${LATEST}"
echo -e "\n=== All Major Versions ==="
npm view @lokalise/node-api versions --json | node -e "
const versions = JSON.parse(require('fs').readFileSync(0,'utf8'));
const majors = {};
versions.forEach(v => { const m = v.split('.')[0]; majors[m] = v; });
Object.entries(majors).forEach(([m, v]) => console.log(' v' + m + '.x latest: ' + v));
"
```
### Step 2: Review Breaking Changes by Version
| Version | Node.js | Module System | Key Breaking Changes |
|---------|---------|---------------|---------------------|
| **9.x** | 18+ | ESM only | `require()` removed, `import` only. Pagination returns typed cursors. `ApiError` export path changed. |
| **8.x** | 14+ | CJS + ESM | Last version supporting `require()`. Constructor accepts `apiKey` (not `token`). |
| **7.x** | 14+ | CJS | Cursor pagination introduced. `list()` methods return paginated objects. |
| **6.x** | 12+ | CJS | TypeScript rewrite. Method signatures changed from callbacks to promises. |
### Step 3: Migrate Imports (v8 CJS to v9 ESM)
This is the most impactful change. Every `require()` call must become an `import`.
**Find all Lokalise imports in your codebase:**
```bash
set -euo pipefail
grep -rn "require.*lokalise\|from.*lokalise" --include="*.ts" --include="*.js" --include="*.mjs" . || echo "No imports found"
```
**Transform patterns:**
```typescript
// BEFORE (v8 CommonJS)
const { LokaliseApi } = require('@lokalise/node-api');
const lok = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN });
// AFTER (v9 ESM)
import { LokaliseApi } from '@lokalise/node-api';
const lok = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN });
```
**Update `package.json` for ESM:**
```json
{
"type": "module"
}
```
**Update `tsconfig.json` if using TypeScript:**
```json
{
"compilerOptions": {
"module": "ES2022",
"moduleResolution": "bundler",
"target": "ES2022"
}
}
```
### Step 4: Update Pagination Code (v6/v7 to v9)
```typescript
// BEFORE (v6 offset pagination)
const keys = await lok.keys().list({
project_id: projectId,
page: 2,
limit: 100,
});
// AFTER (v9 cursor pagination — preferred for large datasets)
const keys = await lok.keys().list({
project_id: projectId,
limit: 500,
pagination: 'cursor',
cursor: previousCursor,
});
// Access next cursor: keys.nextCursor
// Check for more: keys.hasNextCursor()
```
### Step 5: Update Error Handling
```typescript
// BEFORE (v8)
const { ApiError } = require('@lokalise/node-api');
try {
await lok.projects().get(projectId);
} catch (e) {
if (e instanceof ApiError) {
console.error(e.message, e.code);
}
}
// AFTER (v9 — ApiError import path unchanged, but must use import)
import { ApiError } from '@lokalise/node-api';
try {
await lok.projects().get(projectId);
} catch (e) {
if (e instanceof ApiError) {
console.error(e.message, e.code);
}
}
```
### Step 6: Install and Verify
```bash
set -euo pipefail
# Create a safety branch
git checkout -b upgrade/lokalise-sdk-v9
# Install the target version
npm install @lokalise/node-api@latest
# Run TypeScript compilation check
npx tsc --noEmit 2>&1 | head -40 || true
# Run tests
npm test
```
### Step 7: Verify API Compatibility
```typescript
// Quick smoke test after upgrade
import { LokaliseApi } from '@lokalise/node-api';
const lok = new LokaliseApi({ apiKey: process.env.LOKALISE_API_TOKEN! });
// Test basic operations still work
const projects = await lok.projects().list({ limit: 1 });
console.log('API connection OK:', projects.items[0]?.name ?? 'no projects');
const keys = await lok.keys().list({
project_id: projects.items[0].project_id,
limit: 5,
pagination: 'cursor',
});
console.log('Cursor pagination OK:', keys.items.length, 'keys fetched');
```
## Output
- Updated `@lokalise/node-api` to target version
- All `require()` calls converted to ESM `import` (if upgrading to v9)
- `package.json` and `tsconfig.json` updated for ESM compatibility
- Pagination code migrated to cursor-based pattern
- Tests passing against the new SDK version
- Git branch with all changes for review
## Error Handling
| Issue | Cause | Solution |
|-------|-------|----------|
| `ERR_REQUIRE_ESM` | Using `require()` with v9 SDK | Convert to `import` syntax and set `"type": "module"` in package.json |
| `SyntaxError: Cannot use import` | Node.js file not recognized as ESM | Rename `.js` to `.mjs` or add `"type": "module"` |
| `TypeError: lok.keys is not a function` | API changed between major versions | Check SDK changelog for renamed methods |
| `ERR_UNKNOWN_FILE_EXTENSION .ts` | TypeScript not configured for ESM | Use `tsx` runner or configure `ts-node` with `"esm": true` |
| Tests fail after upgrade | Breaking API changes | Check test against the version-specific migration notes above |
## Examples
### Rollback Procedure
```bash
set -euo pipefail
# If the upgrade causes issues, revert immediately
git stash # Save any work in progress
npm install @lokalise/node-api@8 # Last CJS version
git checkout HEAD -- tsconfig.json package.json
npm test
echo "Rolled back to v8. Investigate failures before retrying."
```
### CLI Upgrade (Separate from SDK)
```bash
set -euo pipefail
# macOS
brew upgrade lokalise2
# Linux — download latest release binary
LATEST_CLI=$(curl -s https://api.github.com/repos/lokalise/lokalise-cli-2-go/releases/latest | grep -oP '"tag_name": "\K[^"]+')
curl -sL "https://github.com/lokalise/lokalise-cli-2-go/releases/download/${LATEST_CLI}/lokalise2_linux_x86_64.tar.gz" | tar xz
sudo mv lokalise2 /usr/local/bin/
# Verify
lokalise2 --version
```
### Check for Deprecated API Usage
```bash
set -euo pipefail
# Patterns that indicate outdated SDK usage
echo "=== Deprecated Patterns ==="
grep -rn "\.page\s*:" --include="*.ts" --include="*.js" . && echo "^ Offset pagination — migrate to cursor" || echo "No offset pagination found"
grep -rn "require.*lokalise" --include="*.ts" --include="*.js" . && echo "^ CommonJS require — migrate to ESM import" || echo "No CJS requires found"
grep -rn "new LokaliseApi.*token:" --include="*.ts" --include="*.js" . && echo "^ Old constructor — use apiKey instead of token" || echo "No old constructor pattern found"
```
## Resources
- [Node SDK Changelog](https://lokalise.github.io/node-lokalise-api/additional_info/changelog.html)
- [Node SDK GitHub](https://github.com/lokalise/node-lokalise-api)
- [API Changelog](https://developers.lokalise.com/docs/api-changelog)
- [CLI Releases](https://github.com/lokalise/lokalise-cli-2-go/releases)
- [ESM Migration Guide (Node.js)](https://nodejs.org/api/esm.html)
## Next Steps
- For CI pipeline changes needed after ESM migration, see `lokalise-ci-integration`.
- For performance improvements with the new cursor pagination, see `lokalise-performance-tuning`.
- Run `lokalise-debug-bundle` if the upgrade causes unexpected API errors.Related Skills
workhuman-upgrade-migration
Workhuman upgrade migration for employee recognition and rewards API. Use when integrating Workhuman Social Recognition, or building recognition workflows with HRIS systems. Trigger: "workhuman upgrade migration".
wispr-upgrade-migration
Wispr Flow upgrade migration for voice-to-text API integration. Use when integrating Wispr Flow dictation, WebSocket streaming, or building voice-powered applications. Trigger: "wispr upgrade migration".
windsurf-upgrade-migration
Upgrade Windsurf IDE, migrate settings from VS Code or Cursor, and handle breaking changes. Use when upgrading Windsurf versions, migrating from another editor, or handling configuration changes after updates. Trigger with phrases like "upgrade windsurf", "windsurf update", "migrate to windsurf", "windsurf from cursor", "windsurf from vscode".
windsurf-migration-deep-dive
Migrate to Windsurf from VS Code, Cursor, or other AI IDEs with full configuration transfer. Use when migrating a team to Windsurf, transferring Cursor rules, or evaluating Windsurf against other AI editors. Trigger with phrases like "migrate to windsurf", "switch to windsurf", "windsurf from cursor", "windsurf from copilot", "windsurf evaluation".
webflow-upgrade-migration
Analyze, plan, and execute Webflow SDK upgrades (webflow-api v1 to v3) with breaking change detection, API v1-to-v2 migration, and deprecation handling. Trigger with phrases like "upgrade webflow", "webflow migration", "webflow breaking changes", "update webflow SDK", "webflow v1 to v2".
webflow-migration-deep-dive
Execute major Webflow migrations — from other CMS platforms to Webflow CMS, between Webflow sites, or large-scale content re-architecture using the Data API v2 bulk endpoints, strangler fig pattern, and data validation. Trigger with phrases like "migrate to webflow", "webflow migration", "import into webflow", "webflow replatform", "move content to webflow", "webflow bulk import", "wordpress to webflow".
vercel-upgrade-migration
Upgrade Vercel CLI, Node.js runtime, and Next.js framework versions with breaking change detection. Use when upgrading Vercel CLI versions, migrating Node.js runtimes, or updating Next.js between major versions on Vercel. Trigger with phrases like "upgrade vercel", "vercel migration", "vercel breaking changes", "update vercel CLI", "next.js upgrade on vercel".
vercel-migration-deep-dive
Migrate to Vercel from other platforms or re-architecture existing Vercel deployments. Use when migrating from Netlify, AWS, or Cloudflare to Vercel, or when re-platforming an existing Vercel application. Trigger with phrases like "migrate to vercel", "vercel migration", "switch to vercel", "netlify to vercel", "aws to vercel", "vercel replatform".
veeva-upgrade-migration
Veeva Vault upgrade migration for REST API and clinical operations. Use when working with Veeva Vault document management and CRM. Trigger: "veeva upgrade migration".
veeva-migration-deep-dive
Veeva Vault migration deep dive for enterprise operations. Use when implementing advanced Veeva Vault patterns. Trigger: "veeva migration deep dive".
vastai-upgrade-migration
Upgrade Vast.ai CLI, migrate API versions, and handle breaking changes. Use when upgrading vastai CLI, detecting deprecations, or migrating between API versions. Trigger with phrases like "upgrade vastai", "vastai migration", "vastai breaking changes", "update vastai CLI".
vastai-migration-deep-dive
Migrate GPU workloads to or from Vast.ai, or between GPU providers. Use when switching from AWS/GCP/Azure GPU instances to Vast.ai, migrating between GPU types, or re-platforming ML infrastructure. Trigger with phrases like "migrate to vastai", "vastai migration", "switch to vastai", "vastai from aws", "vastai from lambda".