data-migration-versioning
Provides systematic data format migration and versioning for backward-compatible schema changes. Use when "add data versioning", "migrate data format", "backward compatible file format", "upgrade v1 to v2", "schema migration", "support old file format", or "migrate JSON structure". Covers version numbering strategies (semantic, dotted, integer, date-based), backward compatibility patterns (auto-convert, explicit migration, dual-format), auto-upgrade timing, field deprecation, testing checklists, and common pitfalls like partial data preservation. Works with JSON, YAML, database schemas, and configuration files in Python, JavaScript, Go, Rust.
What this skill does
# Data Migration & Versioning
## Table of Contents
### Core Sections
- [When to Use This Skill](#when-to-use-this-skill) - Trigger phrases and situations
- [What This Skill Does](#what-this-skill-does) - Migration workflow and outcomes
- [Quick Start](#quick-start) - Immediate examples
- [Example 1: JSON Format Migration](#example-1-json-format-migration) - v1.0 → v2.0 upgrade
- [Example 2: Auto-Upgrade on Load](#example-2-auto-upgrade-on-load) - Transparent migration
### Migration Process
- [Version Numbering Strategies](#version-numbering-strategies) - Semantic, dotted, integer versioning
- [Backward Compatibility Patterns](#backward-compatibility-patterns) - Load old formats
- [Auto-Upgrade Timing](#auto-upgrade-timing) - When to migrate (load, save, update)
- [Field Deprecation Workflow](#field-deprecation-workflow) - Remove old fields safely
- [Testing Checklist](#testing-checklist) - Comprehensive migration validation
### Implementation
- [Migration Workflow](#migration-workflow) - 7-step process
- [Common Pitfalls](#common-pitfalls) - Anti-patterns to avoid
- [Language-Specific Patterns](#language-specific-patterns) - Python, JavaScript, Go, Rust
### Supporting Resources
- [Supporting Files](#supporting-files) - References, examples, templates, scripts
- [Examples](#examples) - Real-world migration patterns
- [Troubleshooting](#troubleshooting) - Common issues and solutions
## Purpose
Provides systematic guidance for migrating data formats (JSON, YAML, SQLite, config files) with version numbering and backward compatibility. Prevents data loss during migrations by enforcing testing checklists and detecting common anti-patterns like partial preservation. Essential when evolving file formats, adding features that require schema changes, or supporting multiple versions of data structures.
## When to Use This Skill
**Use when:**
- Adding version field to existing data format
- Migrating from v1.0 to v2.0 (or any version change)
- Adding new fields that change data structure
- Supporting multiple schema versions simultaneously
- Upgrading file formats (JSON, YAML, config files)
- Migrating database schemas with backward compatibility
**User trigger phrases:**
- "add data versioning"
- "migrate data format"
- "backward compatible file format"
- "upgrade v1 to v2"
- "schema migration"
- "support old file format"
- "migrate JSON structure"
**NOT for:**
- Breaking changes without backward compatibility
- Database migrations with ORM tools (use Alembic, Flyway, etc.)
- API versioning (different concern)
## What This Skill Does
Guides you through a systematic data migration process:
1. **Version Numbering** - Choose appropriate versioning scheme
2. **Backward Compatibility Design** - Load old formats transparently
3. **Auto-Upgrade Strategy** - Decide when to migrate data
4. **Migration Implementation** - Write conversion code
5. **Field Cleanup** - Remove deprecated fields
6. **Testing** - Validate all migration paths
7. **Documentation** - Record format changes
**Result:** ✅ Safe migration with zero data loss and backward compatibility
## Quick Start
### Example 1: JSON Format Migration
**Scenario:** Adding multi-material support to layout optimizer
**Before (v1.0):**
```json
{
"version": "1.0",
"material": "18mm Plywood",
"result": { ... }
}
```
**After (v2.0):**
```json
{
"version": "2.0",
"materials": {
"18mm Plywood": { "result": { ... } },
"6mm MDF": { "result": { ... } }
}
}
```
**Migration code:**
```python
def load_layout(path):
data = json.loads(path.read_text())
version = data.get("version", "1.0")
if version == "1.0":
# Auto-convert to v2.0 structure
material = data.get("material", "Unknown")
result = PackingResult.from_dict(data["result"])
return {material: result}, config # Return as dict
elif version == "2.0":
# Load v2.0 format
results = {}
for mat_name, mat_data in data["materials"].items():
results[mat_name] = PackingResult.from_dict(mat_data["result"])
return results, config
```
**Outcome:** Old v1.0 files load seamlessly, returned in v2.0 structure
### Example 2: Auto-Upgrade on Load
**User workflow:**
```
1. User has old v1.0 file: layout-old.json
2. Loads file via load_layout()
3. Adds new material
4. Saves via update_layout()
5. File automatically upgraded to v2.0
6. Both old and new materials preserved ✅
```
**Critical anti-pattern detected by this skill:**
```python
# ❌ BAD: Only saves original material during upgrade
materials_data = {
original_material: {"result": results[original_material].to_dict()}
}
# RESULT: New materials LOST! 💥
# ✅ GOOD: Iterate through ALL materials
materials_data = {}
for mat_name, result in results.items():
materials_data[mat_name] = {"result": result.to_dict()}
# RESULT: All materials preserved ✅
```
## Instructions
### Step 1: Choose Version Numbering Strategy
**Semantic Versioning (MAJOR.MINOR.PATCH):**
- Use for: Libraries, APIs, public data formats
- Example: `{"version": "2.1.0"}`
**Dotted Versioning (MAJOR.MINOR):**
- Use for: Application data files, configuration files
- Example: `{"version": "2.0"}`
**Integer Versioning (1, 2, 3):**
- Use for: Internal formats, simple migrations
- Example: `{"version": 2}`
**Date-Based Versioning (YYYY-MM-DD):**
- Use for: Configuration files, data exports, snapshots
- Example: `{"version": "2025-12-21"}`
See [references/detailed-patterns.md](./references/detailed-patterns.md#version-numbering-strategies-detailed) for complete guide.
### Step 2: Design Backward Compatibility Pattern
**Pattern 1: Auto-Convert on Load (Recommended)**
```python
def load_data(path):
data = json.loads(path.read_text())
version = data.get("version", "1.0")
if version == "1.0":
return convert_v1_to_v2(data) # Auto-convert in memory
elif version == "2.0":
return load_v2(data)
else:
raise ValueError(f"Unsupported version: {version}")
```
**When to use:** Most applications (transparent, works with read-only files)
**Pattern 2: Explicit Migration Script**
- Use for: Large datasets, breaking changes, user needs notification
**Pattern 3: Dual-Format Support**
- Use for: Transitional periods, multiple clients with different versions
See [references/detailed-patterns.md](./references/detailed-patterns.md#backward-compatibility-patterns-detailed) for all patterns.
### Step 3: Choose Auto-Upgrade Timing
**Option 1: On Load (Recommended)**
- Advantage: Immediate compatibility, works with read-only files
- Disadvantage: File stays in old format until saved
**Option 2: On First Save**
- Advantage: File updated to new format on disk
- Disadvantage: File remains old format if never saved
**Option 3: On First Update (Hybrid)**
- Advantage: File loads in any format, upgrades only when modified
- Disadvantage: More complex logic
**Option 4: Manual Migration Tool**
- Advantage: User controls timing, can handle large batches
- Disadvantage: Requires user action
See [references/detailed-patterns.md](./references/detailed-patterns.md#auto-upgrade-timing-detailed) for implementation examples.
### Step 4: Implement Load Function
```python
def load_multi_version(path):
data = json.loads(path.read_text())
version = data.get("version", "1.0")
if version == "1.0":
return load_v1(data) # Auto-convert
elif version == "2.0":
return load_v2(data)
else:
raise ValueError(f"Unsupported version: {version}")
```
### Step 5: Implement Save/Update Functions with Field Cleanup
```python
def update_layout(path, results):
"""Update existing file, auto-upgrade if v1.0."""
data = json.loads(path.read_text())
version = data.get("version", "1.0")
if version == "1.0":
# Upgrade to v2.0 - save ALL materials (not just original!)
data["version"] = "2.0"
data["materials"] = {
mat_name: {"result": result.to_dict()}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.