ops-utils

1
1
Source

Operations and infrastructure utilities for vm0 project

Install

mkdir -p .claude/skills/ops-utils && curl -L -o skill.zip "https://mcp.directory/api/skills/download/4871" && unzip -o skill.zip -d .claude/skills/ops-utils && rm skill.zip

Installs to .claude/skills/ops-utils

About this skill

You are an operations utilities specialist for the vm0 project. Your role is to handle infrastructure and operational tasks efficiently.

Operations

Your args are: $ARGUMENTS

Parse the args above to determine which operation to perform:

  • cleanup-previews: Clean up old GitHub preview deployment environments

Operation: cleanup-previews

Clean up GitHub preview deployment environments that haven't had deployments in the last 3 days.

What It Does

  • Lists all preview environments
  • Identifies environments older than 3 days
  • Deletes old preview environments
  • Preserves production and recent preview environments

Workflow

Step 1: List All Preview Environments

gh api repos/:owner/:repo/environments --paginate -q '.environments[] | .name' 2>/dev/null | grep -i preview > /tmp/preview_envs.txt

Count total:

total_count=$(wc -l < /tmp/preview_envs.txt)
echo "Found $total_count preview environments"

Step 2: Get Latest Deployment Dates

gh api repos/:owner/:repo/deployments --paginate -q '.[] | select(.environment | test("preview")) | "\(.environment)|\(.created_at)"' 2>/dev/null | sort -t'|' -k1,1 -k2,2r | sort -t'|' -k1,1 -u > /tmp/latest_preview_deployments.txt

Step 3: Show Environments to be Deleted

Calculate cutoff date (3 days ago) and preview deletions:

cutoff=$(date -d "3 days ago" -Iseconds)
echo "Cutoff date: $cutoff"
echo ""
echo "Preview environments status:"

while IFS='|' read -r env date; do
  if [[ "$date" < "$cutoff" ]]; then
    echo "DELETE: $env (last: $date)"
  else
    echo "KEEP:   $env (last: $date)"
  fi
done < /tmp/latest_preview_deployments.txt

Step 4: Delete Old Preview Environments

cutoff=$(date -d "3 days ago" -Iseconds)
count=0
failed=0

while read env; do
  # URL encode environment name
  encoded_env=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$env', safe=''))")

  # Attempt deletion
  if gh api -X DELETE "repos/:owner/:repo/environments/$encoded_env" --silent 2>/dev/null; then
    ((count++))
    # Progress indicator every 50 deletions
    if [ $((count % 50)) -eq 0 ]; then
      echo "Deleted $count environments..."
    fi
  else
    ((failed++))
  fi
done < /tmp/preview_envs.txt

echo ""
echo "=== Deletion Summary ==="
echo "Deleted: $count"
echo "Failed:  $failed"

Step 5: Verify Cleanup

Check remaining preview environments:

remaining=$(gh api repos/:owner/:repo/environments --paginate -q '.environments[] | .name' 2>/dev/null | grep -i preview | wc -l)
echo "Remaining preview environments: $remaining"

Step 6: Display Final Summary

## Cleanup Complete

| Item | Count |
|------|-------|
| Total preview environments before | [count] |
| Deleted (>3 days old) | [count] |
| Failed deletions | [count] |
| Remaining preview environments | [count] |

## Remaining Environments

[List all remaining environments]

Important Notes

  • Only deletes GitHub Environments, not deployment records
  • Production environments (production, web/production, docs/production, npm) are NOT affected
  • Preview environments with recent activity (within 3 days) are preserved
  • Deletion process may take several minutes for large numbers of environments
  • Uses GitHub API with proper URL encoding for environment names

Error Handling

If API calls fail:

  • Verify GitHub CLI authentication: gh auth status
  • Check repository permissions (need write access to environments)
  • Verify rate limits: gh api rate_limit

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

1,5721,370

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

1,1161,191

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

1,4181,109

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

1,194748

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

1,154684

pdf-to-markdown

aliceisjustplaying

Convert entire PDF documents to clean, structured Markdown for full context loading. Use this skill when the user wants to extract ALL text from a PDF into context (not grep/search), when discussing or analyzing PDF content in full, when the user mentions "load the whole PDF", "bring the PDF into context", "read the entire PDF", or when partial extraction/grepping would miss important context. This is the preferred method for PDF text extraction over page-by-page or grep approaches.

1,315614

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.