Logo di Hatch3r Refactor

Hatch3r Refactor

Organizzazione
hatch3r
hatch3r-refactor

Internal code quality improvement workflow without changing external behavior. Use when refactoring code structure, simplifying modules, or improving maintainability.

Panoramica

Autorehatch3r
Repositoryhatch3r
Nome della skillhatch3r-refactor
Stelle
26
Fork
7
File inclusi
Solo istruzioni
LicenzaMIT
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • Tutto nelle istruzioni

    Tutto ciò che serve al modello è nelle istruzioni: nessun file aggiuntivo da sincronizzare.

  • Open source

    Pubblicata da hatch3r su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA Hatch3r Refactor in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/hatch3r/hatch3r/tree/main/skills/hatch3r-refactor
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Nuova skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella nella cartella delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/hatch3r/hatch3r.git /tmp/hatch3r
mkdir -p .claude/skills
cp -r /tmp/hatch3r/skills/hatch3r-refactor .claude/skills/hatch3r-refactor
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Hatch3r Refactor in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente Hatch3r Refactor non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi Hatch3r Refactor non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Note: Commands below use npm as an example. Substitute with your project's package manager (yarn, pnpm, bun) or build tool when your project uses a different package manager.

Code Refactor Workflow

Quick Start

Task Progress:
- [ ] Step 0: Detect ambiguity (P8 B1)
- [ ] Step 1: Read the issue, specs, and existing tests
- [ ] Step 2: Produce a refactor plan
- [ ] Step 3: Implement with behavioral preservation
- [ ] Step 4: Verify all tests pass, add regression tests
- [ ] Step 5: Open PR

Step 0 — Detect Ambiguity (P8 B1)

Before any work, scan the invocation for unresolved questions in scope, intent, acceptance criteria, target environment, or irreversibility. If any are found, ask the user via the platform-native question tool per agents/shared/user-question-protocol.md. Do not proceed under silent assumption. Default path, not an exception. Triggers for THIS skill: refactor scope (one module vs cross-cutting), behavioral invariants to preserve, public API surface (preserved vs changed), test rewrite policy (preserve vs replace), and acceptable performance delta.

Fan-out Discipline (P8 B2)

Fan-out scales with task size; token cost never justifies serializing independent work (rules/hatch3r-fan-out-discipline.md P8 B2; agents/shared/efficiency-patterns.md). Emit sub_agents_spawned: { count, rationale, task_structure } in your output.

Step 1: Read Inputs

  • Parse the issue body: motivation, proposed change, affected files, safety plan, risk analysis, acceptance criteria.
  • Read project quality standards documentation.
  • Read specs for the area being refactored.
  • Review all existing tests — every one must still pass after refactoring.
  • Review reference implementations: If the orchestrator provided similar-implementation researcher output, read the reference implementations and their extracted conventions. The refactored code should align with these established codebase patterns.
  • Review resolved requirements: If the orchestrator provided requirements-elicitation answers, use them to understand explicit user decisions on behavioral invariants and scope.
  • For external library docs and current best practices, follow the project's tooling hierarchy.

Step 2: Refactor Plan

Before changing code, output:

  • Goal: what improves (readability, performance, maintainability)
  • Strategy: how the refactor works
  • Convention alignment: which reference implementation's patterns the refactored code will follow (from similar-implementation output), with divergences noted. If no reference was provided, note "using existing codebase conventions."
  • Files to modify: list with what changes
  • Behavioral invariant: what must NOT change
  • Risk assessment: what could go wrong, how to detect
  • Rollback: how to revert if needed

Step 3: Implement

  • Refactor with minimum changes needed.
  • Preserve all public interfaces and external behavior.
  • Remove dead code created by the refactor.
  • Do not introduce new dependencies.
  • If a bug is found, document it -- fix in a separate PR.
  • Error handling preservation. When moving or restructuring error handling code, verify that the error behavior is preserved. A common refactoring mistake is accidentally changing error types, removing error context, or altering error propagation paths. Run error-path tests after each structural change.

Step 4: Verify

  • All existing tests must pass without modification.
  • Add regression tests for previously untested at-risk behavior.
  • Performance verification if refactored code is on a hot path.
bash
${HATCH3R:VERIFY_GATE_ALL}

Resolved to the project's language-aware gate at sync time (fallback when detection is unknown: npm run lint && npm run typecheck && npm run test).

Step 5: Open PR

Use the project's PR template. Include:

  • Motivation (why this refactor now)
  • Before/after structure (high-level description)
  • Proof of behavioral preservation (test results)
  • Performance impact (if applicable)

Required Agent Delegation

Note: When this skill is invoked via the orchestration pipeline (board-pickup or workflow commands), skip this section — the orchestrator handles agent delegation in Phases 3 and 4.

You MUST spawn these agents via the Task tool (subagent_type: "general-purpose") at the appropriate points:

  • hatch3r-researcher — MUST spawn before implementation with modes current-state, refactoring-strategy, migration-path. For Tier 2+ tasks (per hatch3r-deep-context), also include similar-implementation (refactors benefit most from convention alignment — ensures the refactored code follows established patterns) and requirements-elicitation. Skip only for trivially simple refactors (risk:low AND priority:p3).
  • hatch3r-reviewer — MUST spawn after implementation for code review, verifying behavioral preservation.

Related Skills

  • Skill: hatch3r-logical-refactor — use when the refactor changes internal logic flow while preserving external behavior
  • Skill: hatch3r-visual-refactor — use when the refactor targets UI/styling changes without altering functionality

Error Handling

  • Existing tests fail after refactor: Do not modify tests to make them pass unless the test was verifying an implementation detail (not behavior). If a behavioral test fails, the refactor changed external behavior and must be revised.
  • Refactor scope expands beyond the original module: If additional modules need changes due to coupling, stop and assess whether the refactor should be split into phases. Get confirmation before expanding scope.
  • Type errors after restructuring: Resolve all type errors before running tests. If the type system reveals unexpected dependencies, document them as findings for the codebase health record.

Definition of Done

  • All existing tests pass without modification
  • Regression tests added for at-risk behavior
  • No new linter warnings
  • Performance budgets maintained
  • Dead code removed
  • No external behavior changed
  • No new dependencies introduced

Domande frequenti

Cosa fa la skill IA Hatch3r Refactor?

Internal code quality improvement workflow without changing external behavior. Use when refactoring code structure, simplifying modules, or improving maintainability.

Perché usare Hatch3r Refactor su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Hatch3r Refactor è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo Hatch3r Refactor in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/hatch3r/hatch3r/tree/main/skills/hatch3r-refactor. TypingMind legge il file SKILL.md e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Hatch3r Refactor?

Qualsiasi modello che colleghi in TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con Hatch3r Refactor?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con Hatch3r Refactor: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA Hatch3r Refactor è gratuita?

Sì. È pubblicata su GitHub da hatch3r con licenza MIT. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, modelli o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Vedi tutti

Crea subito la tua area di lavoro IA

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇