signaltree-realtime

signaltree-realtime is a skill for Claude Code, Codex from JBorgia/signaltree. It costs 107 tokens per session (1,241 once invoked), scanned A, original, Apache-2.0.

A bridge that copies live database change events into SignalTree entity collections. It supports Supabase Realtime, WebSockets, and other adapters for changes such as records being added, updated, or deleted.

In plain words
What is it for?
Use it to keep Angular lists and other entity-based state synchronized with database changes, monitor connection status, reconnect, and transform incoming records before storing them.
Why use it?
It removes the repeated work of subscribing to changes, updating local collections, and handling reconnects when the live connection drops.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/jborgia/signaltree/realtime
Any agent
npx skills add JBorgia/signaltree --skill realtime
Clone the repo
git clone --depth 1 https://github.com/JBorgia/signaltree

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for signaltree-realtime

README.md
[![agentmods](https://agentmods.dev/badge/skills/jborgia/signaltree/realtime.svg)](https://agentmods.dev/skills/jborgia/signaltree/realtime)
Your own site
<a href="https://agentmods.dev/skills/jborgia/signaltree/realtime"><img src="https://agentmods.dev/badge/skills/jborgia/signaltree/realtime.svg" alt="Measured on agentmods" height="20"></a>
Per session 107 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,241 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00107 $0.01241
Opus 5 $0.00053 $0.00620
Sonnet 5 $0.00021 $0.00248
Haiku 4.5 $0.00011 $0.00124

Measured 6d ago against content hash 5ccbd8f8c208, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-06, from the pricing page.

Security

Grade A, and why

signaltree-realtime scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 6d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/skills/using-signaltree/realtime/SKILL.md · 138 lines

How it starts

The opening of the file, as written. The whole thing — 138 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Using @signaltree/realtime

Use when an Angular app holds entity collections in entityMap slices and the source of truth emits DB change events (Supabase Realtime, Firebase, custom WebSocket). Eliminates manual subscribe → map → upsertOne/removeOne → reconnect dance. For request/response CRUD or static data, skip it.

Don't apply in SSR — guard with isPlatformBrowser() or initialize in a client-only provider.

Install:

npm install @signaltree/core @signaltree/realtime
# Supabase adapter:
npm install @supabase/supabase-js

Peer: @angular/core ^20, @signaltree/core ^9. @supabase/supabase-js ^2 optional — install only for Supabase adapter.

Supabase:

import { signalTree, entityMap } from '@signaltree/core';
import { supabaseRealtime } from '@signaltree/realtime/supabase';
import { createClient } from '@supabase/supabase-js';

interface Listing {
  id: number;
  title: string;
  status: string;
}
interface Message {
  id: string;
  text: string;
}

const supabase = createClient(import.meta.env['VITE_SUPABASE_URL'], import.meta.env['VITE_SUPABASE_ANON_KEY']);

const tree = signalTree({
  listings: entityMap<Listing, number>(),
  messages: entityMap<Message, string>(),
}).with(
  supabaseRealtime(supabase, {
    listings: { table: 'listings', event: '*', filter: 'status=eq.active' },
    messages: { table: 'messages', event: 'INSERT' },
  })
);

Entity mutation rules: INSERT/UPDATEupsertOne(entity, { selectId }). DELETEremoveOne(selectId(old)). selectId defaults to (entity) => entity.id; override in subscription config for non-id PKs.

event values: 'INSERT' | 'UPDATE' | 'DELETE' | '*'. '*' = all three.

Connection state — tree.realtime.connection.status is a signal of 'DISCONNECTED' | 'CONNECTING' | 'CONNECTED' | 'RECONNECTING' | 'ERROR':

effect(() => {
  const status = tree.realtime.connection.status();
  if (status === 'ERROR') console.warn('Realtime error:', tree.realtime.connection.error());
});

const isLive = tree.realtime.connection.isConnected; // signal<boolean>

Transform rows (e.g., snake_case → camelCase):

supabaseRealtime(supabase, {
  listings: {
    table: 'listings',
    event: '*',
    transform: (row): Listing => ({ id: row['id'] as number, title: row['title'] as string /* ...more fields */ }),
  },
});

Custom adapter (non-Supabase):

import { signalTree, entityMap } from '@signaltree/core';
import { realtime } from '@signaltree/realtime';

interface Todo {
  id: string;
  title: string;
}
type RealtimeAdapter = Parameters<typeof realtime>[0];

const myAdapter: RealtimeAdapter = {
  async connect() {
    /* open socket */
  },
  disconnect() {
    /* close socket */
  },
  subscribe(_config, _callback) {
    return () => {
      /* cleanup */
    };
  },
  isConnected() {
    return true;
  },
  onConnectionChange(_cb) {
    return () => {
      /* cleanup */
    };
  },
};

const tree = signalTree({ todos: entityMap<Todo, string>() }).with(realtime(myAdapter, { todos: { table: 'todos', event: '*' } }));

Dynamic subscriptions (add after initial connect):

const cleanup = tree.realtime.subscribe('newPath', config);
tree.realtime.unsubscribe('newPath');
cleanup(); // or via returned CleanupFn

tree.realtime.reconnect() — force disconnect → fresh connect, resets reconnectAttempts to 0. Use after long background wake-up.

Reconnect options (on realtime): autoReconnect (default true), reconnectDelay (default 1000ms, exponential backoff), maxReconnectAttempts (default 10).

Gotchas:

  • Only entityMap slices auto-sync. Plain signals or object paths log a dev warning and are ignored.
  • Subscriptions keyed by tree path, not table. Same table → two paths = two independent channels. Two subscriptions at same tree path: second overwrites first.
  • Supabase filter is passed verbatim to Supabase Realtime — not a JS filter. Use transform for JS-level cross-row filtering.
  • Supabase adapter fires connection callback only after first SUBSCRIBED status. Brief CONNECTING window before data is normal.
  • reconnectAttempts() climbing indefinitely = server rejecting connection (check Postgres publication or RLS).
  • entityMap must exist at configured path at enhancer-apply time. Dynamic paths: use tree.realtime.subscribe(path, config) once the slice exists.

Read the full file on GitHub · 138 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 6d ago First seen · 138 lines · 107 tokens per session scan A 5ccbd8f8c208

Subscribe to this mod's changes

signaltree-realtime is a skill published in the GitHub repository JBorgia/signaltree (22 stars, last pushed today), licensed Apache-2.0. It adds 107 tokens to every session and 1,241 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

event-store-design

Design and implement event stores for event-sourced systems. Use when building event sourcing infrastructure, choosing event store technologies, or implementing event persistence patterns.

wshobson/agents · 33 tokens

convex-explain-app

Explain an existing Convex app — data model + relationships, public vs internal functions, auth/ownership model, components, a request→data flow — read from the schema and function surface. Read-only.

openclaw/clawhub · 47 tokens

platform-custom-field-generate

Use this skill when users need to create, generate, or validate Salesforce Custom Field metadata. Trigger when users mention custom fields, field types, Roll-up Summary fields, Master-Detail relationships, Lookup relationships, formula fields, picklists, dependent (controlling) picklists, referencing a value set from…

forcedotcom/sf-skills · 194 tokens

openloomi-api

OpenLoomi ships a local-first HTTP API served from the desktop app (port 3414, fallback 3515). All auth, Memory, AI, RAG, Loop, and Audit data live in a local SQLite database — your data stays on your machine and the OpenLoomi app is the source of truth. The only externally-routed auth path is the Composio OAuth…

melandlabs/openloomi · 106 tokens

nornicdb-grpc

Drive NornicDB over gRPC — the Qdrant-compatible surface (Collections, Points, Snapshots) plus the additive NornicSearch service. Use when ingesting via Qdrant SDKs, migrating from Qdrant, or running hybrid text+vector search from a non-Bolt client. Covers connection, RPC catalog, collection→database mapping…

orneryd/NornicDB · 98 tokens

field-service-sobject-create-configure

Headless 360 REST API deployment step for creating sObject records. Handles describe-based field discovery, required-field derivation, entity-relationship ordering, and composite graph transactions. Use this skill when a designer skill (or a user directly) needs to create sObject records after design confirmation…

forcedotcom/sf-skills · 74 tokens