contexture webrtc.instructions.md

A set of development rules for WebRTC, a browser technology for real-time audio, video, and data connections. It covers data-channel delivery, message sizes, backpressure, media tracks, and connection cleanup.

In plain words
What is it for?
Use it when implementing WebRTC data channels, synchronizing state, sending telemetry, handling media tracks, or managing peer-connection events.
Why use it?
It helps prevent dropped messages, overloaded send buffers, excessive latency, and lifecycle bugs in real-time connections.

Instructions file for GitHub Copilot

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 instructions/ackeskin/contexture/webrtc
Clone the repo
git clone --depth 1 https://github.com/AcKeskin/contexture

Made for: GitHub Copilot.

Per session 1,214 This file is loaded in full into every session.
When invoked 1,214 The same file — it is already loaded in full.
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 $0.01214 $0.01214
Opus 5 $0.00607 $0.00607
Sonnet 5 $0.00243 $0.00243
Haiku 4.5 $0.00121 $0.00121

Measured 2d ago against content hash 4eeed9e2b4ca, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

contexture webrtc.instructions.md 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 2d 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.

.github/instructions/webrtc.instructions.md · 46 lines

How it starts

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

webrtc rules

Auto-loaded by Copilot when editing files matching **. Generated from architectural-rules/webrtc/ — do not hand-edit.

Data channels and reliability

Choose ordered/reliable vs unreliable per use case deliberately. Set maxRetransmits or maxPacketLifeTime (never both) for partial reliability; leave both unset only when full reliability is actually required. State sync wants reliable; real-time telemetry wants unreliable. (W3C WebRTC — RTCDataChannel / createDataChannel options)

Respect message-size limits: chunk large payloads to a ~16 KB ceiling for portable interop. Larger single messages are not portably supported across SCTP implementations and can stall or drop the channel. (W3C WebRTC — RTCDataChannel.send)

Handle backpressure: check bufferedAmount before sending and pause until the bufferedamountlow event when it exceeds bufferedAmountLowThreshold. Sending blind floods the SCTP send buffer, ballooning memory and latency. (W3C WebRTC — RTCDataChannel.bufferedAmount / bufferedAmountLowThreshold)

Drive sends off the channel's open/close lifecycle: only send while readyState === "open", and clean up listeners on close. Sending before open or after close throws or silently drops. (W3C WebRTC — RTCDataChannel.readyState)

Why: RTCDataChannel runs over SCTP, which exposes both reliability/ordering knobs and a finite send buffer, so the reliability mode and message size are application decisions that must be made on purpose, not defaulted into. Honoring the ~16 KB portable size ceiling, gating on bufferedAmount/bufferedamountlow for flow control, and respecting the open/close lifecycle prevents stalled channels, unbounded buffer growth, and dropped sends. Source: W3C WebRTC specification (RTCDataChannel).

Media and tracks

Manage transceivers explicitly: set addTransceiver direction (sendrecv/sendonly/recvonly/inactive) deliberately and stop transceivers you no longer need. Implicit m-line creation via addTrack hides direction and leaves dead media sections in the SDP. (W3C WebRTC — RTCRtpTransceiver.direction)

Read the full file on GitHub · 46 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. 2d ago First seen · 46 lines · 1,214 tokens per session scan A 4eeed9e2b4ca

Subscribe to this mod's changes

contexture webrtc.instructions.md is an instructions file published in the GitHub repository AcKeskin/contexture (2 stars, last pushed 1mo ago), licensed MIT. It adds 1,214 tokens to every session, about $0.0061 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-31.