Loading...
Loading...
Use this skill for proactive backend health audits in an InsForge project — security misconfigurations, performance regressions, and system health issues surfaced by `diagnose advisor`, plus the backend-side deep-dives that pair with each advisor issue. Also use this skill when a user reports backend-wide performance degradation (high CPU/memory, all responses slow, connection pool exhaustion, lock contention) without a single failing request. Trigger on requests like "health check", "audit my backend", "review security", "check RLS policies", "find slow queries", "backend performance review", "high CPU/memory", "everything is slow", "EC2/database/system health", or pre-launch readiness audits. For reactive runtime errors with a single concrete failing request (SDK error objects, HTTP 4xx/5xx, function failures, deploy failures), use `insforge-debug` instead.
npx skill4agent add insforge/agent-skills insforge-backend-advisordiagnose advisornpx @insforge/cliinsforge-debug| You should be here when... | You should be in |
|---|---|
| Doing a periodic health check / pre-launch audit | A specific request just returned an error or unexpected status |
| Reviewing security posture (RLS, secrets, auth config) | A user can't log in / token expired / OAuth callback failing |
| Looking for slow queries, bloat, missing indexes proactively | A specific endpoint is slow right now and the user pasted the URL |
| Backend-wide degradation: high CPU/memory, all responses slow, connection pool exhausted, locks contending | A single request failed or timed out |
| "What's wrong with my backend?" without a concrete symptom | "Why did THIS request fail?" with a concrete symptom |
insforge-debugnpx @insforge/cli diagnose advisor--severity--category# Only critical issues (start here in any audit)
npx @insforge/cli diagnose advisor --severity critical
# Security category only
npx @insforge/cli diagnose advisor --category security
# JSON for full issue payload (ruleId, affectedObject, recommendation, isResolved)
npx @insforge/cli diagnose advisor --jsonruleIdseveritycategorytitledescriptionaffectedObjectrecommendationaffectedObjectNote:requires InsForge Platform login. It is not available on projects linked viadiagnose advisor.--api-key
category| Source | Maps to | Deep-dive section |
|---|---|---|
Advisor | RLS, exposed config, secrets | Security Audit |
Advisor | Slow queries, indexes, bloat | Performance Audit |
Advisor | Connections, locks, system metrics | System Health Audit |
| Symptom: "everything is slow", high CPU/memory, all responses slow | Backend-wide degradation | System Health Audit |
| Symptom: "this query is slow" (without a single failing URL) | Query-level performance | Performance Audit |
category=securitynpx @insforge/cli diagnose advisor --category securityaffectedObjectnpx @insforge/cli db policiesnpx @insforge/cli metadata --json--reserved--expiresnpx @insforge/cli secrets list --allruleIdaffectedObjectcategory=performancenpx @insforge/cli diagnose advisor --category performancenpx @insforge/cli diagnose db --check slow-queries,index-usage,bloat,cache-hit,sizeaffectedObjectnpx @insforge/cli db query "SELECT pg_size_pretty(pg_total_relation_size('<table>')) AS total_size, pg_size_pretty(pg_indexes_size('<table>')) AS indexes_size"npx @insforge/cli diagnose metrics --range 6hnpx @insforge/cli logs postgres.logs --limit 50category=healthnpx @insforge/cli diagnose advisor --category healthnpx @insforge/cli diagnose db --check connections,locksnpx @insforge/cli diagnose metrics --range 24hnpx @insforge/cli diagnose logsnpx @insforge/cli logs postgres.logs --limit 100isResolveddiagnose advisor --severity criticalinsforge-clinpx @insforge/cli ...diagnose advisorisResolved: truenpx @insforge/cli diagnose advisor [--severity critical|warning|info] [--category security|performance|health] [--limit <n>] [--json]--limit--jsonruleIdrecommendationisResolved# Database health checks
npx @insforge/cli diagnose db [--check connections,slow-queries,bloat,size,index-usage,locks,cache-hit]
# EC2 instance metrics
npx @insforge/cli diagnose metrics [--range 1h|6h|24h|7d] [--metrics <list>]
# Aggregate error logs from all sources
npx @insforge/cli diagnose logs [--source <name>] [--limit <n>]
# Postgres-level logs
npx @insforge/cli logs postgres.logs --limit 50# Project metadata (auth config, tables, buckets, functions, RLS policies)
npx @insforge/cli metadata --json
# Live RLS policies
npx @insforge/cli db policies
# Ad-hoc SQL against the project
npx @insforge/cli db query "<sql>"
# Secrets inventory
npx @insforge/cli secrets list --allinsforge-debug