| name | mistral-upgrade-migration |
| description | Analyze, plan, and execute Mistral AI SDK upgrades with breaking change detection.
Use when upgrading Mistral SDK versions, detecting deprecations,
or migrating to new API versions.
Trigger with phrases like "upgrade mistral", "mistral breaking changes",
"update mistral SDK", "analyze mistral version".
|
| allowed-tools | Read, Write, Edit, Bash(npm:*), Bash(git:*) |
| version | 1.12.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","mistral","api","migration"] |
| compatibility | Designed for Claude Code, also compatible with Codex and OpenClaw |
Mistral AI Upgrade & Migration
Current State
!npm list @mistralai/mistralai 2>/dev/null || echo 'not installed'
!pip show mistralai 2>/dev/null | grep -E "^(Name|Version)" || echo 'not installed'
Overview
Guide for upgrading the Mistral AI SDK between major versions. The TypeScript SDK (@mistralai/mistralai) moved from CommonJS to ESM-only in v1.x, with significant API surface changes. This skill covers version detection, breaking change migration, automated code transforms, and rollback.
Prerequisites
- Current Mistral AI SDK installed
- Git for version control
- Test suite available
Instructions
Step 1: Check Versions
set -euo pipefail
npm list @mistralai/mistralai 2>/dev/null
npm view @mistralai/mistralai version
npm view @mistralai/mistralai versions --json | jq '.[-5:]'
pip show mistralai 2>/dev/null | grep Version
Step 2: Known Breaking Changes (v0.x to v1.x)
| Change | v0.x (old) | v1.x (current) |
|---|
| Module format | CommonJS + ESM | ESM only |
| Import | import MistralClient from '...' | import { Mistral } from '...' |
| Constructor | new MistralClient(apiKey) | new Mistral({ apiKey }) |
| Chat method | client.chat(params) | client.chat.complete(params) |
| Streaming | client.chatStream(params) | client.chat.stream(params) |
| Stream events | for await (const chunk of stream) | for await (const event of stream) access .data |
| Embeddings | client.embeddings(params) |