db-guardian

Enforce backup-before-change and protected-collection rules for MongoDB operations.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production --skill db-guardian
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: db-guardian
Source: https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production/tree/main/.claude/skills/db-guardian
Command: npx skills add https://github.com/paulinett1508-dev/SuperCartolaManagerv5-production --skill db-guardian

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires mongoose, fs, path.

What problem does it solve?

The db-guardian skill prevents dangerous MongoDB actions by enforcing backup-before-change protocols, protecting critical collections, and guiding safe migrations, cleanup, and season turnover workflows for the Super Cartola Manager.

Core Features & Use Cases

  • Max safety guardrails for destructive operations: Enforces rules like backing up before any destructive write/delete/drop-like actions, blocks high-risk patterns, and identifies protected collections that must never be reset or deleted (e.g., users, system_config, audit_logs).
  • Controlled season turnover (snapshot, cleanup, prepare next season): Provides an operational blueprint to create filesystem snapshots of final standings and financial summaries, then perform selective cleanup of game data and prepare the next season configuration.
  • Data integrity and performance readiness: Covers health checks, integrity/consistency checks (orphan detection, duplicates), required index patterns, and profiling approaches to reduce slow queries and maintain query performance.

Quick Start

Ask the db-guardian skill to generate a safe MongoDB season turnover plan for the current season, including a verified backup/snapshot step, a dry-run/confirm flow, and a selective cleanup strategy that preserves protected collections.

Frequently Asked Questions about db-guardian

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I prevent accidental data loss during MongoDB migrations?

Preventing data loss during MongoDB migrations requires enforcing a backup-before-change protocol that mandates verified snapshots prior to any destructive write, update, or drop operations.

What is the safest way to handle season turnover cleanup in MongoDB?

Safe season turnover involves creating filesystem snapshots of final standings and financial summaries, then selectively cleaning up game data while preserving protected collections like users and system configuration.

How do I identify which MongoDB collections must never be deleted or reset?

To identify protected MongoDB collections, flag critical data structures like users, system_config, and audit_logs that must never be reset or deleted during any cleanup or migration workflow.

Can I use Mongoose for safe MongoDB index management and health checks?

Yes, using Mongoose for MongoDB index management supports applying required index patterns, running health checks, and profiling slow queries to maintain data integrity and optimize query performance.

What are the limitations of running destructive MongoDB operations without rollback planning?

Running destructive MongoDB operations without rollback planning risks permanent data corruption because it lacks mandatory backup thresholds, protected-collection enforcement, and deterministic script execution needed for safe recovery.