knowtis-app: Skill for Claude Code

.agents/skills/wiring-realtime-collaboration/SKILL.md

wiring-realtime-collaboration is a skill for Claude Code, Codex from jovandyaz/knowtis-app. It costs 125 tokens per session (1,091 once invoked), scanned A, original, MIT.

A project-specific guide for maintaining realtime editing, where several users can work on the same note at once, using Tiptap, Yjs, and Hocuspocus.

In plain words
What is it for?
Editing or debugging collaborative notes, guest access, share links, read-only permissions, WebSocket connections, and content updates between APIs and live documents.
Why use it?
It helps trace duplicated, missing, outdated, or overwritten content across the editor, server, database, and sharing system.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

This is jovandyaz/knowtis-app's own configuration. It tells Claude Code and Codex how to work on knowtis-app itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything knowtis-app configures →

Reuse

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.

Copy the file
curl -O https://raw.githubusercontent.com/jovandyaz/knowtis-app/main/.agents/skills/wiring-realtime-collaboration/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/jovandyaz/knowtis-app

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 wiring-realtime-collaboration

README.md
[![agentmods](https://agentmods.dev/badge/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration/github.svg)](https://agentmods.dev/skills/jovandyaz/knowtis-app/wiring-realtime-collaboration)
Your own site
<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.

agentmods 80×15 button for wiring-realtime-collaboration

Your own site · 80×15
<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>
Per session 125 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,091 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.00125 $0.01091
Opus 5 $0.00063 $0.00545
Sonnet 5 $0.00025 $0.00218
Haiku 4.5 $0.00013 $0.00109

Measured 10d ago against content hash 096d8bc85130, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

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.

.agents/skills/wiring-realtime-collaboration/SKILL.md · 37 lines

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)

  1. Authorization happens at the handshake, server-side. HocuspocusAuthExtension.onAuthenticate verifies the JWT, loads user + note, builds the CASL ability, and rejects on cannot('read') / sets connectionConfig.readOnly = true on cannot('update'). Read-only is enforced at the protocol level — never rely on client-side flags to block writes.
  2. The trivial-fragment guard must survive refactors. onStoreDocument refuses 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.
  3. DirectConnection.transact overrides origin tags. Hocuspocus wraps callbacks in document.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.
  4. MCP-issued JWTs are rejected at the collaboration handshake. An MCP API key must never grant a live editing socket.
  5. Hydration uncertainty fails closed. Returning a blank document after findById fails or non-trivial stored HTML/Yjs bytes cannot be decoded lets the next edit overwrite persisted content. Repository errors already normalize to HANDSHAKE_FAILURE.INTERNAL_ERROR; malformed non-trivial hydration currently returns a fresh document and is a known bug that must be changed to fail closed.
  6. 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.
  7. Persist HTML and Yjs state together. Normal storage derives HTML and calls updateContentWithYjsState; if HTML conversion fails, fall back to updateYjsState. Both return Result; log errors rather than throwing from the storage hook.
  8. One Y.Doc + Awareness instance. Call parameterless useYjs(), then getYDoc(noteId) and getAwareness(noteId); pass those exact instances to Hocuspocus. Duplicate instances desync the editor.

Read the full file on GitHub · 37 lines

Files

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.

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. 10d ago First seen · 37 lines · 125 tokens per session scan A 096d8bc85130

Subscribe to this mod's changes

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.

Related

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.

cyanheads/obsidian-mcp-server · 62 tokens

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.

cyanheads/obsidian-mcp-server · 35 tokens

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.

cyanheads/obsidian-mcp-server · 79 tokens

hunt-nestjs

Hunt NestJS-specific vulnerabilities: guard bypass, decorator gaps, and microservice auth drift.

uphiago/recon-skills · 24 tokens

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.

cyanheads/obsidian-mcp-server · 54 tokens

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.

wecode-ai/Wegent · 51 tokens