rune-safeguard

Creates characterization tests, boundary markers, config freezes, and git rollback points before refactoring.

1|Updated Mar 22, 2026
One-click install
npx skills add https://github.com/dangvu008/VietTruyen --skill rune-safeguard-dangvu008
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rune-safeguard
Source: https://github.com/dangvu008/VietTruyen/tree/main/.agents/skills/rune-safeguard
Command: npx skills add https://github.com/dangvu008/VietTruyen --skill rune-safeguard-dangvu008

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Refactoring untested legacy code is risky because there is no way to detect behavior changes or roll back safely. This Skill builds a complete safety net before any surgery begins, capturing current behavior in tests and creating recovery points. ## Core Features & Use Cases - Characterization Tests: Writes tests that capture what the code currently does, including existing bugs, so any behavior change during refactoring is detected. - Boundary Markers & Config Freeze: Adds @legacy, @do-not-touch, and @bridge comments to source files and snapshots config files (tsconfig, ESLint, lockfiles) into .rune/ for baseline comparison. - Git Rollback Point: Creates a tagged commit (rune-safeguard-<module>) so any failed refactoring can be reverted instantly. - Use Case: Before refactoring a legacy payment module with no tests, run this Skill to generate characterization tests covering all public functions, freeze the config, and tag a rollback point — then proceed with surgery only after all tests pass on the unmodified code. ## Quick Start Use the rune-safeguard skill to build a safety net with characterization tests and a rollback tag for the billing module before I refactor it.

Frequently Asked Questions about rune-safeguard

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

FAQPage Schema
How do I write characterization tests for legacy code?

Characterization tests capture what the code currently does, not what it should do. Test the actual output of every public function, including bugs and surprising edge-case behavior, and never fix behavior inside these tests.

How to safely refactor untested legacy code?

First map the module's public interface, consumers, and dependencies, then write characterization tests that pass on the unmodified code. Add boundary markers, freeze config files, and create a git rollback tag before changing any logic.

Why must characterization tests pass on unmodified code?

They define the behavioral baseline that refactoring must preserve. If they fail on current code, the tests are wrong and cannot detect regressions, so the safety net is considered broken and refactoring must not start.

What is a git rollback point before refactoring?

It is a tagged commit created before surgery, such as rune-safeguard-<module>, that snapshots the working state. If the refactoring fails, you can revert to this tag instantly without losing work.

When should I not use characterization testing?

Avoid it for trivial modules with no external consumers or when code is being deleted rather than refactored. It also does not replace new feature tests — it only preserves existing behavior during structural changes.