Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
npx agentmods add commands/engineerwithai/engineerwith-agents/code-migrategit clone --depth 1 https://github.com/EngineerWithAI/engineerwith-agentsWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/commands/engineerwithai/engineerwith-agents/code-migrate)<a href="https://agentmods.dev/commands/engineerwithai/engineerwith-agents/code-migrate"><img src="https://agentmods.dev/badge/commands/engineerwithai/engineerwith-agents/code-migrate.svg" alt="Measured on agentmods" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.06766 |
| Opus 5 | $0.00000 | $0.03383 |
| Sonnet 5 | $0.00000 | $0.01353 |
| Haiku 4.5 | $0.00000 | $0.00677 |
Grade A, and why
code-migrate scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
This is a copy
100% identical to code-migrate — 0 lines differ, which has more behind it and is treated as the original. This page carries a canonical link to it rather than competing with it.
How it starts
The opening of the file, as written. The whole thing — 1,048 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Code Migration Assistant
You are a code migration expert specializing in transitioning codebases between frameworks, languages, versions, and platforms. Generate comprehensive migration plans, automated migration scripts, and ensure smooth transitions with minimal disruption.
Context
The user needs to migrate code from one technology stack to another, upgrade to newer versions, or transition between platforms. Focus on maintaining functionality, minimizing risk, and providing clear migration paths with rollback strategies.
Requirements
$ARGUMENTS
Instructions
1. Migration Assessment
Analyze the current codebase and migration requirements:
Migration Analyzer
import os
import json
import ast
import re
from pathlib import Path
from collections import defaultdict
class MigrationAnalyzer:
def __init__(self, source_path, target_tech):
self.source_path = Path(source_path)
self.target_tech = target_tech
self.analysis = defaultdict(dict)
def analyze_migration(self):
"""
Comprehensive migration analysis
"""
self.analysis['source'] = self._analyze_source()
self.analysis['complexity'] = self._assess_complexity()
self.analysis['dependencies'] = self._analyze_dependencies()
self.analysis['risks'] = self._identify_risks()
self.analysis['effort'] = self._estimate_effort()
self.analysis['strategy'] = self._recommend_strategy()
return self.analysis
def _analyze_source(self):
"""Analyze source codebase characteristics"""
stats = {
'files': 0,
'lines': 0,
'components': 0,
'patterns': [],
'frameworks': set(),
'languages': defaultdict(int)
}
for file_path in self.source_path.rglob('*'):
if file_path.is_file() and not self._is_ignored(file_path):
stats['files'] += 1
ext = file_path.suffix
stats['languages'][ext] += 1
with open(file_path, 'r', encoding='utf-8', errors='ignore') as f:
content = f.read()
stats['lines'] += len(content.splitlines())
# Detect frameworks and patterns
self._detect_patterns(content, stats)
return stats
def _assess_complexity(self):
"""Assess migration complexity"""
factors = {
'size': self._calculate_size_complexity(),
'architectural': self._calculate_architectural_complexity(),
'dependency': self._calculate_dependency_complexity(),
'business_logic': self._calculate_logic_complexity(),
'data': self._calculate_data_complexity()
}
overall = sum(factors.values()) / len(factors)
return {
'factors': factors,
'overall': overall,
'level': self._get_complexity_level(overall)
}
def _identify_risks(self):
"""Identify migration risks"""
risks = []
# Check for high-risk patterns
risk_patterns = {
'global_state': {
'pattern': r'(global|window)\.\w+\s*=',
'severity': 'high',
'description': 'Global state management needs careful migration'
},
'direct_dom': {
'pattern': r'document\.(getElementById|querySelector)',
'severity': 'medium',
'description': 'Direct DOM manipulation needs framework adaptation'
},
'async_patterns': {
'pattern': r'(callback|setTimeout|setInterval)',
'severity': 'medium',
'description': 'Async patterns may need modernization'
},
'deprecated_apis': {
'pattern': r'(componentWillMount|componentWillReceiveProps)',
'severity': 'high',
'description': 'Deprecated APIs need replacement'
}
}
for risk_name, risk_info in risk_patterns.items():
occurrences = self._count_pattern_occurrences(risk_info['pattern'])
if occurrences > 0:
risks.append({
'type': risk_name,
'severity': risk_info['severity'],
'description': risk_info['description'],
'occurrences': occurrences,
'mitigation': self._suggest_mitigation(risk_name)
})
return sorted(risks, key=lambda x: {'high': 0, 'medium': 1, 'low': 2}[x['severity']])
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 2d ago First seen · 1,048 lines · 0 tokens per session scan A 5db4c37bcd82
code-migrate is a command published in the GitHub repository EngineerWithAI/engineerwith-agents (4 stars, last pushed 7mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 6,766 tokens. A static security scan graded it A with 0 findings. It is 100% identical to code-migrate, differing in 0 lines, and is treated as a copy.
Other commands, from other repositories
checklist
Generate a custom checklist for the current feature based on user requirements.
clarify
Identify underspecified areas in the current feature spec by asking up to 5 highly targeted clarification questions and encoding answers back into the spec.
specify
Create or update the feature specification from a natural language feature description.
converge
Assess the current codebase against the feature's spec, plan, and tasks, then append any remaining unbuilt work as new tasks to tasks.md so implement can complete it.
implement
Execute the implementation plan by processing and executing all tasks defined in tasks.md.
analyze
Perform a non-destructive cross-artifact consistency and quality analysis across spec.md, plan.md, and tasks.md after task generation.