forge-realtime: Realtime communication
Engine: Hybrid — Forge + Supabase, Cloudflare, Sentry
Purpose
Inspect WebSocket, SSE, subscription, and presence flows for authorization, lifecycle, ordering, abuse, and recovery.
Deterministic runtime composition
Before loading any provider procedure, run:
Resolve ../../runtime/cli/src/composition-entry.js relative to this SKILL.md, then run:
node "<resolved-absolute-runner-path>" realtime compose --workflow audit --root "<repository-root>" --dry-run --json
Add one repeatable --request <provider-or-source> flag for each explicit user request. Add
--condition <task-condition> or --risk-surface <surface> only for a task fact you directly
proved; never infer one from generic wording. The command above is the default for this
audit-oriented module; for implementation use --workflow build, and for a fix, retest, or
release gate use --workflow fix, verify, or ship respectively. Read the JSON response,
keep the Forge contract at index zero, and resolve paths against the absolute runtime_root
reported in that response. Read eager[].runtimePath when entering the module. The full
selected[] list is availability/provenance; load only deferred[].runtimePath when the task
reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported
suppression and context budget. If missing is non-empty, stop and report the installation as
damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin
cache or global installation; never assume they are inside the audited repository.
Resolve and read ../fullstack-forge/references/shared/module-contract.md (applicability,
execution, mutation, verification, completion) and
../fullstack-forge/references/shared/evidence-rules.md (statuses, standards, tools, findings via
../fullstack-forge/references/PROTOCOL.md) relative to this module SKILL.md before reporting.
Never hide failed checks or claim that an operation ran when it did not.
Automatic activation signals
Activate when a request or direct repository evidence involves realtime communication, when
the user explicitly names forge-realtime, or when discovery proves an applicable boundary.
- WebSockets, SSE, subscriptions, live presence, or collaborative state
When not to activate
- Request-response applications with no persistent or pushed channel
Automated support
Relevant discovery inputs are:
- connection handlers
- channel and subscription policies
- client reconnection code
Deterministic support, bounded evidence only:
inspect-routes
inspect-authorization
Agent inspection procedure
- Inventory WebSocket and SSE endpoints and subscriptions; verify authentication at connect and authorization per channel or topic.
- Trace tenant and user separation of channels, presence, and broadcast fan-out.
- Exercise reconnection: missed-message recovery, ordering, duplicates, and state resynchronization after a gap.
- Check backpressure and slow-consumer handling, message-size limits, and rate limits per connection.
- Verify authentication refresh on long-lived connections, and cleanup of subscriptions, timers, and server resources on disconnect.
Manual inspection requirements:
- Observe network interruption and multi-device behavior
- Review gateway limits and load-balancer timeouts
Stack-specific guidance:
- Enforce authorization server-side for each resource, not just at connection time
Evidence to collect
Standards used as criteria:
- RFC 6455
- OWASP WebSocket Security Cheat Sheet
Common production failures
- Authenticate handshakes and authorize every subscribe, publish, and resource action
- Inspect token expiry, revocation, origin, message schema and size, rate limits, backpressure, heartbeats, cleanup, and connection caps
- Check ordering, deduplication, cursor/resume, reconnect storms, stale presence, tenant namespaces, and sensitive errors
Missing-control checks
Each item needs direct evidence or one reasoned status.
- WebSocket authorization
- SSE authorization
- Reconnection
- Ordering
- Duplicate messages
- Presence
- Backpressure
- Resource cleanup
- Tenant-separated channels
- Rate limits
- Offline recovery
- Authentication refresh
- Subscription cleanup
- Fan-out
- Message size
Commands and tools
- Run
forge realtime audit --json or fullstack-forge realtime audit --json when
an explicit audit is requested and the CLI is installed. Normal feature work does not require it.
Safe fixes
- Add message bounds, schema validation, and cleanup
- Namespace channels and add bounded reconnect jitter
Approval-required changes
- Changing delivery guarantees, channel authorization, or gateway topology
Verification
- Test expired, revoked, unauthorized, duplicate, out-of-order, and oversized messages
- Disconnect abruptly and confirm cleanup and resume semantics
Completion contract
Follow fullstack-forge/references/shared/completion.md and the limitations below.
Known limitations
- Gateway and network behavior require runtime load evidence
1---2name: forge-realtime-33description: Inspect WebSocket, SSE, subscription, and presence flows for authorization, lifecycle, ordering, abuse, and recovery.4---56# forge-realtime: Realtime communication78Engine: Hybrid — Forge + Supabase, Cloudflare, Sentry910## Purpose1112Inspect WebSocket, SSE, subscription, and presence flows for authorization, lifecycle, ordering, abuse, and recovery.131415## Deterministic runtime composition1617Before loading any provider procedure, run:1819Resolve `../../runtime/cli/src/composition-entry.js` relative to this `SKILL.md`, then run:2021`node "<resolved-absolute-runner-path>" realtime compose --workflow audit --root "<repository-root>" --dry-run --json`2223Add one repeatable `--request <provider-or-source>` flag for each explicit user request. Add24`--condition <task-condition>` or `--risk-surface <surface>` only for a task fact you directly25proved; never infer one from generic wording. The command above is the default for this26audit-oriented module; for implementation use `--workflow build`, and for a fix, retest, or27release gate use `--workflow fix`, `verify`, or `ship` respectively. Read the JSON response,28keep the Forge contract at index zero, and resolve paths against the absolute `runtime_root`29reported in that response. Read `eager[].runtimePath` when entering the module. The full30`selected[]` list is availability/provenance; load only `deferred[].runtimePath` when the task31reaches that concern, in tier order. Refuse any path that escapes the root. Respect every reported32suppression and context budget. If `missing` is non-empty, stop and report the installation as33damaged; do not improvise a prose fallback. The runner and specialist content may live in a plugin34cache or global installation; never assume they are inside the audited repository.353637Resolve and read `../fullstack-forge/references/shared/module-contract.md` (applicability,38execution, mutation, verification, completion) and39`../fullstack-forge/references/shared/evidence-rules.md` (statuses, standards, tools, findings via40`../fullstack-forge/references/PROTOCOL.md`) relative to this module `SKILL.md` before reporting.4142Never hide failed checks or claim that an operation ran when it did not.4344## Automatic activation signals4546Activate when a request or direct repository evidence involves realtime communication, when47the user explicitly names `forge-realtime`, or when discovery proves an applicable boundary.4849- WebSockets, SSE, subscriptions, live presence, or collaborative state5051## When not to activate5253- Request-response applications with no persistent or pushed channel5455## Automated support5657Relevant discovery inputs are:5859- connection handlers60- channel and subscription policies61- client reconnection code6263Deterministic support, bounded evidence only:6465- `inspect-routes`66- `inspect-authorization`6768## Agent inspection procedure69701. Inventory WebSocket and SSE endpoints and subscriptions; verify authentication at connect and authorization per channel or topic.712. Trace tenant and user separation of channels, presence, and broadcast fan-out.723. Exercise reconnection: missed-message recovery, ordering, duplicates, and state resynchronization after a gap.734. Check backpressure and slow-consumer handling, message-size limits, and rate limits per connection.745. Verify authentication refresh on long-lived connections, and cleanup of subscriptions, timers, and server resources on disconnect.7576Manual inspection requirements:7778- Observe network interruption and multi-device behavior79- Review gateway limits and load-balancer timeouts8081Stack-specific guidance:8283- Enforce authorization server-side for each resource, not just at connection time8485## Evidence to collect8687Standards used as criteria:8889- RFC 645590- OWASP WebSocket Security Cheat Sheet9192## Common production failures9394- Authenticate handshakes and authorize every subscribe, publish, and resource action95- Inspect token expiry, revocation, origin, message schema and size, rate limits, backpressure, heartbeats, cleanup, and connection caps96- Check ordering, deduplication, cursor/resume, reconnect storms, stale presence, tenant namespaces, and sensitive errors9798## Missing-control checks99100Each item needs direct evidence or one reasoned status.101102- WebSocket authorization103- SSE authorization104- Reconnection105- Ordering106- Duplicate messages107- Presence108- Backpressure109- Resource cleanup110- Tenant-separated channels111- Rate limits112- Offline recovery113- Authentication refresh114- Subscription cleanup115- Fan-out116- Message size117118## Commands and tools119120- Run `forge realtime audit --json` or `fullstack-forge realtime audit --json` when121 an explicit audit is requested and the CLI is installed. Normal feature work does not require it.122123## Safe fixes124125- Add message bounds, schema validation, and cleanup126- Namespace channels and add bounded reconnect jitter127128## Approval-required changes129130- Changing delivery guarantees, channel authorization, or gateway topology131132## Verification133134- Test expired, revoked, unauthorized, duplicate, out-of-order, and oversized messages135- Disconnect abruptly and confirm cleanup and resume semantics136137## Completion contract138139Follow `fullstack-forge/references/shared/completion.md` and the limitations below.140141## Known limitations142143- Gateway and network behavior require runtime load evidence