Skip to main content
skill CX Codex

spectrum — Claude Code skill for spectrum-ts messaging agents

A skill for building and reviewing messaging agents on Photon Spectrum: one message stream, delivered through iMessage, WhatsApp Business or a terminal.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add photon-hq/skills --skill spectrum -a claude-code
Open on GitHub

What spectrum does

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

Inside are topic files: installation and the core primitives, receiving messages and the Message shape, content builders (text, markdown, attachment, voice, contact, richlink, app, poll, group, custom), spaces and users, reactions and threaded replies, lifecycle. Provider files cover iMessage with its cloud and local lines, the Terminal TUI, and the WhatsApp Business Cloud API. There is also a reference for authoring your own provider with definePlatform, plus production patterns Photon uses internally: a debounce pipeline, in-flight cancellation, idempotent retries, a job-failure audit log.

The skill's first rule is to identify the provider and read its topic file before writing provider-specific code. A universal method existing in the SDK does not prove every provider implements it. When support affects correctness, you end up in capability-semantics.md sorting native support from fallback, accepted no-op and thrown errors. One caveat worth knowing up front: WhatsApp Business is 1:1 only.

What it helps with

  • write one message handler and wire it to several messengers
  • narrow on content.type when reading incoming messages
  • build an outgoing message with an attachment, poll or voice note
  • add reactions and threaded replies to an agent
  • set up production message processing with debounce and retries

Example prompts for the agent

  • Wire Spectrum to iMessage and WhatsApp Business with a single handler
  • Show me how to filter out my own messages and reply in a thread
  • Build a custom provider with definePlatform

How to install spectrum

1Skills CLI (Vercel)

npx skills add photon-hq/skills --skill spectrum -a claude-code

2Manually: put the files in place

~/.claude/skills/spectrum/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/spectrum/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about spectrum

How do I install spectrum in Claude?

Run npx skills add photon-hq/skills --skill spectrum -a claude-code. The skill file then sits at ~/.claude/skills/spectrum/SKILL.md.

What does the spectrum skill do?

It helps you build and review messaging agents on Photon Spectrum (spectrum-ts): setup, receiving and sending messages, spaces and users, the iMessage, WhatsApp Business and Terminal providers, and custom platforms.

Which providers does the skill cover?

iMessage, the WhatsApp Business Cloud API and the Terminal TUI. You can also author your own provider with definePlatform. Note that WhatsApp Business is 1:1 only.

Source text

SKILL.md · MIT
---
name: spectrum
description: >
  Build or review messaging agents with Photon Spectrum (`spectrum-ts`). Use for Spectrum setup, messages and
  content, spaces and users, provider capabilities, iMessage/WhatsApp/Terminal integrations, custom platforms,
  lifecycle, or production message-processing architecture.
license: MIT
metadata:
  author: photon-hq
  version: '2.1.0'
---

# 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`](https://github.com/photon-hq/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`](./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.

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

## See also

- [Spectrum docs](https://photon.codes/docs/spectrum-ts/getting-started)
- [`spectrum-ts` on GitHub](https://github.com/photon-hq/spectrum-ts)

© photon-hq · MIT · photon-hq/skills

Similar skills

All skills for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor