Skip to content

34pmrndc/Scissors-slice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

✂️ Scissors-Slice - Code Modularizer & Concerns Splitter Agent Skill

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).


Scissors-Slice Logo


🔒 Safety First: The 3-Step Interactive Refactoring Flow

To prevent accidental code loss or corruption, Scissors-Slice enforces a strict sequential workflow:

  1. 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.
  2. Interactive Confirmation: The agent pauses and displays the modular architecture proposal along with the created submodule files, requesting your explicit approval.
  3. 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.

🚀 How to Install and Use

1. In Claude Code (Anthropic CLI)

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-slice

Claude 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"


2. In Cursor or VS Code (.cursorrules)

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.


🧪 Included Reference Examples

  • 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).

About

✂️ Scissors-Slice: An agent skill to automatically refactor and split monolithic code files into cohesive submodules.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors