Scissors-Slice is a sister agent skill to Scissors# designed to help AI coding agents (such as Claude Code, Cursor, and Codex) refactor complex, monolithic source code files. It splits spaghetti code into clean, cohesive, single-responsibility submodules (adhering to the SOLID / SRP design principles).
To prevent accidental code loss or corruption, Scissors-Slice enforces a strict sequential workflow:
- Silent Extraction: The agent analyzes the monolithic file and writes the newly extracted modules (e.g.
api.js,ui.js) to your disk without touching or modifying your original code. - Interactive Confirmation: The agent pauses and displays the modular architecture proposal along with the created submodule files, requesting your explicit approval.
- Clean Integration: Only after you type your confirmation, the agent rewrites the main file to import the new submodules and clean up the monolithic blocks.
Clone this repository directly into the .agents/skills/scissors-slice directory of your active workspace:
git clone https://github.com/34pmrndc/Scissors-slice.git .agents/skills/scissors-sliceClaude Code will automatically discover and load the skill. You can trigger it in your CLI chat by asking:
"Usa la skill Scissors-Slice en el archivo src/app.js"
Copy the contents of the SKILL.md instructions file and paste it directly into your .cursorrules file at the root of your project. Claude 3.5 Sonnet inside Cursor will immediately inherit the guidelines to refactor your code modularly.
- examples/original_monolithic.js: A sample JavaScript file mixing theme toggle logic and navigation event handling.
- examples/sliced/: The clean, refactored solution:
theme.js(Theme logic submodule).navigation.js(Navigation logic submodule).main.js(Clean coordinator file importing both modules).
