code-transfer/SKILL.md
Transfer code between files with line-based precision. Use when users request copying code from one location to another, moving functions or classes between files, extracting code blocks, or inserting code at specific line numbers.
npx skillsauth add rm2thaddeus/aitor_skills code-transferInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Transfer code between files with precise line-based control. Dual-mode operation: native tools (1-10 files) or execution mode (10+ files, 90% token savings).
Use Read, Edit, Bash scripts for 1-10 file operations. Works immediately, no setup required.
from api.filesystem import batch_copy
from api.code_analysis import find_functions
functions = find_functions('app.py', pattern='handle_.*')
operations = [{
'source_file': 'app.py',
'start_line': f['start_line'],
'end_line': f['end_line'],
'target_file': 'handlers.py',
'target_line': -1
} for f in functions]
batch_copy(operations)
Read(file_path="src/auth.py") # Full file
Read(file_path="src/auth.py", offset=10, limit=20) # Line range
Grep(pattern="def authenticate", -n=true, -A=10) # Find function
Use line_insert.py script for line-based insertion:
python3 skills/code-transfer/scripts/line_insert.py <file> <line_number> <code> [--backup]
Examples:
# Insert function at line 50
python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "def helper():\n pass"
# Insert with backup
python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "code" --backup
# Insert at beginning
python3 skills/code-transfer/scripts/line_insert.py src/new.py 1 "import os"
When to use:
Use Edit when insertion point is relative to existing code:
Edit(
file_path="src/utils.py",
old_string="def existing():\n pass",
new_string="def existing():\n pass\n\ndef new():\n return True"
)
Grep(pattern="def validate_user", -n=true, -A=20)Read(file_path="auth.py", offset=45, limit=15)Read(file_path="validators.py")line_insert.py or Edit based on contextGrep(pattern="class DatabaseConnection", -n=true, -A=50)Read(file_path="original.py", offset=100, limit=50)Write(file_path="database.py", content="<extracted>")Edit in original fileEdit with replacementRead(file_path="main.py", offset=20, limit=10)python3 skills/code-transfer/scripts/line_insert.py main.py 25 "logger.info('...')" --backupRead(file_path="main.py", offset=23, limit=5)Read(file_path="utils.py")Grep(pattern="^def |^class ", -n=true)Write new filesPlanning:
Preservation:
Validation:
Backups:
--backup for significant changesdevelopment
Export Dev Graph UI assets and dashboard data. Use when the user asks for structure SVG exports, timeline SVG/MP4 exports, per-commit SVGs, sprint-linked visuals, or dashboard/analytics JSON from the Dev Graph API.
development
Create HTML dashboards with KPI metric cards, bar/pie/line charts, progress indicators, and data visualizations. Use when users request dashboards, metrics displays, KPI visualizations, data charts, or monitoring interfaces.
development
Analyzes CSV files, generates summary stats, and plots quick visualizations using Python and pandas.
tools
Analyzes your Claude Code conversation history to identify patterns, common mistakes, and opportunities for workflow improvement. Use when user wants to understand usage patterns, optimize workflow, identify automation opportunities, or check if they're following best practices.