skills/safety/database-backup/SKILL.md
Backup database before tests, migrations, or other database operations
npx skillsauth add liauw-media/codeassist database-backupInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Create a backup before running any operation that could modify or destroy database data.
Before running:
npm test, pytest, php artisan test)php artisan migrate, prisma migrate)php artisan db:seed)# Create backup
./scripts/backup-database.sh
# Run tests with automatic backup
./scripts/safe-test.sh npm test
# Run migrations with automatic backup
./scripts/safe-migrate.sh php artisan migrate
# Restore if needed
./scripts/restore-database.sh --latest
Real incidents that informed this practice:
migrate:fresh in wrong terminal reset staging databaseA backup takes seconds. Recovery without one can take hours or be impossible.
# Verify which database you're connected to
cat .env | grep DB_
If you see production credentials, stop and switch to a test database.
./scripts/backup-database.sh
Or use the safe wrappers which backup automatically:
./scripts/safe-test.sh [your test command]
./scripts/safe-migrate.sh [your migration command]
After backup is confirmed, proceed with your operation.
If something went wrong:
./scripts/restore-database.sh --latest
| Script | Purpose |
|--------|---------|
| backup-database.sh | Create timestamped backup |
| restore-database.sh | Restore from backup |
| safe-test.sh | Backup + run tests |
| safe-migrate.sh | Backup + run migrations |
See scripts/README.md for detailed usage.
Before database operations:
.env.testing for test database configurationdevelopment
Use when decomposing complex work. Dispatch fresh subagent per task, review between tasks. Flow: Load plan → Dispatch task → Review output → Apply feedback → Mark complete → Next task. No skipping reviews, no parallel dispatch.
development
# Server Documentation System Set up a documentation system that tracks changes and maintains server/project documentation with Claude Code hooks. ## When to Use - Setting up a new server or development environment - Need to track configuration changes over time - Want automatic documentation of work sessions - Maintaining changelog for infrastructure ## Directory Structure ``` ~/docs/ # User home directory (cross-platform) ├── changelog.md # Global over
development
Delegate tasks to remote Claude Code agent containers for parallel execution, long-running analysis, or resource-intensive operations.
development
Use when working on multiple features simultaneously. Creates isolated workspaces without branch switching, enabling parallel development.