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, SkillManifest, SkillToolDefinition, SkillPromptSection } from '@signalwire/sdk';
2
3class WeatherSkill extends SkillBase {
4 constructor(config?: Record<string, unknown>) {
5 super('weather', config);
6 }
7
8 getManifest(): SkillManifest {
9 return { name: 'weather', description: 'Provides weather information', version: '1.0.0' };
10 }
11
12 getTools(): SkillToolDefinition[] {
13 return [];
14 }
15
16 protected _getPromptSections(): SkillPromptSection[] {
17 return [
18 {
19 title: 'Weather Information',
20 body: 'You can check weather for any location using the get_weather tool.',
21 },
22 {
23 title: 'Weather Guidelines',
24 bullets: [
25 'Always confirm the location before checking weather',
26 'Report temperature in the user\'s preferred units',
27 ],
28 },
29 ];
30 }
31}