Diagnoses errors, bugs, performance issues, and failures in InsForge projects from frontend SDK errors to backend infrastructure via CLI commands for logs/status and AI-assisted suggestions.
npx claudepluginhub insforge/insforge-skillsThis skill uses the workspace's default tool permissions.
Diagnose problems in InsForge projects — from frontend SDK errors to backend infrastructure issues. This skill helps you **locate** problems by running the right commands and surfacing logs/status. The manual scenarios below locate problems without suggesting fixes; the [AI-assisted path](#ai-assisted-diagnosis-fastest-path) additionally returns suggested causes and solutions.
Manages InsForge backend infrastructure via CLI: creates DB tables/migrations, runs SQL/RLS, deploys serverless/edge functions/frontends, handles storage buckets/secrets/cron jobs/logs/diagnostics.
Sets up Supabase observability with dashboard reports, CLI inspect commands for Postgres diagnostics, pg_stat_statements, log drains, and alerting.
Guides Wrangler CLI for deploying, developing, and managing Cloudflare Workers, KV, R2, D1, Vectorize, Hyperdrive, Workers AI, and more. Ensures latest syntax and best practices via docs retrieval.
Share bugs, ideas, or general feedback.
Diagnose problems in InsForge projects — from frontend SDK errors to backend infrastructure issues. This skill helps you locate problems by running the right commands and surfacing logs/status. The manual scenarios below locate problems without suggesting fixes; the AI-assisted path additionally returns suggested causes and solutions.
Always use npx @insforge/cli — never install the CLI globally.
When the user gives a concrete description of the problem (error message, failing URL, HTTP status), hand it to the InsForge debug agent. It inspects backend state on its own and returns a diagnosis plus possible solutions.
npx @insforge/cli diagnose --ai "<issue description>"
When to use this path first:
Examples:
# Edge function error
npx @insforge/cli diagnose --ai "I invoked edge function https://kttprzh4.functions.insforge.app/newton, got error: 508: Loop Detected (LOOP_DETECTED)\n\nRecursive requests to the same deployment cannot be processed."
# Slow database query
npx @insforge/cli diagnose --ai "I query data with https://kttprzh4.us-west.insforge.app/api/database/records/order_customer_details?select=*&order=total_amount.desc, it costs 1.4s, why?"
# Unresponsive backend / 504
npx @insforge/cli diagnose --ai "my backend is unresponsive, request https://kttprzh4.us-west.insforge.app/api/database/records/todo?select=*&order=created_at.desc got 504 error, why?"
Unlike the other commands in this skill, diagnose --ai returns both a diagnosis and suggested solutions. Relay them to the user as a starting point, but verify against the underlying logs/metrics (the scenarios below) before committing to a fix.
Match the symptom to a scenario, then follow that scenario's steps.
| Symptom | Scenario |
|---|---|
SDK returns { data: null, error: {...} } | #1 SDK Error |
| HTTP 400 / 401 / 403 / 404 / 429 / 500 | #2 HTTP Status Code |
| Function throws or times out | #3 Edge Function Failure |
| Query slow or hangs | #4 Database Slow |
| Login fails / token expired / RLS denied | #5 Auth Failure |
| Channel won't connect / messages missing | #6 Realtime Issues |
| High CPU/memory, all responses slow | #7 Backend Performance |
functions deploy fails | #8 Function Deploy |
deployments deploy fails / Vercel error | #9 Frontend Deploy |
Symptoms: SDK call returns { data: null, error: { code, message, details } }. PostgREST error codes like PGRST301, PGRST204, etc.
Steps:
code, message, details from the SDK response.npx @insforge/cli diagnose logs
| Error pattern | Log source | Command |
|---|---|---|
PGRST* (PostgREST) | postgREST.logs | npx @insforge/cli logs postgREST.logs --limit 50 |
| Database/SQL errors | postgres.logs | npx @insforge/cli logs postgres.logs --limit 50 |
| Generic 500 / server error | insforge.logs | npx @insforge/cli logs insforge.logs --limit 50 |
npx @insforge/cli diagnose db --check connections,locks,slow-queries
Information gathered: Error code, backend log entries around the error timestamp, database health status.
Symptoms: API calls return 400, 401, 403, 404, 429, or 500.
Steps:
| Status | What to check | Command |
|---|---|---|
| 400 | Request payload/params malformed | npx @insforge/cli logs postgREST.logs --limit 50 |
| 401 | Auth token missing or expired | npx @insforge/cli logs insforge.logs --limit 50 |
| 403 | RLS policy or permission denied | npx @insforge/cli logs insforge.logs --limit 50 |
| 404 | Endpoint or resource doesn't exist | npx @insforge/cli metadata --json |
| 429 | Rate limit hit — no backend logs recorded | See 429 note below |
| 500 | Server-side error | npx @insforge/cli diagnose logs |
npx @insforge/cli diagnose logs
Retry-After or X-RateLimit-* headers. Checking logs will not help. Instead:
npx @insforge/cli diagnose metrics --range 1h
Information gathered: Status code context, relevant log entries, request/response details from logs. For 429: client-side request patterns and backend load metrics.
Symptoms: functions invoke returns error, function times out, or throws runtime exception.
Steps:
npx @insforge/cli logs function.logs --limit 50
npx @insforge/cli functions list
npx @insforge/cli functions code <slug>
Information gathered: Function runtime errors, function status, source code, EC2 resource metrics.
Symptoms: Queries take too long, hang indefinitely, or connection pool is exhausted.
Steps:
npx @insforge/cli diagnose db --check slow-queries,connections,locks
npx @insforge/cli logs postgres.logs --limit 50
npx @insforge/cli diagnose db --check index-usage,bloat,cache-hit,size
npx @insforge/cli diagnose metrics --range 1h
Information gathered: Slow query details, connection pool state, lock contention, index efficiency, table bloat, cache hit ratio, EC2 resource usage.
Symptoms: Login fails, signup errors, token expired, OAuth callback error, RLS policy denies access.
Steps:
npx @insforge/cli logs insforge.logs --limit 50
npx @insforge/cli logs postgREST.logs --limit 50
npx @insforge/cli metadata --json
npx @insforge/cli db policies
Information gathered: Auth error details, RLS violation logs, auth configuration state, active RLS policies.
Symptoms: WebSocket won't connect, channel subscription fails, messages not received or lost.
Steps:
npx @insforge/cli logs insforge.logs --limit 50
npx @insforge/cli db query "SELECT pattern, description, enabled FROM realtime.channels"
npx @insforge/cli db policies
npx @insforge/cli diagnose
Information gathered: WebSocket error logs, channel configuration, realtime RLS policies, overall backend health.
Symptoms: All responses slow, high latency, intermittent failures across the board.
Steps:
npx @insforge/cli diagnose metrics --range 1h
npx @insforge/cli diagnose db
npx @insforge/cli diagnose logs
npx @insforge/cli diagnose advisor --severity critical
Information gathered: CPU/memory/disk/network metrics (current and trend), database health, error log summary, advisor warnings.
Symptoms: functions deploy <slug> command fails, function not appearing in the list after deploy.
Steps:
npx @insforge/cli functions deploy <slug>
npx @insforge/cli logs function-deploy.logs --limit 50
npx @insforge/cli functions list
Information gathered: Deploy command error output, function deployment logs, function list status, backend error logs.
Symptoms: deployments deploy command fails, deployment status shows error, Vercel build errors.
Steps:
npx @insforge/cli deployments list
npx @insforge/cli deployments status <id> --json
The --json output includes a metadata object with Vercel-specific context: target, fileCount, projectId, startedAt, envVarKeys, webhookEventType (e.g., deployment.succeeded or deployment.error), etc. This metadata captures the full deployment context and can be used for debugging or AI-assisted investigation.
npm run build
Information gathered: Deployment history, deployment metadata (Vercel context, status, webhook events), local build output, backend deployment API logs.
npx @insforge/cli logs <source> [--limit <n>]
| Source | Description |
|---|---|
insforge.logs | Main backend logs |
postgREST.logs | PostgREST API layer logs |
postgres.logs | PostgreSQL database logs |
function.logs | Edge function execution logs |
function-deploy.logs | Edge function deployment logs |
Source names are case-insensitive.
# Full health report (all checks)
npx @insforge/cli diagnose
# AI-powered diagnosis from a natural-language problem description
# Returns diagnosis + suggested solutions
npx @insforge/cli diagnose --ai "<issue description>"
# EC2 instance metrics (CPU, memory, disk, network)
npx @insforge/cli diagnose metrics [--range 1h|6h|24h|7d] [--metrics <list>]
# Advisor scan results
npx @insforge/cli diagnose advisor [--severity critical|warning|info] [--category security|performance|health] [--limit <n>]
# Database health checks
npx @insforge/cli diagnose db [--check <checks>]
# checks: connections, slow-queries, bloat, size, index-usage, locks, cache-hit (default: all)
# Aggregate error logs from all sources
npx @insforge/cli diagnose logs [--source <name>] [--limit <n>]
# Project metadata (auth config, tables, buckets, functions, etc.)
npx @insforge/cli metadata --json
# Edge functions
npx @insforge/cli functions list
npx @insforge/cli functions code <slug>
# Secrets
npx @insforge/cli secrets list [--all]
npx @insforge/cli secrets get <key>
npx @insforge/cli secrets add <key> <value> [--reserved] [--expires <ISO date>]
# Database
npx @insforge/cli db policies
npx @insforge/cli db query "<sql>"
# Deployments
npx @insforge/cli deployments list
npx @insforge/cli deployments status <id> --json