Skip to content
Back to skills

2242 Model Migration 367d3370

ASecurity

```python MODEL_MIGRATIONS = { "openai/gpt-4": "openai/gpt-4-turbo", "anthropic/claude-2": "anthropic/claude-3-haiku", "anthropic/claude-instant-1": "anthropic/claude-3-haiku", }

  • 9 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added October 11, 2026
ai-agentspython

Security analysis

A100/100

Scanned October 11, 2026

npx -y skills add tools-only/X-Skills --skill 2242-model-migration_367d3370 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of 2242 Model Migration 367d3370?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for 2242 Model Migration 367d3370
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/tools-only-2242-model-migration-367d3370/badge)](https://www.skillsdirectory.com/skills/tools-only-2242-model-migration-367d3370)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

SKILL.md
# Model Migration

## Model Migration

### Updating Model References
```python
# Old model name mapping
MODEL_MIGRATIONS = {
    "openai/gpt-4": "openai/gpt-4-turbo",
    "anthropic/claude-2": "anthropic/claude-3-haiku",
    "anthropic/claude-instant-1": "anthropic/claude-3-haiku",
}

def migrate_model_name(model: str) -> str:
    """Migrate deprecated model to current equivalent."""
    return MODEL_MIGRATIONS.get(model, model)

# Usage
old_model = "anthropic/claude-2"
new_model = migrate_model_name(old_model)
```

### Batch Model Update
```python
import re

def update_model_references(file_path: str):
    """Update model references in source file."""
    with open(file_path, 'r') as f:
        content = f.read()

    for old_model, new_model in MODEL_MIGRATIONS.items():
        # Match model in strings
        pattern = rf'["\']({re.escape(old_model)})["\']'
        content = re.sub(pattern, f'"{new_model}"', content)

    with open(file_path, 'w') as f:
        f.write(content)

# Apply to all Python files
import glob
for file in glob.glob("**/*.py", recursive=True):
    update_model_references(file)
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.