cross-refactoring

Orchestrates multiple AI CLIs to propose, apply, and verify refactorings on a pull request until convergence.

1|Updated Apr 21, 2026
One-click install
npx skills add https://github.com/devbasex/ai-plugins --skill cross-refactoring-devbasex
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: cross-refactoring
Source: https://github.com/devbasex/ai-plugins/tree/main/plugins/ndf/skills/cross-refactoring
Command: npx skills add https://github.com/devbasex/ai-plugins --skill cross-refactoring-devbasex

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve? Coordinating large-scale refactoring across a pull request is risky: a single reviewer or model may miss structural issues, behavior changes can slip in unnoticed, and there is no systematic way to converge on a stable set of improvements. This Skill distributes proposal, application, and verification work across multiple AI CLI runtimes (claude, codex, agy, kiro) and loops until no new refactoring proposals appear. ## Core Features & Use Cases - Multi-runtime convergence loop: Three CLIs propose structural improvements, proposals are deduplicated and prioritized, then applied in non-overlapping groups with one commit per apply round. - Test-first safety net: A test-provisioning round adds characterization tests before any structural change, and every apply round is verified by running the baseline test command; failing groups are reverted. - Mechanical verification: Commit trailers, diff budgets, scope enforcement, and test expectation checks are validated from git and real test runs rather than agent self-reports. - Use Case: Given draft PR #130 touching src/services, run the skill with a scope and baseline test command so that codex, agy, and kiro propose refactorings, apply them round by round, and finish with a cross-review gate and a metrics report. ## Quick Start Ask the AI to run /ndf:cross-refactoring on your draft pull request with a scope like src/services plus tests/services and a baseline test command such as pytest -q.

Frequently Asked Questions about cross-refactoring

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

FAQPage Schema
How do I run a multi-AI refactoring loop on a pull request?▼

Invoke /ndf:cross-refactoring with the PR number, a --scope covering both source and test directories, and a --baseline-test command. The skill then loops proposal, apply, and verification rounds across claude, codex, agy, and kiro until no new proposals appear.

What is the difference between cross-refactoring and cross-review?▼

cross-review converges review feedback on a pull request, while cross-refactoring converges structural improvement proposals. cross-refactoring adds test provisioning, apply rounds with one commit per group, and mechanical verification via git and real test execution.

Which AI CLIs does cross-refactoring support?▼

It supports claude, codex, agy, and kiro as participants. The host runtime only orchestrates and may apply changes; the other three propose. All participating CLIs must be logged in, and init aborts if any authentication check fails.

Why does cross-refactoring require a baseline test command?▼

The baseline test proves behavior is unchanged after each apply round, which is the definition of refactoring used here. Without it, init refuses to start, and the scope must also include the test directory so added characterization tests actually run.

What happens when a refactoring round fails its tests?▼

The failing apply group enters fix rounds up to --max-fix-rounds. If tests still fail, only that group's commit is reverted via revert and cherry-pick replay, and the items are recorded as excluded so they are not re-proposed.

Can I limit how many refactorings are applied per round?▼

Yes, use --max-items-per-round to cap adopted proposals per round and --max-outer-rounds to cap proposal rounds. Lowering the items cap reduces the blast radius when a group fails, since one failure reverts the whole group.