code-transfer

Featured

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.

AI & Automation 657 stars 91 forks Updated 3 days ago Apache-2.0

Install

View on GitHub

Quality Score: 92/100

Stars 20%
94
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# 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) ```python 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. Extract Source Code ``` 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 ``` ### 2. Insert at Specific Line Use `line_insert.py` script for line-based insertion: ```bash python3 skills/code-transfer/scripts/line_insert.py <file> <line_number> <code> [--backup] ``` **Examples:** ```bash # Insert function at line 50 python3 skills/code-transfer/scripts/line_insert.py src/utils.py 50 "def helper():\n pa...

Details

Author
mhattingpete
Repository
mhattingpete/claude-skills-marketplace
Created
9 months ago
Last Updated
3 days ago
Language
HTML
License
Apache-2.0

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category