Yeet
Streamline Yeet operations through automated task execution and seamless integration with existing tools
Yeet is a community skill for quickly discarding, removing, or cleaning up files, branches, and artifacts in development workflows, providing automated cleanup patterns that keep repositories and environments tidy without manual intervention.
What Is This?
Overview
Yeet provides patterns for automated cleanup operations in software development workflows. It covers temporary file removal, stale branch deletion, build artifact cleanup, cache invalidation, and environment reset operations. The skill automates the maintenance tasks that developers perform manually to keep their repositories, CI environments, and local machines free of accumulated clutter that slows builds and obscures active work.
Who Should Use This
This skill serves developers who need to clean up branches and artifacts after feature completion, DevOps engineers maintaining CI environments with limited disk space, and teams whose build times increase due to accumulated caches and stale dependencies.
Why Use It?
Problems It Solves
Stale branches accumulate in repositories making it difficult to find active work. Build artifact directories grow large enough to affect disk space and clone times. Cached dependencies become stale and cause subtle build failures when underlying packages change. Temporary files from failed test runs and interrupted builds litter the working directory. Manual cleanup is tedious and often postponed until problems become noticeable.
Core Highlights
Branch cleanup identifies and removes merged branches that are no longer needed. Artifact removal clears build output directories, coverage reports, and temporary files matching configurable patterns. Cache invalidation resets dependency caches when lock files change to ensure fresh installations. Safety checks prevent accidental deletion of active branches, uncommitted work, and protected files.
How to Use It?
Basic Usage
import subprocess
import shutil
from pathlib import Path
from dataclasses import dataclass, field
@dataclass
class CleanupConfig:
patterns: list[str] = field(default_factory=lambda: [
"**/__pycache__", "**/.pytest_cache", "**/node_modules",
"**/*.pyc", "**/dist", "**/build", "**/.coverage"
])
protected: list[str] = field(default_factory=lambda: [
".git", ".env", "node_modules/.cache"
])
class ProjectCleaner:
def __init__(self, root: str, config: CleanupConfig = None):
self.root = Path(root)
self.config = config or CleanupConfig()
def clean_artifacts(self) -> list[str]:
removed = []
for pattern in self.config.patterns:
for match in self.root.glob(pattern):
if not self._is_protected(match):
if match.is_dir():
shutil.rmtree(match)
else:
match.unlink()
removed.append(str(match))
return removed
def _is_protected(self, path: Path) -> bool:
return any(p in str(path) for p in self.config.protected)Real-World Examples
class BranchCleaner:
def __init__(self, protected: list[str] = None):
self.protected = protected or ["main", "master", "develop"]
def list_merged(self) -> list[str]:
result = subprocess.run(
["git", "branch", "--merged", "main"],
capture_output=True, text=True
)
branches = [b.strip() for b in result.stdout.split("\n") if b.strip()]
return [b for b in branches
if b not in self.protected and not b.startswith("*")]
def clean_merged(self, dry_run: bool = True) -> list[str]:
merged = self.list_merged()
if dry_run:
return merged
for branch in merged:
subprocess.run(["git", "branch", "-d", branch])
return merged
cleaner = BranchCleaner(protected=["main", "develop", "staging"])
stale = cleaner.clean_merged(dry_run=True)
print(f"Would remove {len(stale)} merged branches")Advanced Tips
Always run cleanup in dry-run mode first to review what will be removed before executing destructive operations. Schedule automated cleanup jobs in CI that run on a timer rather than relying on developers to remember. Keep a log of deleted items with timestamps to support recovery if something important is accidentally removed.
When to Use It?
Use Cases
Clean up merged branches after sprint completion to keep the repository branch list manageable. Remove build artifacts and caches before fresh CI runs to avoid stale dependency issues. Reset development environments to a clean state when switching between projects or reproducing bugs.
Related Topics
Git branch management, CI environment maintenance, disk space monitoring, build cache strategies, and development environment automation.
Important Notes
Requirements
Git installed for branch cleanup operations. File system access with appropriate permissions for deleting build artifacts. A protected list of branches and paths that should never be removed automatically.
Usage Recommendations
Do: implement dry-run modes for all destructive cleanup operations. Protect important branches and directories with explicit allowlists. Run cleanup operations on a schedule rather than waiting for disk space problems.
Don't: delete branches without checking if they have been fully merged. Remove node_modules or dependency directories during active development without reinstalling. Skip confirmation prompts for operations that cannot be easily reversed.
Limitations
Automated cleanup cannot determine if unmerged branches contain important work in progress. Pattern-based file deletion may accidentally match files that should be preserved. Branch cleanup only works for local branches unless remote cleanup is explicitly configured with appropriate permissions.
More Skills You Might Like
Explore similar skills to enhance your workflow
Latex Posters
Automate and integrate LaTeX poster creation and formatting into your workflows
Competitive Landscape Analysis
Comprehensive frameworks for analyzing competition, identifying differentiation opportunities, and developing winning market positioning strategies
Ray Data
Scalable Ray Data automation and integration for distributed data processing pipelines
Crowdin Automation
Automate Crowdin operations through Composio's Crowdin toolkit via Rube
Invoice Organizer
Automatically organizes invoices and receipts for tax preparation by reading messy files, extracting key information, renaming them consistently, and
Endorsal Automation
Automate Endorsal operations through Composio's Endorsal toolkit via