xiaohongshu
xiaohongshu
health-checker
Monitor database health and detect issues across environments
Full skill instructions
This skill implements connection testing, migration verification, schema drift detection, and basic performance monitoring. </CONTEXT>
<CRITICAL_RULES>
{
"operation": "health-check",
"parameters": {
"environment": "production",
"checks": ["connectivity", "migrations", "schema"],
"working_directory": "/mnt/c/GitHub/myorg/myproject"
}
}
</INPUTS>
<WORKFLOW>High-level process:
</WORKFLOW>
<HANDLERS>This skill routes to migration tool handlers for tool-specific checks:
handler-db-prisma): Prisma-specific health checkshandler-db-typeorm): Futurehandler-db-sequelize): FutureHandler operations:
check-connection - Test database connectivitycheck-migrations - Verify migration table and statuscheck-schema-drift - Compare schema with databasecheck-performance - Basic performance metrics</HANDLERS>
<COMPLETION_CRITERIA> You are complete when:
If checks fail:
Output structured messages:
Start:
🎯 STARTING: Health Checker
Environment: production
Checks: connectivity, migrations, schema
───────────────────────────────────────
During execution, log key steps:
End (healthy):
✅ COMPLETED: Health Checker
Environment: production
Overall Status: HEALTHY
Connectivity: ✓ Healthy (25ms)
Migrations: ✓ Up to date (24 applied)
Schema: ✓ No drift detected
Performance: ✓ Normal (avg 15ms)
───────────────────────────────────────
End (degraded):
⚠️ COMPLETED: Health Checker
Environment: production
Overall Status: DEGRADED
Connectivity: ✓ Healthy (25ms)
Migrations: ✓ Up to date (24 applied)
Schema: ⚠️ Drift detected (1 manual change)
Performance: ✓ Normal (avg 15ms)
Issues Found:
⚠️ Manual column added: users.last_login_ip
Database has column not in Prisma schema
Recommendations:
1. Update Prisma schema or remove manual column
2. Run: npx prisma db pull (to sync schema)
3. Or create migration: /faber-db:generate-migration "sync schema"
───────────────────────────────────────
End (unhealthy):
✗ COMPLETED: Health Checker
Environment: production
Overall Status: UNHEALTHY
Connectivity: ✗ Failed (connection refused)
Migrations: ✗ Not checked (no connection)
Schema: ✗ Not checked (no connection)
Critical Issues:
✗ Cannot connect to database
Error: Connection refused at prod-db:5432
Recommendations:
1. Verify database is running
2. Check connection string: echo $PROD_DATABASE_URL
3. Test manually: psql $PROD_DATABASE_URL
4. Check firewall rules
5. Verify VPN/network access
───────────────────────────────────────
Return JSON:
Success (healthy):
{
"status": "success",
"operation": "health-check",
"environment": "production",
"result": {
"overall_status": "healthy",
"checks": {
"connectivity": {
"status": "healthy",
"latency_ms": 25,
"message": "Database connection successful"
},
"migrations": {
"status": "healthy",
"applied": 24,
"pending": 0,
"last_migration": "20250124130000_add_api_keys",
"message": "All migrations applied"
},
"schema": {
"status": "healthy",
"drift_detected": false,
"message": "Schema matches database"
},
"performance": {
"status": "healthy",
"avg_query_time_ms": 15,
"connection_pool_usage": "45%",
"message": "Performance normal"
}
},
"issues": [],
"recommendations": []
},
"message": "Database is healthy"
}
Warning (degraded):
{
"status": "success",
"operation": "health-check",
"environment": "production",
"result": {
"overall_status": "degraded",
"checks": {
"connectivity": {
"status": "healthy",
"latency_ms": 25
},
"migrations": {
"status": "healthy",
"applied": 24,
"pending": 0
},
"schema": {
"status": "degraded",
"drift_detected": true,
"drift_details": [
{
"type": "extra_column",
"table": "users",
"column": "last_login_ip",
"severity": "warning"
}
],
"message": "Schema drift detected"
}
},
"issues": [
{
"severity": "warning",
"check": "schema",
"message": "Manual column added: users.last_login_ip",
"details": "Database has column not in Prisma schema"
}
],
"recommendations": [
"Update Prisma schema or remove manual column",
"Run: npx prisma db pull (to sync schema)",
"Or create migration: /faber-db:generate-migration \"sync schema\""
]
},
"message": "Database is degraded - schema drift detected"
}
Error (unhealthy):
{
"status": "error",
"operation": "health-check",
"environment": "production",
"error": "Database health check failed",
"result": {
"overall_status": "unhealthy",
"checks": {
"connectivity": {
"status": "unhealthy",
"error": "Connection refused",
"message": "Cannot connect to database"
}
},
"issues": [
{
"severity": "critical",
"check": "connectivity",
"message": "Cannot connect to database",
"details": "Connection refused at prod-db:5432"
}
],
"recommendations": [
"Verify database is running",
"Check connection string: echo $PROD_DATABASE_URL",
"Test manually: psql $PROD_DATABASE_URL",
"Check firewall rules",
"Verify VPN/network access"
]
}
}
</OUTPUTS>
<ERROR_HANDLING>
Common health check failures:
Connection Failed:
{
"status": "error",
"error": "Database connection failed",
"result": {
"overall_status": "unhealthy",
"checks": {
"connectivity": {
"status": "unhealthy",
"error": "Connection timeout after 30s"
}
}
},
"recovery": {
"suggestions": [
"Check database is running",
"Verify connection string",
"Test network connectivity",
"Check firewall rules"
]
}
}
Schema Drift Detected:
{
"status": "success",
"result": {
"overall_status": "degraded",
"checks": {
"schema": {
"status": "degraded",
"drift_detected": true,
"drift_details": [...]
}
},
"issues": [
{
"severity": "warning",
"message": "Schema drift detected"
}
]
}
}
Migration Status Issues:
{
"status": "success",
"result": {
"overall_status": "degraded",
"checks": {
"migrations": {
"status": "degraded",
"applied": 24,
"pending": 2,
"message": "Pending migrations detected"
}
},
"issues": [
{
"severity": "warning",
"message": "2 pending migrations not applied"
}
],
"recommendations": [
"Apply pending migrations: /faber-db:migrate production"
]
}
}
</ERROR_HANDLING>
<DOCUMENTATION> Document health checks by: 1. Logging to fractary-logs plugin with check results 2. Recording check duration and status 3. Tracking issue history over time 4. Generating health trends (future) 5. Alerting on degraded/unhealthy status (future) </DOCUMENTATION> <INTEGRATION>Called before and after migration deployment:
Pre-Deployment Check:
{
"skill": "health-checker",
"operation": "health-check",
"parameters": {
"environment": "production",
"checks": ["connectivity", "migrations"]
}
}
Post-Deployment Check:
{
"skill": "health-checker",
"operation": "health-check",
"parameters": {
"environment": "production",
"checks": ["connectivity", "migrations", "schema"]
}
}
If pre-deployment check fails (unhealthy):
If post-deployment check fails (unhealthy):
Called before and after rollback:
Pre-Rollback Check:
Post-Rollback Check:
Prisma Implementation:
# Test connection with simple query
psql "$DATABASE_URL" -c "SELECT 1" --timeout=10
Prisma Implementation:
npx prisma migrate status
Prisma Implementation:
npx prisma migrate diff \
--from-schema-datamodel prisma/schema.prisma \
--to-schema-datasource prisma/schema.prisma
Implementation:
-- PostgreSQL
SELECT count(*) FROM pg_stat_activity;
SELECT avg(mean_exec_time) FROM pg_stat_statements;
overall_status = "healthy"
if any check has status == "unhealthy":
overall_status = "unhealthy"
elif any check has status == "degraded":
overall_status = "degraded"
if overall_status == "unhealthy":
block_operations = true
elif overall_status == "degraded":
warn_user = true
allow_operations = true
else:
allow_operations = true
Based on detected issues, generate actionable recommendations:
Connection Failed:
Pending Migrations:
Schema Drift:
Performance Degraded:
</INTEGRATION>
Health check settings in .fractary/plugins/faber-db/config.json:
{
"health_checks": {
"enabled": true,
"default_checks": ["connectivity", "migrations", "schema"],
"timeouts": {
"connectivity": 10,
"migrations": 30,
"schema": 60,
"performance": 30
},
"thresholds": {
"latency_warning_ms": 100,
"latency_critical_ms": 500,
"pending_migrations_warning": 5
},
"on_unhealthy": {
"block_deployment": true,
"trigger_rollback": false,
"notify_team": true
}
}
}
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience