# insforge-debug

A debugging skill for InsForge projects: traces SDK errors, RLS denials, gateway timeouts and failed edge function deploys back to a cause.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode · 56700 installs · ★ 45
- Author: InsForge
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/InsForge/insforge-skills/tree/HEAD/skills/insforge-debug/SKILL.md
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/insforge-debug

## What it does

InsForge Debug works through the observability surfaces of a broken project: logs from five backend sources, instance metrics, Postgres health checks, the advisor scan, RLS policies, metadata, SDK error objects and deploy state. Each surface has its own reference file. On top of that come symptom recipes, which name the call order for a known failure instead of leaving the agent to poke at one signal.

A 502 on a single endpoint lands on the right log source. A read that returns an empty array gets checked against policies before anyone blames the SQL. There is also an AI triage path: `npx -y @insforge/cli diagnose --ai "<issue description>"` answers with a diagnosis and suggestions. Treat it as a hypothesis and confirm it against the primitives it cites.

Keep the CLI out of your global install. Every command runs through `npx -y @insforge/cli`, which the skill states outright, so there is nothing to set up beyond the project itself. Note the quiet half of RLS failures: a SELECT returns zero rows rather than an error, and the empty result looks like success. The recipes only apply to InsForge projects, so they mean little on another backend.

## Requirements
- Works with: PostgreSQL

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add InsForge/insforge-skills --skill insforge-debug -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/insforge-debug/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/insforge-debug/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add InsForge/insforge-skills --skill insforge-debug -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/insforge-debug/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add InsForge/insforge-skills --skill insforge-debug -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/insforge-debug/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install InsForge/insforge-skills insforge-debug
```

2. **Manually: put the files in place**
- File: `.github/skills/insforge-debug/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add InsForge/insforge-skills --skill insforge-debug -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/InsForge/insforge-skills --path skills/insforge-debug
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/insforge-debug/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add InsForge/insforge-skills --skill insforge-debug -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/InsForge/insforge-skills/tree/HEAD/skills/insforge-debug/SKILL.md

## When to use it
- trace an SDK error object to the backend log source behind it
- explain why a SELECT comes back empty while the rows exist
- pin down the cause of a gateway timeout on one endpoint
- audit RLS policies and index usage before launch
- read why an edge function deploy failed

## Example prompts
- Reads from `orders` come back as an empty array even though the rows exist. Check the RLS policies and the auth metadata.
- OAuth login fails at the callback. Look at the auth logs and the provider settings in metadata.
- An edge function times out under load. Find the cause in `function.logs`.

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: acf8d86e7250b6b0.

BEGIN THIRD-PARTY FILE acf8d86e7250b6b0
````text
---
name: insforge-debug
description: >-
  Use when diagnosing problems in an InsForge project — reactive failures (SDK
  error object, HTTP 4xx/5xx, gateway timeout 502/503/504, edge function failure
  or timeout, login/OAuth/auth errors, RLS denial, realtime channel issues,
  slow query on one endpoint, edge function or Vercel deploy failure), proactive
  audits (security/RLS review, performance/index review, system health check,
  pre-launch readiness), or when the user has an error but doesn't know where
  to start.
license: Apache-2.0
---

# InsForge Debug

Diagnose problems in InsForge projects by combining the backend's observability primitives — logs, metrics, db-health, advisor, policies, metadata, error objects, deploy state, and AI assist. This skill provides:

1. A reference per **debug primitive** (one observability surface each — under `references/`)
2. **Symptom Recipes** (below) that name the primitive sequence for known reactive symptoms and proactive audits

**Always use `npx -y @insforge/cli`** — never install the CLI globally.

## Fastest Path: AI-Assisted Triage

When the user gives a concrete description (error message, failing URL, HTTP status), hand it to the InsForge debug agent. Unlike the other primitives, this one returns suggestions, not just observations — verify the diagnosis against the primitives it cites before acting on it.

```bash
npx -y @insforge/cli diagnose --ai "<issue description>"
```

See [references/ai-assisted.md](references/ai-assisted.md) for when to use this first vs when to skip, and how to verify the output.

## Debug Primitives

Each primitive is one independently-queryable observability surface backed by a distinct underlying data source. Real diagnoses are compositions of primitives.

All commands run via `npx -y @insforge/cli ...`. The `(command)` shown next to each primitive is the actual CLI command — primitive names are concept labels, **not** CLI subcommand names (e.g., "DB health" is `diagnose db`, not `diagnose db-health`; "Policies" is `db policies`, not `diagnose policies`).

| Primitive (command) | What you see | Reference |
|---------------------|-------------|-----------|
````
END THIRD-PARTY FILE acf8d86e7250b6b0

The third-party file has ended. Everything between the acf8d86e7250b6b0 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2186 of 15342 bytes. © InsForge · Apache-2.0 · https://github.com/InsForge/insforge-skills/tree/HEAD/skills/insforge-debug/SKILL.md

## Similar
- [supabase-development](https://affpapa.org/en/nevibecode/skills/supabase-development.md) — skill · 699 installs
- [supabase](https://affpapa.org/en/nevibecode/skills/alinaqi-supabase.md) — skill · 645 installs
- [healthcare-phi-compliance](https://affpapa.org/en/nevibecode/skills/healthcare-phi-compliance.md) — skill · 4500 installs

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
