sparq:refactor

Refactor end-to-end test references with checkpointed replacements and reports.

27|4|Updated Feb 27, 2026
One-click install
npx skills add https://github.com/STUkh/sparq-assistant --skill sparq-refactor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sparq:refactor
Source: https://github.com/STUkh/sparq-assistant/tree/main/claude/skills/sparq-refactor
Command: npx skills add https://github.com/STUkh/sparq-assistant --skill sparq-refactor

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Bulk update end-to-end test references after refactoring to reduce manual edits and prevent drift across test suites.

Core Features & Use Cases

  • Grep and identify occurrences of old identifiers (names, selectors, imports, strings) across e2e test suites.
  • Apply controlled, checkpointed replacements with reviewer approval before changes, then run smoke checks and generate a refactor report.
  • Ensure barrel re-exports and scope are preserved by validating changes and generating a structured output.

Quick Start

Run sparq:refactor with --from and --to targets to start a safe, checkpointed refactor in the e2e directory.

Frequently Asked Questions about sparq:refactor

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

FAQPage Schema
How do I bulk update Playwright e2e test references after a codebase refactor?

Bulk update Playwright e2e test references by running a scoped refactor with --from and --to patterns to grep and replace old identifiers, then verify changes with smoke checks and generate a refactor report.

What is the safest way to refactor end-to-end test selectors without breaking the suite?

Safe end-to-end test refactoring uses checkpointed replacements with reviewer approval before applying changes, ensuring barrel re-exports and scope are preserved by validating updates before finalizing.

Can I lint and smoke test my e2e directory automatically during a test reference migration?

Yes, e2e test reference migration runs optional lint steps and performs a smoke verification automatically before finalizing changes, ensuring the updated test suite remains valid.

Do I need to provide specific parameters to start an e2e test suite refactor?

Yes, e2e test suite refactoring requires that --from and --to patterns are provided and differ, targeting scoped e2e and test directories to grep identifiers and apply controlled replacements.

What happens if the source and target patterns match during an e2e test refactor?

E2e test refactoring cannot proceed if --from and --to patterns are identical, as the tool requires them to differ to ensure controlled, tracked replacements across the test suite.

How does a checkpointed test refactor report help prevent drift across test suites?

A checkpointed test refactor report documents all grep occurrences and controlled replacements, preventing drift by validating barrel re-exports and scope preservation before finalizing changes.