harness-refactoring

Refactor code with constraint verification and harness checks at each step.

18|11|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/Intense-Visions/harness-engineering --skill harness-refactoring
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: harness-refactoring
Source: https://github.com/Intense-Visions/harness-engineering/tree/main/agents/skills/claude-code/harness-refactoring
Command: npx skills add https://github.com/Intense-Visions/harness-engineering --skill harness-refactoring

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Safely refactor code with constraint verification at every step, ensuring behavior remains unchanged while enforcing architectural rules and preventing drift.

Core Features & Use Cases

  • End-to-end refactoring with safety rails: tests must pass before, during, and after each change.
  • Stepwise, atomic commits with clear guardrails and harness checks.
  • Guidance on phase-based execution (Prepare, Execute, Verify) and optional graph context.

Quick Start

Run one small refactoring step, verify tests pass before and after, and commit the change as a single atomic step.

Frequently Asked Questions about harness-refactoring

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

FAQPage Schema
How do I safely refactor code without changing behavior?

Safe refactoring requires constraint verification at every step. You prepare a baseline state, execute incremental changes, and verify with mandatory tests and harness checks to ensure behavior remains unchanged while enforcing architectural rules.

What is the best way to restructure code while enforcing architectural rules?

The best way to restructure code is through guardrail-led refactoring with stepwise atomic commits. This approach enforces architectural rules by running dependency checks and validation tests before, during, and after each incremental change.

How do I execute incremental refactoring steps with validation?

You execute incremental refactoring by running one small change, verifying tests pass before and after, and committing as a single atomic step. This phase-based execution includes Prepare, Execute, and Verify phases with mandatory harness checks.

When do I need to run harness checks during code restructuring?

You need to run harness checks during code restructuring at every step of the process. This includes mandatory tests, harness validate, and harness check-deps before, during, and after each incremental change to prevent architectural drift.

Does guardrail-led refactoring work with dependency checking?

Yes, guardrail-led refactoring works with dependency checking by enforcing harness check-deps at each step. This ensures that code restructuring satisfies dependency constraints and prevents drift while preserving the original behavior.

Why does my refactoring cause architectural drift despite passing tests?

Refactoring causes architectural drift when constraint verification is not applied at every step. Using guardrails with graph context guidance and mandatory harness checks prevents drift by enforcing rules during incremental code changes.