code-transfer
Code Transfer handles moving code blocks between files with exact line-number control. Choose between basic mode for small operations or execution mode for batch transfers across many files. Perfect for reorganizing functions, extracting classes, or inserting code at specific locations.
Code Transfer moves code blocks between files with precise line-number control for reorganizing functions, classes, and code sections.
AI-generated summary based on this skill's SKILL.md
Install
mhattingpete/claude-skills-marketplace/code-transfer · repository language: HTML
git clone https://github.com/mhattingpete/claude-skills-marketplace
cp -r claude-skills-marketplace/code-operations-plugin/skills/code-transfer ~/.claude/skills/code-transferFrequently asked questions
AI-generated answers based on this skill's SKILL.md and metadata
How does Code Transfer copy code from one file to another?
Code Transfer enables precise code copying between files using line-number control. You specify the source file, target file, and exact line ranges to copy. The skill handles the transfer while preserving formatting and structure, making it ideal for moving functions, classes, or code blocks with exact positional accuracy.
Can Code Transfer move a function to a different file?
Yes, Code Transfer specializes in moving functions to different files. You define the source location and target file, and the skill transfers the function with line precision. This is one of Code Transfer's primary use cases for modularizing code and reorganizing large codebases across multiple files efficiently.
What's the difference between basic and execution mode?
Code Transfer offers two operational modes. Basic mode handles small, individual code transfer operations between one or two files. Execution mode is designed for batch transfers across many files—ideal when you need to reorganize 10+ files or automate multiple code movements simultaneously.
How do I insert code at a specific line number?
Code Transfer lets you insert code at exact line numbers in target files. Specify the target file, the line number where insertion should occur, and the code content. The skill handles positioning precisely, whether you're inserting at line 50 or any other location in your codebase.
Can Code Transfer extract a class definition to a new file?
Absolutely. Code Transfer extracts classes to separate files for modularization. Identify the class location using line numbers, specify the new file destination, and Code Transfer handles the extraction and reorganization. This supports breaking large files into focused, maintainable modules.
Is Code Transfer suitable for batch code operations?
Yes. Code Transfer supports batch code transfer operations, making it efficient for reorganizing large codebases. When you need to move multiple code sections, functions, or classes across many files, execution mode automates these transfers at scale while maintaining line-based precision.
SKILL.md
rendered from the published skill — quoted content, verbatim
Code Transfer
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).
Operation Modes
Basic Mode (Default)
Use Read, Edit, Bash scripts for 1-10 file operations. Works immediately, no setup required.
Execution Mode (10+ files)
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)
When to Use
- "copy this code to [file]"
- "move [function/class] to [file]"
- "extract this to a new file"
- "insert at line [number]"
- "reorganize into separate files"
Core Operations
1.
(truncated - see the full file via the links below)
Read as markdown · JSON record · Browse the source repository
File tree — 2 files
code-operations-plugin/skills/code-transfer/SKILL.md
code-operations-plugin/skills/code-transfer/scripts/line_insert.py