module-decomposition

Decompose large entangled modules into mutually exclusive submodules with dependency topology.

4|1|Updated Dec 11, 2025
One-click install
npx skills add https://github.com/yoyooyooo/logix --skill module-decomposition
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: module-decomposition
Source: https://github.com/yoyooyooo/logix/tree/main/.codex/skills/module-decomposition
Command: npx skills add https://github.com/yoyooyooo/logix --skill module-decomposition

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Helps you safely decompose oversized or overly entangled modules into mutually exclusive submodules without changing external semantics, reducing coupling and conflict surface during planning or implementation.

Core Features & Use Cases

  • 无损修剪不变量保障: Preserves exported semantics and enforces a one-way import topology, treating cycles as boundary-design failures.
  • Two decomposition shapes: Supports flat tiling for a single主体 and directory-based organization for subsystem-style decomposition, preventing directory drift.
  • Agent-friendly handoff protocol: Produces a standardized Decomposition Brief (mutually exclusive submodule list, naming/landing, dependency topology, migration steps, validation strategy) that can be pasted into any workflow artifact.

Quick Start

Ask an AI to “scan the target TypeScript codebase for files ≥ 1000 LOC, then produce a Decomposition Brief that defines mutually exclusive submodules, their allowed dependency direction, and a step-by-step no-loss pruning migration plan for each candidate.”

Frequently Asked Questions about module-decomposition

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I refactor a large TypeScript module without breaking external behavior?

To refactor a large TypeScript module without breaking behavior, use a no-loss decomposition strategy that preserves exported semantics. This involves splitting entangled code into mutually exclusive submodules while enforcing a one-way dependency topology to prevent cycles.

What is module decomposition in frontend runtime architecture planning?

Module decomposition in frontend runtime architecture planning is the process of breaking down oversized files or directories into mutually exclusive submodules. It enforces explicit non-loss invariants and dependency topology to reduce coupling without changing external semantics.

How do I prevent dependency cycles when splitting large React components?

To prevent dependency cycles when splitting large React components, enforce a one-way import topology during module decomposition. Treat cycles as boundary-design failures and require explicit dependency direction mapping before implementing the refactor.

Can I use no-loss pruning for TypeScript files under 1000 LOC?

No-loss pruning is designed for files or directories that exceed a LOC threshold, typically around 1000 LOC. While it can technically apply to smaller files, the overhead of generating a Decomposition Brief is best suited for oversized, entangled modules.

What's the best way to plan an incremental TypeScript refactoring migration?

The best way to plan an incremental TypeScript refactoring migration is to generate a standardized Decomposition Brief containing mutually exclusive submodule lists, naming conventions, dependency topology, and step-by-step validation strategies suitable for agent-driven workflows.

Why does directory drift happen during subsystem-style module decomposition?

Directory drift happens during subsystem-style module decomposition when files are moved without a strict organizational shape. Enforcing a two-shape decomposition model, using flat tiling for single subjects and directory-based organization for subsystems, prevents this drift.