Logo von Refactor

Refactor

Organisation
greenfield-inc
refactor

Refactoring-Durchgang nach dem PR. Ermittelt den Umfang des Diffs im Vergleich zum Remote-Standardbranch und startet refactor-simple (bei umfangreichen Änderungen zusätzlich refactor-deep) als neue Subagents, die unabhängig voneinander arbeiten. Führt ihre Pläne einmalig nach den Regeln für den höchsten Schweregrad zusammen, zeigt den Gesamtbericht an und übergibt ihn auf Wunsch des Nutzers an refactor-apply. Verwenden Sie diesen Skill, sobald ein PR offen ist oder der Nutzer den Branch refactoren oder bereinigen lassen möchte.

Add to TypingMind

Übersicht

Herausgebergreenfield-inc
RepositoryPane
Skill-Namerefactor
Sterne
529
Forks
227
Mitgelieferte Dateien
1
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 1

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von greenfield-inc auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Refactor in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/greenfield-inc/Pane/tree/main/main/src/services/paneChatBundle/skills/refactor
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/greenfield-inc/Pane.git /tmp/Pane
mkdir -p .claude/skills
cp -r /tmp/Pane/main/src/services/paneChatBundle/skills/refactor .claude/skills/refactor
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Refactor in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Refactor automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Refactor nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

Refactor

One command for the post-PR quality pass. It sizes the change, runs the right analyses independently, merges once, stops for the user, then applies. It is a manual post-PR quality pass. It changes the head, so run it before QA when QA evidence must be current-head evidence.

Why the analyses run blind

Two analyses that see each other's findings converge into one opinion. Run independently, refactor-simple and refactor-deep overlap on about half their findings, the other half is complementary, and the severe correctness findings tend to come from one of them alone. So each analysis runs in a fresh subagent with no access to the other's output, and the merge happens exactly once, here, after both are done. Repeated runs on the same diff converge on the same findings, and averaging them has demoted real Criticals; one run per analysis is the rule.

Process

1. Size the change

Resolve the PR/current branch's relevant remote and that remote's default branch before running these commands. If either is ambiguous or unavailable, report the blocked comparison; do not guess a remote or silently review an empty diff. Record the resolved remote, base ref, and merge-base for helpers.

bash
# Resolve the relevant remote from the PR/current branch configuration first.
# Set REFACTOR_REMOTE to that verified name; do not assume origin.
git remote show "$REFACTOR_REMOTE"
# Resolve its actual default branch and set BASE to the verified remote ref.
# Fetch that branch explicitly if the ref is missing/stale, then verify it.
git rev-parse --verify "$BASE^{commit}"
git diff "$(git merge-base "$BASE" HEAD)" --numstat

Also enumerate non-ignored untracked files with git ls-files --others --exclude-standard -z. Treat these as added files: include their full contents and handwritten line counts in sizing and analysis, applying the same generated/vendor/lockfile exclusions. Pass this file inventory to every analyzer; plain git diff omits it. Do not stage files to inspect them.

Merge-base to working tree, so uncommitted work counts; the remote's real default branch, not an assumed main.

Exclude lockfiles, generated files, and vendored directories from the count. Under ~10 hand-written files and ~500 lines is small; above is large. --size overrides. State the size and the file count before fanning out.

2. Fan out, independently

Use one fresh subagent per refactoring assignment. refactor-simple, refactor-deep, and refactor-apply are skill modes, not separate agent types. The parent orchestrates dispatch; a leaf instance cannot spawn helpers and returns to the parent at those gates. Reuse one apply instance for authorized edits and fixes, while independent reviews get fresh instances.

Each analysis runs as a separate fresh-context subagent (the available native subagent API and configured roles, one per analysis, launched together when capacity permits). Each subagent invokes its skill and returns the absolute path of the plan it wrote. Pass the skill, worktree, and parent model/effort and no-archive requirements, without another reviewer’s findings.

  • small: refactor-simple only.
  • large: refactor-simple and refactor-deep, concurrently.

For a comprehensive review or a large change needing specialist coverage, use the specialist lenses. Selected scoped deep reviews replace the broad deep pass rather than duplicate it; retain the simple pass. Run applicable lenses in waves within capacity, not an unconditional all-at-once fanout. Pass an explicit read-only scope override and distinct output path to each instance. No reviewer publishes or edits code.

Each writes its own file under ./tmp/, and reads only its own.

3. Merge once

Read every plan and produce one merged report at ./tmp/refactor-merged-[timestamp].md. Rules, in priority order:

  1. Cluster findings that point at the same file/area and the same underlying issue, even if worded differently.
  2. Keep the maximum severity. A finding that is Critical in one plan and Warning in another is Critical. A reproduced defect keeps its reproduction.
  3. Sole-source findings are kept. Corroboration is not required; the independent runs are expected to disagree, and the disagreement is signal.
  4. Tag every item with its source ([S], [D], named specialist lenses, or their combination), so the reader can see who found what.
  5. Carry each plan's quality score as reported, plus the merged Critical/Warning/Info counts. The merged report has no combined score.
  6. Pre-existing-not-against-this-PR items stay in Info, unchanged.

Keep every item's file:line, fix, and auto-fixable flag from its source plan. The merged report is the same shape as the individual plans, so refactor-apply reads it unchanged.

4. Stop for the user

Run cold-read on the merged report first: a person reads it to decide what to change in their code. The cold-read may reorder, retitle, and clarify; severities, findings, and file:line stay as written. Then show it, Criticals in full, Warnings and Info summarised, with the auto-fixable and manual counts, and stop. This is the gate: nothing is applied until the user says so. --plan-only ends here.

Auto-fixable items are the safe class; still show them. Manual items always wait for the user's judgment on each.

5. Apply, then prove it

On the user's go, invoke refactor-apply on the merged report, auto-fixable first, then manual with the user. refactor-apply leaves its edits uncommitted; this step commits them as one scoped commit named for the plan and the round, so the adversary has an exact diff. Every repair is committed the same way before its review.

Then run the adversarial loop as one continuous chain, and report when it ends. Three review passes is the cap.

  1. Pass 1 reviews the apply commit. A fresh subagent reads that commit's diff alone (git diff <sha>~1..<sha>), briefed to prove it broke something: every claim in the apply report is a claim to falsify; a behaviour-preserving change must have preserved behaviour; a consolidation must keep every edge case a caller relied on. A test that claims to fix a defect runs on the parent (must fail) and the head (must pass); characterization tests for behaviour-preserving changes may pass on both. It returns CLEAN, or REGRESSION with file:line and a repro.
  2. On REGRESSION, the applier repairs, then two reviewers look. The repro goes back to the apply session, which knows the code; the repair is committed with the repro as a test proven failing on its parent. Then, in the same message: the reviewer who found the finding gets the repair as a follow-up in its own session, to re-run its repro and say whether that finding is closed; and a fresh subagent reads the repair commit's diff alone, briefed to break the repair itself, since a repair that changed code can break an adjacent case the first reviewer was primed to look past. The follow-up settles the finding; the fresh pass is the numbered pass and counts toward the cap.
  3. Pass 3 is the last. Reaching it means each repair fixed the reported inputs and broke the next; the repair before pass 3 is spec-driven: the applier writes the input class as a test table, or replaces the mechanism with a pure derivation, and stops rather than commits when the correct fix needs scope beyond the files at hand. Whatever pass 3 finds goes to the user with the plan.

A CLEAN pass advances. At the cap, advance anyway: the survivors are reported as open Criticals beside the delta, and the user decides. Then re-run the analyses (step 2, fresh subagents) once and show the delta: what closed, what remains, anything new.

On the first real run, two apply commits passed every check and their own new tests, and the adversary found a reproduced regression in each; the repairs then broke adjacent cases twice, with tests that passed trivially. The adversary told to falsify caught all of it.

Rules

  • Steps 1-4 modify no tracked files. Only step 5 edits code, and only after the user's explicit go.
  • Analyses run in fresh subagents, blind to each other; a plan stays out of every other analysis.
  • Merge means cluster and keep the maximum severity.
  • If a subagent fails or returns no plan, say so and merge what exists.
  • The adversarial loop runs in one chain. Waiting on a human between rounds turns ten minutes of agent work into hours; report at the end.
  • The reviewer who found a finding verifies its repair, in its own session; a fresh reviewer hunts what the repair introduced. Two questions, two readers.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Refactor?

Refactoring-Durchgang nach dem PR. Ermittelt den Umfang des Diffs im Vergleich zum Remote-Standardbranch und startet refactor-simple (bei umfangreichen Änderungen zusätzlich refactor-deep) als neue Subagents, die unabhängig voneinander arbeiten. Führt ihre Pläne einmalig nach den Regeln für den höchsten Schweregrad zusammen, zeigt den Gesamtbericht an und übergibt ihn auf Wunsch des Nutzers an refactor-apply. Verwenden Sie diesen Skill, sobald ein PR offen ist oder der Nutzer den Branch refactoren oder bereinigen lassen möchte.

Warum Refactor in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Refactor besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Refactor in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/greenfield-inc/Pane/tree/main/main/src/services/paneChatBundle/skills/refactor ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Refactor nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Refactor verwenden?

So viele Sie möchten. In TypingMind können Sie Refactor mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Refactor kostenlos?

Der Skill wird von greenfield-inc auf GitHub veröffentlicht. Prüfen Sie im Repository, ob dort Lizenzbedingungen angegeben sind. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇