safe-extraction
OfficialSafely split monolith code without breaking builds or tests.
Software Engineering#dependency injection#code extraction#barrel exports#refactoring safety#monolith refactoring#ci maintenance#test mocking
AuthorZaxbyHub
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Extracting code from large monolith files frequently causes CI invariant check failures, broken dependency injection seams used for test mocking, and cross-file test regressions. This Skill provides a step-by-step safety-first protocol to eliminate these common refactoring risks.
Core Features & Use Cases
- Barrel re-export management: Preserves existing public API import paths so no downstream consumer code requires updates.
- _internals DI seam preservation: Maintains test mockability for extracted functions via getter/setter proxy patterns.
- CI and test verification: Automates updates to CI path allowlists and validates full cross-file test compatibility post-extraction.
- Use Case: When splitting a 2000+ line guardrails module into dedicated submodules for a TypeScript OpenCode plugin, this Skill ensures all existing imports resolve, test mocks continue to work, and CI quality gates pass without manual intervention.
Quick Start
Use the safe-extraction skill to split the oversized src/hooks/guardrails.ts file into modular subfiles while preserving all existing functionality and test coverage.
Dependency Matrix
Required Modules
None requiredComponents
Standard package💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: safe-extraction Download link: https://github.com/ZaxbyHub/opencode-swarm/archive/main.zip#safe-extraction Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 537,000+ vetted skills library on demand.