refactoring

Refactor Pact 5 modules with safe rename, extract, and inline operations.

1|1|Updated Jun 9, 2026
One-click install
npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill refactoring-pact-community-organization
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: refactoring
Source: https://github.com/Pact-Community-Organization/github-marketplace/tree/main/skills/refactoring
Command: npx skills add https://github.com/Pact-Community-Organization/github-marketplace --skill refactoring-pact-community-organization

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safe refactoring patterns for Pact 5 modules — rename, extract, inline, and restructure while preserving behavior and maintaining cross-module compatibility.

Core Features & Use Cases

  • Extract Function: Refactor inline logic into a standalone function to improve readability and reusability across modules.
  • Rename (Cross-Module): Update function names across dependent modules without breaking interfaces.
  • Constraints: Adhere to non-breaking changes, preserve API compatibility, and maintain module dependencies.

Quick Start

Follow the Safe Refactoring Protocol before modifying any module to ensure behavior remains intact.

Frequently Asked Questions about refactoring

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

FAQPage Schema
How do I safely rename a function across dependent Pact 5 modules?

To safely rename functions across dependent Pact 5 modules, apply cross-module renaming patterns that update function names without breaking interfaces or module dependencies. This preserves API compatibility and ensures cross-module compatibility throughout the refactoring process.

What is the best way to extract inline logic into a reusable function in Pact 5?

Extracting functions in Pact 5 involves refactoring inline logic into a standalone function to improve readability and reusability across modules. This technique restructures module layouts while maintaining non-breaking changes and preserving behavior.

Does refactoring Pact 5 modules require maintaining existing tests during modifications?

Yes, refactoring Pact 5 modules requires maintaining tests and validating behavior after modifications. Following a safe refactoring protocol ensures that extracted functions, renamed interfaces, and restructured layouts preserve the original behavior.

What constraints apply when restructuring module layouts in Pact 5?

Restructuring Pact 5 module layouts must adhere to constraints of non-breaking changes and API compatibility. You must preserve module dependencies, document changes, and validate behavior to ensure cross-module compatibility is not broken.

Can I inline helper functions while preserving API compatibility in Pact 5?

Yes, you can inline helpers in Pact 5 while preserving API compatibility. Inlining functions is a supported refactoring pattern that safely restructures module layouts without breaking dependent module interfaces or existing behavior.