Logo di Git Cleanup

Git Cleanup

Organizzazione
SpecterOps
git-cleanup

Repository hygiene — prune merged/stale branches, detect orphans, repo health checks. Use when cleaning up branches, checking repo health, or scanning projects.

Panoramica

AutoreSpecterOps
Repositoryskills
Nome della skillgit-cleanup
Stelle
706
Fork
80
File inclusi
3
LicenzaApache-2.0
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.

  • 3 file inclusi

    Script, modelli di documento e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

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

Installazione

Installa la skill IA Git Cleanup 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/SpecterOps/skills/tree/main/plugins/workflows-development/skills/git-cleanup
  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/SpecterOps/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/plugins/workflows-development/skills/git-cleanup .claude/skills/git-cleanup
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva Git Cleanup 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 Git Cleanup 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 Git Cleanup 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à.

Git Repository Cleanup

Repository hygiene: prune branches, detect stale work, and check repo health.

Parse the user's input to determine the action:

  • $git-cleanup or $git-cleanup branches — find and prune merged/stale branches
  • $git-cleanup stale [days] — branches with no commits in N days (default 30)
  • $git-cleanup health — large files, dangling refs, worktrees, repo size
  • $git-cleanup all — scan all git repos under ~/Projects/

Prerequisites

  1. Verify we're in a git repository (git rev-parse --is-inside-work-tree) — except for all action which scans directories
  2. If not in a git repo (and not using all), tell the user and stop

Protected Branches

The following branches are NEVER suggested for deletion: main, master, develop

Action: branches (default)

  1. Fetch latest remote state: git fetch --prune
  2. Identify the default branch (git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null or fall back to main/master)
  3. Find merged branches:
    • git branch --merged <default> — local branches already merged into default
    • Exclude protected branches and current branch
  4. Find branches with deleted remotes:
    • git branch -vv — look for [origin/...: gone] entries
  5. Present findings as a dry-run preview:
    • List branches that can be safely deleted (merged)
    • List branches whose remote is gone
    • Show last commit date and message for each
  6. Ask the user which branches to delete (or "all listed")
  7. On confirmation, delete with git branch -d <branch> (safe delete)
  8. If a branch fails -d (unmerged), warn the user and offer -D with explicit explanation that commits may be lost — only proceed with user confirmation

Action: stale [days]

  1. Default to 30 days if no argument provided
  2. For each local branch (excluding protected branches):
    • Get last commit date: git log -1 --format='%ci' <branch>
    • Calculate age in days
  3. List branches older than the threshold, sorted by age (oldest first)
  4. Show for each: branch name, last commit date, last commit message, age in days
  5. Present as dry-run preview — ask before deleting
  6. On confirmation, use git branch -d first; offer -D only with warning if unmerged

Action: health

Run a comprehensive repository health check:

  1. Repository size:

    • .git directory size: du -sh .git
    • Working tree size: du -sh . --exclude=.git (or equivalent)
    • Object count: git count-objects -vH
  2. Large files (top 10 by size in history):

    • git rev-list --objects --all | git cat-file --batch-check='%(objecttype) %(objectname) %(objectsize) %(rest)' | awk '/^blob/ {print $3, $4}' | sort -rn | head -10
    • Flag files over 10MB
  3. Dangling objects:

    • git fsck --no-reflogs 2>&1 — look for dangling commits, blobs, trees
    • Report count and suggest git gc if significant
  4. Worktrees:

    • git worktree list — show active worktrees
  5. Remote status:

    • git remote -v — list remotes
    • Check if local is ahead/behind remote
  6. Stale tracking branches:

    • git remote prune origin --dry-run — branches that would be pruned
  7. Present findings with recommendations

  8. If cleanup is recommended (gc, prune), show the commands but always ask before running them

Action: all

  1. Find all git repositories under ~/Projects/:
    • find ~/Projects -maxdepth 3 -name .git -type d
  2. For each repository found: a. Show repo name and path b. Run the branches check (merged + gone remotes) c. Show summary: N merged branches, M gone-remote branches
  3. Per-repo confirmation — ask before deleting branches in each repo
  4. Show overall summary at the end

Safety Rules

  1. Never delete without confirmation — always preview first
  2. Never delete protected branches (main, master, develop)
  3. Never git push origin --delete on protected branches
  4. Never run git gc without asking
  5. Always preview first — every action starts as a dry run
  6. Per-repo confirmation for all — don't batch-delete across repos
  7. Use git branch -d (safe delete) first; only offer -D with explicit warning

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA Git Cleanup?

Repository hygiene — prune merged/stale branches, detect orphans, repo health checks. Use when cleaning up branches, checking repo health, or scanning projects.

Perché usare Git Cleanup su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. Git Cleanup è 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 Git Cleanup in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/SpecterOps/skills/tree/main/plugins/workflows-development/skills/git-cleanup. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare Git Cleanup?

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 Git Cleanup?

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

La skill IA Git Cleanup è gratuita?

Sì. È pubblicata su GitHub da SpecterOps con licenza Apache-2.0. 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 👇