Logo van Refactor Simple

Refactor Simple

Organisatie
greenfield-inc
refactor-simple

Alleen-lezenanalyse van de codekwaliteit van de branch ten opzichte van de externe standaardbranch voor kleine tot middelgrote wijzigingen. Classificeert de diff, leidt conventies af uit de doelrepository en schrijft een refactorplan naar ./tmp/. Wordt meestal uitgevoerd door de refactor-orchestrator; gebruik dit rechtstreeks voor een snelle controle vóór een PR bij wijzigingen in 2-10 bestanden.

Add to TypingMind

Overzicht

Uitgevergreenfield-inc
RepositoryPane
Skillnaamrefactor-simple
Sterren
529
Forks
227
Meegeleverde bestanden
Alleen instructies
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Compleet zonder extra bestanden

    Alles wat het model nodig heeft, staat in de instructies — geen extra bestanden om te synchroniseren.

  • Open source

    Gepubliceerd door greenfield-inc op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Refactor Simple in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/greenfield-inc/Pane/tree/main/main/src/services/paneChatBundle/skills/refactor-simple
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

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-simple .claude/skills/refactor-simple
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Refactor Simple in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Refactor Simple automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Refactor Simple niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

Simple Refactor

Read-only code quality analysis for small to medium changes.

Safe to run anytime. Analyzes the branch against the target repository's own conventions and writes a refactor plan without modifying files.

What This Does

Fast, focused code quality analysis that:

  1. Classifies your changes (size, type, complexity)
  2. Learns the conventions of the repository you are in
  3. Identifies code smells and convention violations in the lines you changed
  4. Generates a refactor plan with auto-fixable and manual issues
  5. Writes the plan to ./tmp/ for review

When to Use

  • Small changes (2-5 files, 50-200 lines)
  • Medium changes (5-10 files, 200-500 lines)
  • Bug fixes and enhancements
  • Quick pre-PR quality check

For large features (>10 files, >500 lines), use refactor-deep instead. Simple and deep are the whole set: simple is the cheap pass with the cleanest signal-to-noise, deep is the one that finds real defects in big diffs. Run both on a large PR when you want coverage; their findings overlap by about half and the rest is complementary.

Process

1. Classify Changes

Diff against the merge-base with the remote default branch, never a bare local main - a stale local main pulls unrelated commits into the review and every finding in them becomes a false positive.

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}"
MB=$(git merge-base "$BASE" HEAD)
git diff "$MB" --name-status
git diff "$MB" --numstat
git diff "$MB" --stat

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.

$BASE is the remote's real default branch (main, master, develop), never an assumed name. Diffing from the merge-base to the working tree - one revision, not two - includes committed, staged, and unstaged work, so a pre-PR run sees the edits that are not committed yet.

If the branch is behind $BASE, note it once as "rebase before merge"; it is not a finding and does not lower the score.

Determine:

  • Size: Tiny (<50) | Small (50-200) | Medium (200-500)
  • Type: Bug Fix | Enhancement | Refactor
  • Complexity: Trivial | Simple | Moderate
  • Layers: Backend | Frontend | Both

Size counts changed source lines. A lockfile, generated file, or vendored directory can add thousands of lines and no complexity - say so and classify on the hand-written change.

2. Learn the Repository's Conventions

Conventions come from the repository you are in, never from a rule remembered from another repo. In order:

  1. Read CLAUDE.md / AGENTS.md at the root and in every directory the diff touches. These state the conventions the maintainers actually enforce.
  2. Read two or three exemplar files that neighbour the changed code - files the maintainers clearly consider done - and note how they import, structure, handle errors, and document.
  3. Before flagging any convention violation, confirm the convention exists here. grep how many existing files already do the thing. If the codebase does it everywhere, it is the convention, not a violation.

An import style is a finding only when the target repository's guidance and existing code establish that convention. Explain the actual impact rather than assigning severity from a preference remembered from another project.

Pattern Matrix:

  • Tiny/Bug Fix → Universal smells only
  • Small/Enhancement → Universal + the repo's basic architecture rules
  • Medium → Universal + architecture + documentation for new files

Universal Smells (any repository):

  • Long functions (>100 lines), deep nesting (>3 levels)
  • Magic numbers/strings
  • Missing or swallowed error handling on new paths
  • Unused imports/variables, commented-out code, TODOs without context
  • Duplicate logic: two similar functions, hooks, or types where one with options would do
  • New public surface without a file-level or symbol-level comment when the neighbouring code has them

Repo-Derived Rules (Small+): import style, layering (where logic is allowed to live), state-management and hook patterns, error types, test conventions - whatever steps 1-3 above surfaced, cited to the file that states them.

3. Analyze Files

Read the changed files and the non-ignored untracked file inventory gathered above:

bash
git diff "$MB" --name-only

Pre-existing vs introduced: only issues in lines this branch adds or changes count against the PR. Pre-existing debt in touched files may be listed under Info as "pre-existing, not against this PR" and never lowers the score. Read enough surrounding code to tell the difference - a git blame on the line settles it.

4. Generate Report

Write the plan to ./tmp/simple-refactor-plan-[timestamp].md:

markdown
# Simple Refactor Plan

## Classification
- Size: [X] ([N] hand-written lines; [M] generated/lockfile lines excluded)
- Type: [X]
- Complexity: [X]
- Diff base: merge-base with $BASE at [sha], to working tree
- Conventions sourced from: [files read in step 2]

## Quality Score: X/10

## Issues Found

### Critical (Must Fix)
- [file:line] Description
  → Convention: [file that states it, or "universal"]
  → Fix: How to fix
  → Auto-fixable: Yes/No

### Warnings (Should Fix)
- [file:line] Description
  → Suggestion: Improvement
  → Auto-fixable: Yes/No

### Info (Nice to Have)
- [file:line] Suggestion
- [file:line] Pre-existing, not against this PR: description

## Auto-Fixable Issues: X
## Manual Fixes Required: Y

## Convention Compliance
✓/✗ [each repo-derived rule checked, with its source file]

## Recommendations
1. Hand this plan to `refactor-apply` (auto-fixable first)
2. Manually fix [specific issues]
3. Re-run `refactor-simple` to verify

## References
- Exemplar files studied: [paths]
- Convention sources: [paths]

An empty Critical section is a valid, common result. Do not manufacture findings to fill the template; "no PR-introduced defects" is the honest baseline for a clean change and should score accordingly.

5. Show Next Steps

📊 Analysis complete!
Plan written to: ./tmp/simple-refactor-plan-[timestamp].md
Quality Score: X/10
Auto-fixable: X issues · Manual fixes: Y issues
Issues found: [one line each for criticals and warnings]

Return the plan path to the caller. When run standalone, ask before running `refactor-apply`.

IMPORTANT: This skill never applies fixes. Standalone, ask the user before proceeding to refactor-apply; under refactor, the orchestrator owns that gate.

Command Arguments

  • --strict: Treat Medium as Large (stricter enforcement)
  • --classify-as=<type>: Override type classification
  • --size=<size>: Override size classification

Success Checklist

  • Diffed from the merge-base with the remote default branch to the working tree
  • Changes classified, generated lines excluded from size
  • Conventions read from THIS repo's guidance files and exemplars
  • Every convention finding confirmed by grep before it was written
  • Pre-existing debt separated from PR-introduced issues
  • Auto-fixable vs manual separated
  • Plan written to ./tmp/
  • No files modified (read-only)

This command is read-only and safe. It analyzes code against the conventions of the repository you are in and writes a refactor plan for you to review. Run refactor-apply after reviewing the plan to apply fixes.

Veelgestelde vragen

Wat doet de AI-skill Refactor Simple?

Alleen-lezenanalyse van de codekwaliteit van de branch ten opzichte van de externe standaardbranch voor kleine tot middelgrote wijzigingen. Classificeert de diff, leidt conventies af uit de doelrepository en schrijft een refactorplan naar ./tmp/. Wordt meestal uitgevoerd door de refactor-orchestrator; gebruik dit rechtstreeks voor een snelle controle vóór een PR bij wijzigingen in 2-10 bestanden.

Waarom Refactor Simple gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Refactor Simple bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Refactor Simple in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/greenfield-inc/Pane/tree/main/main/src/services/paneChatBundle/skills/refactor-simple. TypingMind leest het bestand SKILL.md en installeert het als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Refactor Simple gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Refactor Simple gebruiken?

Zoveel als je wilt. Je kunt Refactor Simple gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Refactor Simple gratis?

Deze skill is door greenfield-inc op GitHub gepubliceerd. Bekijk de repository voor de licentievoorwaarden. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇