CommunityCodierung & Entwicklunggithub.com

Safe-Refactor

Strukturänderungen am Code unter Wahrung des Verhaltens durchführen. Verwenden für Extraktion, Konsolidierung, Verschiebungen von Zuständigkeiten oder Bereinigung, wenn die Überprüfung die strukturellen Änderungen einklammern muss.

Was ist Safe-Refactor?

Die Skill 'Safe-Refactor' definiert eine Methodik zur sicheren Umstrukturierung von Code, bei der das Verhalten des Systems erhalten bleibt. Sie legt eine klare Verhaltensgrenze fest und fordert, vor strukturellen Änderungen eine Überprüfung zu etablieren. Der Ansatz ist plattformunabhängig und eignet sich für Aufgaben wie Extraktion, Konsolidierung, Verschiebung von Code-Zuständigkeiten oder allgemeine Bereinigung. Wichtig ist, dass Feature-Änderungen außerhalb des Refactorings bleiben, nur eine Ownership-Grenze pro Schritt verschoben wird, öffentliche Schnittstellen und Fehlerverhalten erhalten bleiben und Zwischenstände build- und testbar sein müssen. Nach der Änderung wird der gleiche Test (proof) erneut durchgeführt, bis das Verhalten übereinstimmt und die gewünschte Struktur erreicht ist.

Funktioniert mit~Claude Code~Codex CLI~Cursor
npx skills add https://github.com/JuliusBrussee/caveman/tree/main/skills/safe-refactor

Installed? Explore more Codierung & Entwicklung skills: steipete/bluebubbles, steipete/eightctl, steipete/blucli · View all 6 →

In Ihrer bevorzugten KI fragen

Öffnet einen neuen Chat, in dem dieser Agent-Skill bereits geladen ist.

Dokumentation

Was macht Safe-Refactor?

Definiere die Verhaltensbewahrungsgrenze und etabliere die Überprüfung vor strukturellen Änderungen.

  • Lasse Feature-Änderungen außerhalb des Refactorings.
  • Verschiebe jeweils eine Ownership-Grenze.
  • Bewahre öffentliche Schnittstellen, Fehlerverhalten, Reihenfolge und Kompatibilität, sofern nicht explizit abweichend definiert.
  • Halte Zwischenzustände build- und testbar.
  • Vermeide Abhängigkeits- oder Konfigurationswachstum ohne Notwendigkeit für die Korrektheit.

Führe denselben Test nach der Änderung durch. Stoppe, wenn das Verhalten übereinstimmt und die angeforderte Struktur erreicht ist.

Individual skills in this repo

This repo contains 12 individual skills — each has its own dedicated page.

JuliusBrussee/caveman-discover

Find and label every LLM workflow in the repository so Caveman Cloud groups spend by workflow instead of one bucket. Use for "discover workflows" or breaking LLM spend down by workflow.

JuliusBrussee/caveman-evidence-review

Read-only review of Caveman Cloud evidence: cost, Cave Score, workflows, traces, latency, errors, routing, savings. Use when asked what Caveman found or where LLM spend goes.

JuliusBrussee/caveman-explore

Read-only repository explorer for cold-start orientation, broad cross-file localization, or when a direct search failed. Skip it when the exact file or symbol is already named. Returns path:line citations only; its reads stay out of main context.

JuliusBrussee/caveman-learn

Act on a Caveman learn report - review the ranked token sinks, apply cost-lowering fixes with per-edit consent, and report what those fixes returned. Use when asked to lower an agent's token cost, what caveman has saved, to trim a heavy CLAUDE.md, or to offload re-pasted context into cavemem.

JuliusBrussee/caveman-manage

Inspect Caveman Cloud's experiment lifecycle and block unsafe execution. Use when asked to start, approve, cancel, promote or roll back a Caveman experiment.

JuliusBrussee/caveman-optimize

Turn a Caveman optimization observation into an operator-chosen candidate with a paired baseline evaluation. Use when asked to inspect or evaluate a Caveman optimization report. Needs explicit approval.

JuliusBrussee/caveman-setup

Wire a repository through the Caveman Cloud gateway so every LLM request is measured, with no behavior change. Use for "set up caveman" or adding LLM spend observability.

JuliusBrussee/investigate-first

Diagnose ambiguous failures before editing. Use for unknown causes, intermittent behavior, performance regressions, or investigations needing evidence-ranked hypotheses.

JuliusBrussee/lean-build

Build feature work with high overbuilding risk. Use for new behavior, product slices, or integrations where repository reuse, strict scope, and an explicit stop condition matter.

JuliusBrussee/migration

Implement reversible compatibility-safe transitions. Use for schema, data, API, protocol, configuration, or dependency migrations requiring rollback and preservation proof.

JuliusBrussee/surgical-patch

Fix bugs and small behavior changes at the narrowest responsible layer. Use when regression proof, preserved surrounding behavior, and task-relevant tests matter.

JuliusBrussee/verify-and-stop

Prove existing work meets acceptance conditions without expanding scope. Use for validation-only tasks, completion checks, focused gate runs, and last-mile proof.

Verwandte Skills