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

1import { SkillBase, type SkillToolDefinition, type SkillPromptSection } from '@signalwire/sdk';
2
3class WeatherSkill extends SkillBase {
4 static override SKILL_NAME = 'weather';
5 static override SKILL_DESCRIPTION = 'Provides weather information';
6
7 override getTools(): SkillToolDefinition[] {
8 return [];
9 }
10
11 protected override _getPromptSections(): SkillPromptSection[] {
12 return [
13 {
14 title: 'Weather Information',
15 body: 'You can check weather for any location using the get_weather tool.',
16 },
17 {
18 title: 'Weather Guidelines',
19 bullets: [
20 'Always confirm the location before checking weather',
21 'Report temperature in the user\'s preferred units',
22 ],
23 },
24 ];
25 }
26}