Repository Maintenance Skill
This skill provides procedures for maintaining database integrity, executing database backups, applying schema migrations, and managing dependencies across the GitHub Backup Automation System.
1. Branch-First Development
[!IMPORTANT] CREATE A LOCAL BRANCH FIRST: Always start by creating a local branch from
main:git switch -c MishraShardendu22/main/<feature-name>Never apply maintenance or schema changes directly on
main.
2. Database Schema Integrity & Migrations
[!CAUTION] CRITICAL RULE: Never execute destructive SQL statements (
DROP TABLE,TRUNCATE). Production data has historical backup logs spanning months.
Migration Rules
- All migrations MUST be located in
backend/db/migrations/using versioned namingNNNNNN_<name>.up.sqlandNNNNNN_<name>.down.sql. - All SQL statements MUST be idempotent:
CREATE TABLE IF NOT EXISTS ...CREATE INDEX IF NOT EXISTS ...ALTER TABLE ... ADD COLUMN IF NOT EXISTS ...
- Schema migrations are orchestrated exclusively by Go backend startup (
backend/db/migrator.go).
2. Backup & Disaster Recovery Runbook
PostgreSQL database dumps are automated with SHA-256 integrity verification:
# 1. Execute an automated database backup (stored in backups/postgres/ with 14-day retention)
make backup-db
# 2. Restore database from a backup file
make restore-db BACKUP_FILE=backups/postgres/gbm_pg_backup_YYYYMMDD_HHMMSS.sql.gz
3. Dependency Management
- Go Dependencies: Managed via
go.mod. Update withgo get -uand clean withgo mod tidy. - Python Observatory: Managed via
uvinagentic-observatory/. Update withuv lock --upgradeand sync withuv sync. - Frontend Dashboard: Managed via
pnpminfrontend/. Update withpnpm update. Ensure native modules likesharpand@biomejs/biomeremain authorized infrontend/pnpm-workspace.yaml.