Publisher
🦞 Prepares publish payloads with content and metadata. Decoupled from delivery channels.
Overview
The Publisher skill transforms skill output into standardized publish payloads. It adds metadata (timestamps and tags) to content and prepares it for delivery through various channels (webhooks, stdout, databases, etc). The actual delivery mechanism belongs to the Dockyard orchestrator, keeping this skill channel-agnostic.
Interface
typescript
interface PublisherSkill extends Skill {
id: 'publisher';
name: 'Publisher';
version: '1.0.0';
execute(context: SkillContext): Promise<SkillResult>;
}
interface PublishPayload {
content: unknown;
meta: {
ts: number;
tags?: string[];
};
}
interface PublisherInput {
content?: unknown;
tags?: string[];
}
Input
SkillContext state:
| Key | Type | Description |
|---|---|---|
input | PublisherInput? | Optional input structure with content and tags |
input.content | unknown? | Content to publish (defaults to entire state if omitted) |
input.tags | string[]? | Optional tags for categorizing the publish |
Output
SkillResult data:
| Key | Type | Description |
|---|---|---|
publish | PublishPayload | Complete publish payload ready for delivery |
publish.content | unknown | The content to be published |
publish.meta.ts | number | Unix timestamp (milliseconds) of payload creation |
publish.meta.tags | string[]? | Optional tags included in payload |
SkillResult state:
| Key | Type | Description |
|---|---|---|
publisher_last | object | Last publish metadata |
publisher_last.ts | number | Timestamp of last prepared payload |
publisher_last.tags | string[] | Tags from last payload |
publisher_last.contentType | string | Type of last published content |
Example
typescript
import { publisher } from 'blueclaw-skills/skills/publisher';
const result = await publisher.execute({
env: { platform: 'linux', arch: 'x64', nodeVersion: '20.0.0', timestamp: Date.now() },
state: {
input: {
content: {
message: 'User action recorded',
user_id: 42,
action: 'login'
},
tags: ['security', 'auth']
}
}
});
console.log(result);
// {
// success: true,
// data: {
// publish: {
// content: { message: 'User action recorded', user_id: 42, action: 'login' },
// meta: {
// ts: 1707008400123,
// tags: ['security', 'auth']
// }
// }
// },
// state: {
// input: { ... },
// publisher_last: {
// ts: 1707008400123,
// tags: ['security', 'auth'],
// contentType: 'object'
// }
// }
// }
Publishing Channels
This skill only prepares payloads. The actual delivery mechanism is handled by Dockyard:
- •Webhook - HTTP POST to configured endpoints
- •Stdout - Console/log output
- •Database - Persistent storage
- •Message Queue - Async message systems
- •Stream - Real-time event streams
Notes
- •Channel-Agnostic: This skill knows nothing about delivery mechanisms
- •No Side Effects: Pure transformation, no network calls
- •State Tracking: Records metadata about each publish for audit trails
- •Flexible Content: Accepts any content type (string, object, array, etc)
- •Optional Tags: Tags are completely optional but recommended for organization
Error Handling
The skill returns success: false if:
- •Any unexpected error occurs during payload preparation
Version History
- •1.0.0 - Initial scaffold with timestamp and tag support