migrating-apis
Implement API migrations between versions, platforms, or frameworks with minimal downtime. Use when upgrading APIs between versions. Trigger with phrases like "migrate the API", "upgrade API version", or "migrate to new API".
What this skill does
# Migrating APIs
## Overview
Implement API migrations between versions, frameworks, or platforms with minimal downtime using strangler fig pattern, parallel running, and traffic shadowing. Generate migration plans that map old endpoints to new equivalents, transform request/response formats, and validate data consistency between legacy and target implementations.
## Prerequisites
- Source API codebase and OpenAPI specification accessible for analysis
- Target framework or platform environment provisioned and accessible
- Traffic routing capability for gradual cutover (reverse proxy, feature flags, or API gateway)
- Database migration tools if schema changes accompany the API migration (Flyway, Alembic, Prisma Migrate)
- Integration test suite covering all existing API consumers
## Instructions
1. Inventory all existing endpoints using Grep and Read, documenting HTTP methods, URL patterns, request/response schemas, authentication mechanisms, and consumer dependencies.
2. Generate an endpoint mapping table that pairs each legacy endpoint with its target equivalent, flagging breaking changes in URL structure, field names, data types, and authentication flow.
3. Create request/response adapters that transform legacy format to target format, handling field renames, nested-to-flat conversions, and enum value changes.
4. Implement a traffic router (reverse proxy rules or middleware) that directs requests to either the legacy or target implementation based on migration phase, endpoint, or feature flag.
5. Set up traffic shadowing to duplicate production requests to the target implementation without serving target responses, comparing outputs for data consistency validation.
6. Build a migration dashboard tracking per-endpoint migration status (legacy-only, shadow, canary, migrated), error rates, and latency comparison between implementations.
7. Execute phased cutover: shadow (compare only) -> canary (1% traffic to target) -> gradual ramp (10%, 25%, 50%, 100%) -> legacy decommission, with automatic rollback triggers.
8. Validate migration completeness by running the full integration test suite against the target implementation and comparing response bodies with legacy for a representative request sample.
See `${CLAUDE_SKILL_DIR}/references/implementation.md` for the full implementation guide.
## Output
- `${CLAUDE_SKILL_DIR}/migration/endpoint-mapping.json` - Legacy-to-target endpoint mapping with change annotations
- `${CLAUDE_SKILL_DIR}/migration/adapters/` - Request/response transformation functions per endpoint
- `${CLAUDE_SKILL_DIR}/migration/router.js` - Traffic routing middleware with phase-based switching
- `${CLAUDE_SKILL_DIR}/migration/shadow-compare.js` - Traffic shadow comparison and diff reporting
- `${CLAUDE_SKILL_DIR}/migration/dashboard.md` - Migration progress tracking per endpoint
- `${CLAUDE_SKILL_DIR}/tests/migration/` - Parity tests comparing legacy and target responses
## Error Handling
| Error | Cause | Solution |
|-------|-------|----------|
| Response mismatch in shadow | Target returns different data than legacy for same request | Log diff details; classify as expected (intentional change) or bug; fix before canary phase |
| Adapter transformation failure | Legacy request contains edge-case field values not handled by adapter | Add fallback handling; log unmatched fields; expand adapter test coverage |
| Rollback triggered | Canary error rate exceeds threshold (e.g., >2% 5xx) | Automatically route traffic back to legacy; alert migration team; analyze failures |
| Consumer authentication break | Target uses different auth scheme than legacy | Run auth adapter translating legacy tokens to target format during transition |
| Data inconsistency | Database schema migration introduced transformation errors | Run data validation queries comparing legacy and target data stores; fix transformation logic |
Refer to `${CLAUDE_SKILL_DIR}/references/errors.md` for comprehensive error patterns.
## Examples
**Express to FastAPI migration**: Migrate a Node.js Express API to Python FastAPI, using nginx as the traffic router, shadowing production traffic for 1 week, then canary-releasing endpoint by endpoint over 4 weeks.
**REST to GraphQL migration**: Implement GraphQL resolvers that call the existing REST endpoints internally, gradually replacing REST data fetching with direct database access while maintaining the REST surface via a thin GraphQL-to-REST adapter.
**Monolith to microservices**: Extract a user management module from a monolithic API into a standalone service, using the strangler fig pattern with API gateway routing to direct `/users/*` traffic to the new service while other endpoints remain on the monolith.
See `${CLAUDE_SKILL_DIR}/references/examples.md` for additional examples.
## Resources
- Strangler Fig Application pattern: Martin Fowler
- Feature flag services: LaunchDarkly, Unleash, Flagsmith
- Traffic shadowing with Envoy proxy or Istio service mesh
- Blue-green and canary deployment strategies
Related in Backend & APIs
jfrog
IncludedInteract with the JFrog Platform via the JFrog CLI and REST/GraphQL APIs. Use this skill when the user wants to manage Artifactory repositories, upload or download artifacts, manage builds, configure permissions, manage users and groups, work with access tokens, configure JFrog CLI servers, search artifacts, manage properties, set up replication, manage JFrog Projects, run security audits or scans, look up CVE details, query exposures scan results from JFrog Advanced Security, manage release bundles and lifecycle operations, aggregate or export platform data, or perform any JFrog Platform administration task. Also use when the user mentions jf, jfrog, artifactory, xray, distribution, evidence, apptrust, onemodel, graphql, workers, mission control, curation, advanced security, exposures, or any JFrog product name.
cupynumeric-migration-readiness
IncludedPre-migration readiness assessor for porting NumPy to cuPyNumeric. Use BEFORE substantial porting work begins when the user asks whether code will scale on GPU, whether they should migrate to cuPyNumeric, which NumPy patterns transfer cleanly, what must be refactored before porting, or mentions pre-port assessment, scaling analysis, or refactor planning. Inspect the user's source code, look up NumPy usage, cross-reference the cuPyNumeric API support manifest, and distinguish distributed-scaling-friendly patterns from blockers such as unsupported APIs, scalar synchronization, host round-trips, Python/object-heavy control flow, shape/data-dependent branching, and in-place mutation hazards. Produce a verdict of READY, LIGHT REFACTOR, SIGNIFICANT REFACTOR, or NOT RECOMMENDED, with concrete refactor pointers.
alibabacloud-data-agent-skill
IncludedInvoke Alibaba Cloud Apsara Data Agent for Analytics via CLI to perform natural language-driven data analysis on enterprise databases. Data Agent for Analytics is an intelligent data analysis agent developed by Alibaba Cloud Database team for enterprise users. It automatically completes requirement analysis, data understanding, analysis insights, and report generation based on natural language descriptions. This tool supports: discovering data resources (instances/databases/tables) managed in DMS, initiating query or deep analysis sessions, real-time progress tracking, and retrieving analysis conclusions and generated reports. Use this Skill when users need to query databases, analyze data trends, generate data reports, ask questions in natural language, or mention "Data Agent", "data analysis", "database query", "SQL analysis", "data insights".
token-optimizer
IncludedReduce OpenClaw token usage and API costs through smart model routing, heartbeat optimization, budget tracking, and native 2026.2.15 features (session pruning, bootstrap size limits, cache TTL alignment). Use when token costs are high, API rate limits are being hit, or hosting multiple agents at scale. The 4 executable scripts (context_optimizer, model_router, heartbeat_optimizer, token_tracker) are local-only — no network requests, no subprocess calls, no system modifications. Reference files (PROVIDERS.md, config-patches.json) document optional multi-provider strategies that require external API keys and network access if you choose to use them. See SECURITY.md for full breakdown.
resend-cli
IncludedUse this skill when the task is specifically about operating Resend from an AI agent, terminal session, or CI job via the official resend CLI: installing/authenticating the CLI, sending/listing/updating/cancelling emails, batch sends, domains and DNS, webhooks and local listeners, inbound receiving, contacts, topics, segments, broadcasts, templates, API keys, profiles, or debugging Resend CLI/API failures. Trigger on mentions of Resend CLI, `resend`, `resend doctor`, `resend emails send`, `resend domains`, `resend webhooks listen`, `resend emails receiving`, or agent-friendly terminal automation.
alibabacloud-odps-maxframe-coding
IncludedUse this skill for MaxFrame SDK development and documentation navigation on Alibaba Cloud MaxCompute (ODPS). Helps answer MaxFrame API, concept, official example, and supported pandas API questions; create data processing programs; read/write MaxCompute tables; debug jobs (remote or local); and build custom DPE runtime images. Trigger when users mention MaxFrame, MaxCompute with MaxFrame, ODPS table processing, DPE runtime, MaxFrame docs/examples, DataFrame/Tensor operations, or GPU runtime setup. Works for both English and Chinese queries about Alibaba Cloud data processing with MaxFrame.