refactor-java-08-common-extract

Installation
SKILL.md

Common Module Extraction — refactor-chain · Java lane · step 08/09

Bundle: refactor-chain (orchestrated, self-healing refactor chain-of-skills). Lane: Java layered-architecture (Maven) · Position: step 08 of 09 · Prerequisite: refactor-java-07-api-naming · Next: refactor-java-09-code-optimize. Adaptivity: Selects the product-line ruleset from pom.xml <groupId> (grp.pt, grp.budget, gfmis.bgtex / com.ctjsoft.gfmis).

Purpose

This step consolidates shared code by extracting the public packages out of capability-layer modules into a grp-{module}-common module, so common code is managed in one place. Because directory structures differ between product lines, the skill detects the product line from pom.xml and loads the matching ruleset before acting. The public packages extracted into grp-{module}-common are: util, cache, constant, enums, exception, config. No business logic is changed during extraction.

When to use

  • The user wants to check whether shared code still lives inside business modules, or to migrate it into the common module.
  • Trigger phrases: "extract common module", "Step8 check", "Step8 fix", "check common packages", "extract common", "consolidate shared code".

Rules enforced

Detect the product line first (Step 0, non-skippable): read the root pom.xml, extract <groupId> (falling back to <parent>'s <groupId>), and map it to a product-line directory. Exact match takes priority over prefix match: grp.ptproducts/技术中台/; grp.budgetproducts/预算/; gfmis.bgtex, com.ctjsoft.gfmis, grp.gfmisproducts/执行/; grp.gfmis.* prefix → products/执行/; com.ctjsoft.gfmis.v3products/指标/; any other groupId falls back to the default products/技术中台/.

The public packages extracted into grp-{module}-common are: util, cache, constant, enums, exception, config.

Installs
1
GitHub Stars
3
First Seen
Jul 2, 2026
refactor-java-08-common-extract — ahmedbenaw/refactor-chain