getPromptSections

View as MarkdownOpen in Claude

Returns prompt sections that the agent incorporates into its system prompt.

Subclasses should override the internal _getPromptSections() method, not getPromptSections() directly. The public method checks skip_prompt before delegating to the internal one.

Takes no parameters.

Returns

SkillPromptSection[] — Array of prompt section objects. Each section has a title and either a body string or a bullets array. An optional numbered boolean flag renders bullets as a numbered list.

Example

import { SkillBase, type SkillToolDefinition, type SkillPromptSection } from '@signalwire/sdk';
class WeatherSkill extends SkillBase {
static override SKILL_NAME = 'weather';
static override SKILL_DESCRIPTION = 'Provides weather information';
override getTools(): SkillToolDefinition[] {
return [];
}
protected override _getPromptSections(): SkillPromptSection[] {
return [
{
title: 'Weather Information',
body: 'You can check weather for any location using the get_weather tool.',
},
{
title: 'Weather Guidelines',
bullets: [
'Always confirm the location before checking weather',
'Report temperature in the user\'s preferred units',
],
},
];
}
}