From aws-sdk-v2-to-v3-migration
Use when the codebase still imports from 'aws-sdk' v2, uses new AWS.*() constructors, .promise() calls, AWS.config.update(), DocumentClient, or s3.upload() — and needs a safe modular v3 migration without changing runtime behavior.
How this skill is triggered — by the user, by Claude, or both
Slash command
/aws-sdk-v2-to-v3-migration:aws-sdk-v2-to-v3-migrationThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
- The codebase still imports `aws-sdk` v2 clients or constructs them with `new AWS.*`.
aws-sdk v2 clients or constructs them with new AWS.*..promise(), AWS.config.update(...), DocumentClient, or s3.upload(...).@aws-sdk/client-* packages — it is already on v3.Required before editing
Helpful if present
Only investigate if encountered
Inventory the v2 imports and service constructors before editing any files:
grep -r "require('aws-sdk')\|from 'aws-sdk'" --include="*.ts" --include="*.js" -l
grep -r "new AWS\." --include="*.ts" --include="*.js" -l
List the services found, then start with the smallest self-contained service surface.
Consult references/service-mappings.md for the
correct v3 package names and API shapes before writing any code.
aws-sdk v2 imports and the services in use.@aws-sdk/client-<service> packages (and any utility packages such as @aws-sdk/lib-storage).new AWS.Service() with the corresponding v3 client and explicit configuration.client.send(new Command(...)), preserving input shapes and response handling.unknown or any shortcuts just to clear type errors.Run the existing tests or targeted checks that cover the migrated services.
Confirm no imports still pull from the v2 aws-sdk package on the migrated surface.
Spot-check real behavior for pagination, streams, uploads, marshalling, and expected error types.
Smoke test:
terraform-skill)const s3 = new AWS.S3() and s3.upload(...) to S3Client plus Upload from @aws-sdk/lib-storage, then update the mocks."aws-sdk and now new AWS.SQS() is everywhere — help me finish the v3 migration safely."// v2
const s3 = new AWS.S3({ region: 'us-east-1' });
await s3.upload({ Bucket, Key, Body }).promise();
// v3
import { S3Client } from '@aws-sdk/client-s3';
import { Upload } from '@aws-sdk/lib-storage';
const s3 = new S3Client({ region: 'us-east-1' });
await new Upload({ client: s3, params: { Bucket, Key, Body } }).done();
references/service-mappings.md — v2→v3 package names, client construction, API call patterns, pagination, DynamoDB DocumentClient, streaming, and error handling.references/testing-mocks.md — replacing v2 mock patterns with @aws-sdk/client-mock, jest.spyOn, or dependency injection.Creates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.
npx claudepluginhub matt-riley/lucky-hat --plugin aws-sdk-v2-to-v3-migration