Skill Development Guide
How to create, test, and deploy custom skills
π Skill Development Guide
This guide explains how to create, test, and deploy custom skills.1. Developing Skills
Handler Function
Every skill must export ahandler function with this signature:
Handler Input
- parameters: Validated inputs based on your JSON Schema.
- context: Conversation, contact, channel, and organization fields for the current execution.
- config: Non-sensitive, installation-scoped configuration values.
- secrets: Sensitive credentials (API keys, tokens). Never log or return these.
Context Fields
- conversationId: string
- contactId: string
- profileName: string
- organizationId: string
- organizationName: string
- organizationDescription: string
- organizationTimezone: string (IANA timezone)
- channelType: string (e.g., WHATSAPP, INSTAGRAM, FACEBOOK, WEBCHAT)
- referenceId: string
- contactName: string
- contactEmail: string | null
- contactPhone: string | null
- channelName: string
- channelReference: string | null
2. Required Response Format
Your skill handler must return an object that conforms to this schema (aligned withpackages/utils/src/action-response.ts):
Field Details
-
prompt (Required)
- Type: string
- Purpose: Brief, human-readable summary of what the skill accomplished
- Used in conversation logs and AI context
-
knowledgeBaseReferences (Optional)
- Cite sources or related docs
- Fields:
id,title,relevance(number)
-
message (Optional)
- A short assistant-facing message, separate from the end-user
response
- A short assistant-facing message, separate from the end-user
-
response (Optional)
- Container for rendered content
response.text: stringresponse.buttons: interactive buttonslabel: β€ 20 characterspayload: β€ 20 characters
response.carousel: list of cards- Card buttons:
type: βweb_urlβ or βpostbackβ- When
typeis βweb_urlβ, provideurl - When
typeis βpostbackβ, providepayload - Empty strings for
url,imageUrl, anddefaultActionUrlare treated as omitted
- Card buttons:
response.imageUrl: HTTPS URL of an image attachment (empty string treated as omitted)
Complete Examples
Error Response Pattern
Return structured responses even on errors:3. Parameter Schema
Define inputs using JSON Schema:- use lowercase property names
- provide clear descriptions
- add min/max constraints
- mark required vs optional
- keep nesting shallow
4. Configuration & Secrets
Configuration (non-sensitive, per installation)
Secrets (sensitive; provided via input.secrets)
- Never log or expose values from secrets.
5. Testing & Validation
Local Testing (Skill Playground)
Use sample parameters and verify your outputs:contactName, contactEmail, contactPhone, channelName, and channelReference.
Validation Pipeline
The platform validates:- JavaScript syntax & security
- Parameter schema compliance
- Response format correctness
- Performance constraints
- Best practice adherence
- Button character limits (label/payload β€ 20)
- HTTPS requirement for
response.imageUrl
validateActionResponse() from packages/utils/src/action-response.ts.
- Updated to include
message?: string,response.imageUrl(HTTPS-only), optional carouseldefaultActionUrl, and clarified that certain fields treat empty strings as omitted. Removed hard βrequired-if-typeβ constraint for carousel buttons to match current validation.