prod-db-maintenance

Orchestrates production database imports and updates with cache-backed context and eval verification.

Updated Jun 17, 2026
Ready to run
npx skills add https://github.com/ndestates/ndestates-website --skill prod-db-maintenance-ndestates
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: prod-db-maintenance
Source: https://github.com/ndestates/ndestates-website/tree/main/.copilot/skills/prod-db-maintenance
Command: npx skills add https://github.com/ndestates/ndestates-website --skill prod-db-maintenance-ndestates

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Production database resets and updates are often ad-hoc, error-prone manual steps that risk dirty or inconsistent prod state. This Skill turns DB import/update into a spec-driven, verifiable infrastructure task with shared project context and a mandatory post-run evaluation gate. ## Core Features & Use Cases - Full clean import: Reset a dirty production database to the latest local backup (backup/latest-ndestates-io-db.sql.gz) via a wrapper script using doctl and mysql from the host machine. - Update workflows: Apply updates after local DDEV ingest of new open-data, or incremental updates via the daily listings job. - Eval-gated verification: After execution, invoke the maintenance-task eval skill to run row-count and freshness queries (live_listings, house_price tables, last_seen_at) and require a PASS status. - Use Case: Your production DB has drifted from expected state. Load the project cache, invoke this skill in full-import mode, run the generated one-liner with your .env credentials, then run the eval to confirm clean state before promoting code. ## Quick Start Ask the agent to run a full production database import from the latest local backup and then verify the result with the db-import maintenance eval.

Frequently Asked Questions about prod-db-maintenance

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

FAQPage Schema
How do I reset a production database from a local backup?▼

Run the wrapper script bash/import_prod_db_from_local_backup.sh from the host with .env credentials set, including DO_APP_ID and CONFIRM_OVERWRITE=YES. It discovers the cluster via doctl and imports backup/latest-ndestates-io-db.sql.gz, then verify with the db-import eval.

How do I verify a production database import succeeded?▼

Invoke the maintenance-task eval skill with the db-import task after the import. It runs SQL checks on table counts, MAX dates on house price tables, live_listings counts, and MAX(last_seen_at), returning PASS only if the state matches the expected clean baseline.

Can I run the production DB import from inside DDEV?▼

No, the import must run from the host machine because doctl and mysql need direct access to the production cluster. DDEV is only used for local preparation, such as ingesting new data and exporting a fresh dump.

What credentials are needed for DigitalOcean database import?▼

Credentials come from the .env file, including DO_APP_ID or DO_DB_CLUSTER_ID, TARGET_DB_* variables, and TARGET_SSL_CA. Never hardcode passwords or CA certificates in prompts or scripts.

When should I use full import versus incremental update?▼

Use full import when the production DB is dirty and needs a clean reset to the latest backup state. Use incremental updates via the daily listings job plus targeted updates when only freshness of listing data needs correction.