mcpField
S
spectrum

spectrum

github.com/photon-hqDevelopment153.0k installsUpdated 12w ago
Repository

About spectrum

Spectrum is a skill for developers using Photon's `spectrum-ts` messaging SDK. It provides version-specific guidance for building message handlers across iMessage, WhatsApp Business, Terminal, and custom providers, including provider capabilities and fallbacks.

Key features

  1. 01Guidance for `spectrum-ts` 12.2.0
  2. 02Unified `app.messages` handler patterns
  3. 03Provider-specific implementation references
  4. 04Capability, fallback, and error guidance
  5. 05Custom provider authoring guidance

Use cases

  1. 01Building multi-provider messaging handlers
  2. 02Checking support before using provider methods
  3. 03Implementing custom Spectrum providers

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/photon-hq/skills --skill spectrum

After installing, type/spectrumin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

best-practices.md
capability-semantics.md
content.md
custom-events-and-lifecycle.md
custom-platforms.md
getting-started.md
messages.md
platform-narrowing.md
reactions-and-replies.md
spaces-and-users.md
providers/
imessage.md
terminal.md
whatsapp-business.md

Details

From the project README

Spectrum

Spectrum is Photon's unified messaging SDK. Write handler logic against one app.messages stream and deliver it through iMessage, WhatsApp Business, Terminal, or a custom provider. This skill targets spectrum-ts 12.2.0; its code samples are TypeScript.

Contract gate

Identify the provider and load its topic file before writing provider-specific code. A sample is complete only when every import, method, content shape, platform ID, fallback, and thrown error belongs to spectrum-ts 12.2.0 and the selected provider contract. The universal method existing does not prove that every provider implements it; read capability-semantics.md whenever support affects correctness.

How this skill is organized

Each topic lives in its own file in this directory. Read the file relevant to the user's question.

FileWhen to consult
getting-started.mdInstallation, the Spectrum() app instance, multi-platform setup, the four core primitives.
messages.mdReceiving messages, the Message shape, narrowing on content.type, filtering own messages.
content.mdContent builders for outgoing messages: text, markdown, attachment, voice, contact, richlink, app, poll, group, custom.
spaces-and-users.mdThe Space interface, typing indicators, responding, creating DMs and groups.
reactions-and-replies.mdmessage.react(...), threaded message.reply(...), when to use which.
capability-semantics.mdNative support vs fallback, warn-and-skip, accepted no-op, and thrown errors.
platform-narrowing.mdRecovering platform-specific types from generic Spectrum primitives.
providers/imessage.mdiMessage — separate cloud/local providers, shared/dedicated cloud line model, per-phone routing, message effects, tapbacks.
providers/terminal.mdTerminal TUI provider — chat sidebar, reactions, replies, attachments, slash commands.
providers/whatsapp-business.mdWhatsApp Business Cloud API. 1:1 only.
custom-events-and-lifecycle.mdPer-provider event streams (app.typing, etc.), app.stop(), signal handling.
custom-platforms.mdAuthoring your own provider with definePlatform — full field reference.
best-practices.mdProduction architecture patterns Photon uses internally — debounce pipeline, in-flight cancellation, carry-forward, idempotent retries, per-resource memory, job-failure audit log.

See also

Comments

Markdown supported