KS
Killer-Skills

add-message-type — Categories.community

v1.0.0
GitHub

About this Skill

Perfect for Advanced Protocol Agents needing to extend WebSocket message types in a serverless, end-to-end encrypted environment. Serverless, end-to-end encrypted, local-network file and secret sharing between 2 devices. No cloud, no relay — just Wi-Fi.

MehdiMamas MehdiMamas
[0]
[0]
Updated: 3/4/2026

Quality Score

Top 5%
30
Excellent
Based on code quality & docs
Installation
SYS Universal Install (Auto-Detect)
Cursor IDE Windsurf IDE VS Code IDE
> npx killer-skills add MehdiMamas/ShareGo

Agent Capability Analysis

The add-message-type MCP Server by MehdiMamas is an open-source Categories.community integration for Claude and other AI agents, enabling seamless task automation and capability expansion.

Ideal Agent Persona

Perfect for Advanced Protocol Agents needing to extend WebSocket message types in a serverless, end-to-end encrypted environment.

Core Value

Empowers agents to define new message interfaces using TypeScript enums and interfaces, enhancing the ShareGo protocol with custom message types over WebSocket, leveraging JSON messages for seamless communication.

Capabilities Granted for add-message-type MCP Server

Extending the ShareGo protocol with custom message types
Defining new message interfaces for local-network file sharing
Implementing end-to-end encryption for sensitive data exchange

! Prerequisites & Limits

  • Requires modifications to the core library and documentation
  • Limited to TypeScript environments
  • Dependent on WebSocket protocol
Project
SKILL.md
2.9 KB
.cursorrules
1.2 KB
package.json
240 B
Ready
UTF-8

# Tags

[No tags]
SKILL.md
Readonly

Adding a new message type

the ShareGo protocol uses typed JSON messages over WebSocket. adding a new message type requires changes in the core library and documentation.

Steps

1. Add the type to the enum

file: core/src/protocol/types.ts

typescript
1export enum MessageType { 2 // ... existing types 3 PING = "PING", // your new type 4}

2. Define the message interface

file: core/src/protocol/types.ts

typescript
1export interface PingMessage extends BaseMessage { 2 type: MessageType.PING; 3 timestamp: number; 4}

3. Add to the union

file: core/src/protocol/types.ts

typescript
1export type ProtocolMessage = 2 | HelloMessage 3 | ChallengeMessage 4 // ... existing 5 | PingMessage; // add here

4. Update serialization validation

file: core/src/protocol/serialization.ts

add a case for the new type in deserializeMessage() to validate required fields:

typescript
1case MessageType.PING: 2 if (typeof parsed.timestamp !== "number") { 3 throw new Error("PING: missing timestamp"); 4 } 5 break;

5. Handle in session

file: core/src/session/session.ts

add a case in handleIncoming():

typescript
1case MessageType.PING: 2 this.handlePing(msg as PingMessage); 3 break;

6. Export if needed

if the new message type needs to be used by app shells, export it from:

  • core/src/protocol/index.ts
  • core/src/index.ts

7. Add tests

file: core/src/protocol/serialization.test.ts

typescript
1it("should roundtrip PING message", () => { 2 const msg: PingMessage = { 3 ...createBaseFields(MessageType.PING, "ABC123", 1), 4 timestamp: Date.now(), 5 }; 6 const bytes = serializeMessage(msg); 7 const parsed = deserializeMessage(bytes); 8 expect(parsed.type).toBe(MessageType.PING); 9});

8. Update documentation

  • docs/PROTOCOL.md — add the message spec, fields table, and example JSON
  • docs/THREAT_MODEL.md — add security implications if the message carries sensitive data
  • .cursor/rules/sharego-protocol.mdc — update if wire format changes

Security checklist

  • new message does NOT carry plaintext sensitive data (passwords, OTPs)
  • if it carries binary data, it uses AEAD encryption like DATA messages
  • sequence number is required and validated
  • protocol version is checked
  • session ID is validated
  • unknown/unexpected messages of this type are rejected, not ignored
  • no new fields leak key material or internal state

Checklist

  • enum value added to MessageType
  • interface defined extending BaseMessage
  • added to ProtocolMessage union
  • serialization validation added in deserializeMessage()
  • handler added in session.ts handleIncoming()
  • exported from barrel files (if needed by app shells)
  • roundtrip test added
  • docs/PROTOCOL.md updated with spec
  • docs/THREAT_MODEL.md updated if security-relevant

Related Skills

Looking for an alternative to add-message-type or building a Categories.community AI Agent? Explore these related open-source MCP Servers.

View All

widget-generator

Logo of f
f

widget-generator is an open-source AI agent skill for creating widget plugins that are injected into prompt feeds on prompts.chat. It supports two rendering modes: standard prompt widgets using default PromptCard styling and custom render widgets built as full React components.

149.6k
0
Design

chat-sdk

Logo of lobehub
lobehub

chat-sdk is a unified TypeScript SDK for building chat bots across multiple platforms, providing a single interface for deploying bot logic.

73.0k
0
Communication

zustand

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication

data-fetching

Logo of lobehub
lobehub

The ultimate space for work and life — to find, build, and collaborate with agent teammates that grow with you. We are taking agent harness to the next level — enabling multi-agent collaboration, effortless agent team design, and introducing agents as the unit of work interaction.

72.8k
0
Communication