Borrowing it
Nothing to install: this file belongs to jovandyaz/knowtis-app. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/jovandyaz/knowtis-app/main/.agents/skills/wiring-realtime-collaboration/SKILL.mdgit clone --depth 1 https://github.com/jovandyaz/knowtis-appWrote 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.
[](https://agentmods.dev/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration)<a href="https://agentmods.dev/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration"><img src="https://agentmods.dev/badge/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration"><img src="https://agentmods.dev/badge/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00125 | $0.01091 |
| Opus 5 | $0.00063 | $0.00545 |
| Sonnet 5 | $0.00025 | $0.00218 |
| Haiku 4.5 | $0.00013 | $0.00109 |
Grade A, and why
wiring-realtime-collaboration 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 37 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Wiring realtime collaboration
Collaboration = Tiptap → Y.Doc updates → @hocuspocus/provider → Hocuspocus server (same Node HTTP server as the REST API, upgrade path /collaboration) → fan-out + debounced persistence. Full detail: references/collab-invariants.md.
Diagnose by writer and boundary
Before changing code for duplicated, stale, missing, or overwritten content, enumerate every writer involved: editor initialization, Yjs provider sync, Hocuspocus hydration/persistence, REST mutations, MCP mutations, and external-update broadcast. A fix at one writer can duplicate the correction already made by another.
For guest or share-link failures, trace the share token from route to provider URL to the server handshake, then verify the CASL read and update decisions separately. Client-disabled controls are UX only; Hocuspocus must enforce read-only at the protocol boundary.
When a failure appears only in local development, reproduce against a production frontend build before changing CRDT logic. React StrictMode can replay mount effects and expose duplicate client initialization that does not occur in production, but it must not be used to dismiss a server-side persistence or authorization bug.
Invariants (violations here cause data loss or auth bypass)
- Authorization happens at the handshake, server-side.
HocuspocusAuthExtension.onAuthenticateverifies the JWT, loads user + note, builds the CASL ability, and rejects oncannot('read')/ setsconnectionConfig.readOnly = trueoncannot('update'). Read-only is enforced at the protocol level — never rely on client-side flags to block writes. - The trivial-fragment guard must survive refactors.
onStoreDocumentrefuses to overwrite non-trivial DB content with a trivial live Y.Doc — this is what stops a freshly-connected client from clobbering REST/MCP-side updates with empty initial state. DirectConnection.transactoverrides origin tags. Hocuspocus wraps callbacks indocument.transact({ source: 'local' }), so origin-based filtering inside the persistence extension is unreliable through that path. Don't build logic that depends on origins surviving it.- MCP-issued JWTs are rejected at the collaboration handshake. An MCP API key must never grant a live editing socket.
- Hydration uncertainty fails closed. Returning a blank document after
findByIdfails or non-trivial stored HTML/Yjs bytes cannot be decoded lets the next edit overwrite persisted content. Repository errors already normalize toHANDSHAKE_FAILURE.INTERNAL_ERROR; malformed non-trivial hydration currently returns a fresh document and is a known bug that must be changed to fail closed. - The trivial-document guard must fail closed. The current guard logs “failing open” when its repository lookup fails, then continues to persistence. Treat that as a known bug: skip storage on lookup failure so a transient read error cannot authorize a destructive trivial write.
- Persist HTML and Yjs state together. Normal storage derives HTML and calls
updateContentWithYjsState; if HTML conversion fails, fall back toupdateYjsState. Both returnResult; log errors rather than throwing from the storage hook. - One Y.Doc + Awareness instance. Call parameterless
useYjs(), thengetYDoc(noteId)andgetAwareness(noteId); pass those exact instances to Hocuspocus. Duplicate instances desync the editor.
What ships with it
3 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 10d ago First seen · 37 lines · 125 tokens per session scan A 096d8bc85130
wiring-realtime-collaboration is a skill published in the GitHub repository jovandyaz/knowtis-app (3 stars, last pushed today), licensed MIT. It adds 125 tokens to every session and 1,091 once invoked, about $0.0006 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.
Other skills, from other repositories
design-mcp-server
Design the tool surface, resources, and service layer for a new MCP server. Use when starting a new server, planning a major feature expansion, or when the user describes a domain/API they want to expose via MCP. Produces a design doc at docs/design.md that drives implementation.
add-tool
Scaffold a new MCP tool definition. Use when the user asks to add a tool, create a new tool, or implement a new capability for the server.
api-context
Canonical reference for the unified Context object passed to every tool and resource handler in @cyanheads/mcp-ts-core. Covers the full interface, its RequestContext base, all sub-APIs (ctx.log, ctx.state, ctx.requestInput, ctx.inputs, ctx.enrich, ctx.content), and when to use each.
hunt-nestjs
Hunt NestJS-specific vulnerabilities: guard bypass, decorator gaps, and microservice auth drift.
api-errors
McpError constructor, JsonRpcErrorCode reference, and error handling patterns for @cyanheads/mcp-ts-core. Use when looking up error codes, understanding where errors should be thrown vs. caught, or using ErrorHandler.tryCatch in services.
wegent-knowledge
Knowledge base management and search tools for Wegent. Provides capabilities to list, create, update, and search knowledge bases and documents using RAG retrieval. Use this skill when the user wants to manage knowledge bases, documents, or search for information programmatically.