refactor-structural-duplication

Detect structural duplication across modules sharing orchestration skeletons.

6|1|Updated Jan 5, 2026
Ready to run
npx skills add https://github.com/JordanGunn/skills --skill refactor-structural-duplication
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: refactor-structural-duplication
Source: https://github.com/JordanGunn/skills/tree/main/skills/refactor/structural-duplication
Command: npx skills add https://github.com/JordanGunn/skills --skill refactor-structural-duplication

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Identify structurally duplicate logic (pipeline-spine duplication) across semantically distinct modules. Use when multiple implementations share the same orchestration skeleton (e.g., bounds→shape→chunking→reduction→wrap), and unification may require subtle abstraction. Produces a duplication map and a safe extraction/refactor plan.

Core Features & Use Cases

  • Detect structural duplication across modules that share an orchestration skeleton but maintain distinct domain boundaries.
  • Produce a duplication map and a staged refactor plan to extract shared infrastructure without changing domain semantics.
  • Propose minimal abstraction seams to unify pipelines while preserving domain boundaries.

Quick Start

Follow the Procedure in references/03_PROCEDURE.md to perform a duplication audit and generate a staged refactor plan.

Frequently Asked Questions about refactor-structural-duplication

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

FAQPage Schema
How do I detect structural duplication across modules with parallel pipelines?▼

A pipeline spine is a shared orchestration skeleton—such as bounds, shape, chunking, reduction, and wrap—that multiple implementations follow. Identifying these spines reveals structurally duplicate logic across semantically distinct domains, enabling safe infrastructure extraction.

How do I refactor shared orchestration skeletons without breaking domain semantics?▼

Refactor shared orchestration skeletons by proposing minimal abstraction seams to unify pipelines while preserving domain boundaries. The approach generates a duplication map and a staged extraction plan to ensure domain semantics remain intact throughout the process.

Can I extract common infrastructure from multi-domain architectures with parallel pipelines?▼

Yes, you can extract common infrastructure from multi-domain architectures by mapping parallel pipelines to identify shared orchestration skeletons. The process produces a duplication map and a staged refactor plan to safely unify the infrastructure.

What is the best way to map pipeline spine duplication for a safe staged refactor?▼

The best way to map pipeline spine duplication is to perform a structured audit that identifies shared orchestration skeletons across modules. This yields a duplication map and a staged extraction plan, ensuring refactors preserve domain boundaries and semantics.

When should I avoid unifying pipeline spines across semantically distinct modules?▼

Avoid unifying pipeline spines when the orchestration skeleton duplication is superficial or when abstraction seams would blur domain boundaries. If pipelines lack a truly shared structural skeleton, forcing extraction may introduce unnecessary complexity and semantic drift.