/product-sdk:product-sdk-statement-storefrom product-sdk
Publishes and subscribes to ephemeral messages on the Polkadot Statement Store pub/sub system. Covers StatementStoreClient lifecycle, host/local connection modes, topic/channel creation, and 512-byte data size limits.
Ships in product-sdk. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
The Statement Store is a pub/sub messaging system built on top of the Polkadot Bulletin Chain. It lets peers publish small, signed, ephemeral statements tagged with topics and optional channels.
Package: @parity/product-sdk-statement-store
DATA SIZE LIMIT: MAX_STATEMENT_SIZE = 512 bytes. The JSON-serialized payload must not exceed 512 bytes after UTF-8 encoding.
TWO CONNECTION MODES. Use
{ mode: "host", accountId }inside containers or{ mode: "local", signer }outside containers.
import { StatementStoreClient } from "@parity/product-sdk-statement-store";
const client = new StatementStoreClient({ appName: "my-app" });
await client.connect({ mode: "host", accountId: ["5Grw...", 42] });
const sub = client.subscribe<{ type: string }>(statement => {
console.log(statement.data.type);
});
await client.publish({ type: "presence" }, { channel: "room-42" });
sub.unsubscribe();
client.destroy();
import { StatementStoreClient } from "@parity/product-sdk-statement-store";
const client = new StatementStoreClient({
appName: "my-app",
});
await client.connect({
mode: "local",
signer: { publicKey: myPublicKey, sign: (msg) => sr25519Sign(msg, mySecretKey) },
});
const sub = client.subscribe<{ type: string }>(statement => {
console.log(statement.data.type);
});
await client.publish({ type: "presence" });
sub.unsubscribe();
client.destroy();
const client = new StatementStoreClient({
appName: "my-app", // required: hashed as topic1
defaultTtlSeconds: 30, // optional: statement TTL (default 30)
// transport: customTransport, // optional: BYOD transport for tests
});
// Host mode
await client.connect({ mode: "host", accountId: ["5Grw...", 42] });
// Local mode
await client.connect({ mode: "local", signer: { publicKey, sign } });
Returns a Result<void, StatementStoreError> — ok on accept, err carrying the reason (StatementConnectionError, StatementDataTooLargeError, or StatementSubmitError).
const result = await client.publish<MyData>(data, {
channel: "my-channel",
topic2: "room-id",
});
if (result.ok) {
// accepted
} else {
// rejected or errored — inspect result.error for why
console.error(result.error);
}
const sub = client.subscribe<MyData>(callback, { topic2: "room-id" });
sub.unsubscribe();
client.destroy();
import { ChannelStore } from "@parity/product-sdk-statement-store";
const channels = new ChannelStore<Presence>(client, { topic2: "doc-123" });
// write returns a Result<void, StatementStoreError> — ok on accept, err carrying the reason
const result = await channels.write("presence/peer-abc", { type: "presence", timestamp: Date.now() });
if (!result.ok) console.error(result.error);
const value = channels.read("presence/peer-abc");
const all = channels.readAll();
const sub = channels.onChange((channelName, value, previous) => {
console.log(`${channelName} updated`);
});
channels.destroy();
import { createTopic, createChannel, topicToHex } from "@parity/product-sdk-statement-store";
const topic = createTopic("my-room");
const channel = createChannel("presence/peer-abc");
const hex = topicToHex(topic);
import {
StatementStoreError,
StatementConnectionError,
StatementDataTooLargeError,
StatementSubmitError,
} from "@parity/product-sdk-statement-store";
publish and ChannelStore.write return a Result<void, StatementStoreError> rather than throwing. On failure, result.error is one of the subclasses above; narrow on it to react to the specific cause.
CommonSignerTxCreator instead of StatementSignerWithKey - Different interfacedestroy() - Keeps connections openconnect() - Must connect before publish/subscribeWhat SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub paritytech/product-sdk --plugin product-sdk11 skills in this plugin
/migrating-to-product-sdkUse when migrating a product codebase to @parity/product-sdk — detects legacy stacks (polkadot-apps, novasamatech, hand-rolled crypto/IPFS, polkadot-api 1.x) in the target repo, decides which migration areas apply, writes a per-repo migration spec, then hands off to writing-plans.
/product-sdk-app-builderEnd-to-end scaffolding and implementation of Polkadot applications using @parity/product-sdk packages. Use when: creating a new Polkadot project, building a dApp, scaffolding chain interactions, choosing which @parity/product-sdk packages to install, or when a user says "build me a Polkadot app". Handles both developer-guided and fully autonomous (non-developer) workflows.
/product-sdk-chain-connectionUse when connecting to Polkadot chains, querying chain state, subscribing to storage, working with typed APIs, or choosing between preset and BYOD paths. Covers @parity/product-sdk-chain-client and @parity/product-sdk-descriptors.
/product-sdk-cloud-storageUse when uploading or retrieving data via Cloud Storage, working with CID-based decentralized storage, or the CloudStorageClient SDK. Covers the store() upload builder, chunked uploads, container-only reads (fetch/query), CID helpers, and authorization.
/product-sdk-contractsUse when interacting with smart contracts (PolkaVM/Solidity) on Asset Hub, using ContractManager with cdm.json manifests, createContract for ad-hoc contracts, ContractRuntime creation, or contract type codegen. Covers @parity/product-sdk-contracts.
/product-sdk-individualityUse when reading a person's personhood or membership standing on the individuality chain from a DotNS username or an account address, when reading the usernames an account holds, or when sending a transaction that must run under a person, lite-person or score-participant origin instead of an account origin. Covers readPersonhoodState, lookupUsername, the seven-state PersonhoodState union, the pure derivation without a chain client and the decode helpers for raw Score.Participants and Resources.Consumers values; the game surface, its prize draws, claiming and sign-up with its airdrop VRFs; productContext, personhoodContext, peopleRing, litePeopleRing and readScoreContext for the ring-VRF proof contexts; withAsPerson, withLiteAlias and the RestrictOrigins requirement that otherwise fails every call; the two-transaction lite personhood bind then sign-up flow with buildLiteAliasBindTx, readLiteSignUpRequirement and signUpWithLiteInviteTx; game registration in one call with registerForGame, readGameSeat, deriveSeat, bindGameSeat and the /host entry's hostGameRegistrationCapabilities; and full-personhood registration with registerMessage, Score.register and withScoreParticipant.
3 plugins in 2 repositories ship this exact skill · first indexed Oct 14, 2026
Other plugins' skills for the same job