agentleFS
GlamgarOnDiscordGlamgarOnDiscord/claude-saas-blueprint/.claude/skills/refactor/SKILL.md

refactor

Skill2 starsChanged 6 months agoMITView on GitHub

Refactoring sûr et méthodique. Améliorer sans casser.

195 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use debug-fix, ascii-diagram and 10 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • zebbernSkill

    debug-fix

    Find and fix a bug or issue — from any source (GitHub issue, error message, user report, or observed behavior)

    Also in 4 projects that use this

  • SethGammonSkill

    ascii-diagram

    Generate perfectly aligned ASCII diagrams — architecture, flow, sequence, box-and-arrow. Uses a programmatic character-grid approach so alignment is guaranteed by math, not token prediction. Includes post-render verification.

    Also in 4 projects that use this

  • parcadeiSkill

    agent-context-isolation

    Agent Context Isolation

    Also in 3 projects that use this

  • parcadeiSkill

    agentica-infrastructure

    Reference guide for Agentica multi-agent infrastructure APIs

    Also in 3 projects that use this

  • +8 more from parcadei

The file

Files
SKILL.md

Arguments

  • scope : Quoi refactorer (fichier, module, pattern)
  • goal : L'objectif du refactoring

Instructions

Phase 1 — Comprendre l'existant

  1. Lire le code à refactorer
  2. Lister TOUS les fichiers qui importent/utilisent le code concerné (Grep)
  3. Vérifier que les tests existent pour le code à refactorer
  4. Si pas de tests → en écrire AVANT de refactorer

Phase 2 — Planifier

Utiliser EnterPlanMode si blast radius > 3 fichiers.

Types de refactoring courants :

  • Extract : Sortir une fonction/composant d'un fichier trop long
  • Rename : Renommer pour clarifier (utiliser replace_all avec Grep)
  • Restructure : Déplacer des fichiers dans une meilleure organisation
  • Simplify : Réduire la complexité (dé-nester, éliminer les duplications)
  • Type-safe : Remplacer any par des types stricts
  • Pattern : Appliquer un design pattern (repository, factory, etc.)

Phase 3 — Exécuter

Règles strictes :

  1. Un changement à la fois — commit logique entre chaque transformation
  2. Tests verts entre chaque étape — si un test casse, rollback
  3. Pas de changement de comportement — le refactoring ne change que la forme
  4. Imports à jour — vérifier après chaque déplacement de fichier

Phase 4 — Valider

  1. tsc --noEmit — zero erreur
  2. Tous les tests passent
  3. Grep pour vérifier qu'aucun ancien import/nom n'est resté
  4. Review visuelle si UI impactée

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.