@octavus/docs 0.0.8 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (173) hide show
  1. package/README.md +127 -0
  2. package/content/01-getting-started/01-introduction.md +3 -3
  3. package/content/01-getting-started/02-quickstart.md +40 -17
  4. package/content/02-server-sdk/01-overview.md +54 -11
  5. package/content/02-server-sdk/02-sessions.md +166 -15
  6. package/content/02-server-sdk/03-tools.md +21 -21
  7. package/content/02-server-sdk/04-streaming.md +50 -20
  8. package/content/02-server-sdk/05-cli.md +247 -0
  9. package/content/03-client-sdk/01-overview.md +65 -35
  10. package/content/03-client-sdk/02-messages.md +116 -8
  11. package/content/03-client-sdk/03-streaming.md +36 -17
  12. package/content/03-client-sdk/04-execution-blocks.md +8 -12
  13. package/content/03-client-sdk/05-socket-transport.md +161 -45
  14. package/content/03-client-sdk/06-http-transport.md +48 -24
  15. package/content/03-client-sdk/07-structured-output.md +412 -0
  16. package/content/03-client-sdk/08-file-uploads.md +473 -0
  17. package/content/03-client-sdk/09-error-handling.md +274 -0
  18. package/content/04-protocol/01-overview.md +25 -14
  19. package/content/04-protocol/02-input-resources.md +35 -35
  20. package/content/04-protocol/03-triggers.md +9 -11
  21. package/content/04-protocol/04-tools.md +72 -29
  22. package/content/04-protocol/05-skills.md +304 -0
  23. package/content/04-protocol/06-handlers.md +304 -0
  24. package/content/04-protocol/07-agent-config.md +334 -0
  25. package/content/04-protocol/08-provider-options.md +294 -0
  26. package/content/04-protocol/09-skills-advanced.md +439 -0
  27. package/content/04-protocol/10-types.md +719 -0
  28. package/content/05-api-reference/01-overview.md +20 -21
  29. package/content/05-api-reference/02-sessions.md +192 -37
  30. package/content/05-api-reference/03-agents.md +25 -37
  31. package/content/06-examples/01-overview.md +6 -4
  32. package/content/06-examples/02-nextjs-chat.md +28 -18
  33. package/content/06-examples/03-socket-chat.md +53 -30
  34. package/content/06-examples/_meta.md +0 -1
  35. package/dist/chunk-WJ2W3DUC.js +663 -0
  36. package/dist/chunk-WJ2W3DUC.js.map +1 -0
  37. package/dist/content.js +1 -1
  38. package/dist/docs.json +106 -34
  39. package/dist/index.js +1 -1
  40. package/dist/search-index.json +1 -1
  41. package/dist/search.js +1 -1
  42. package/dist/search.js.map +1 -1
  43. package/dist/sections.json +106 -34
  44. package/package.json +12 -2
  45. package/content/04-protocol/05-handlers.md +0 -251
  46. package/content/04-protocol/06-agent-config.md +0 -209
  47. package/dist/chunk-232K4EME.js +0 -439
  48. package/dist/chunk-232K4EME.js.map +0 -1
  49. package/dist/chunk-2JDZLMS3.js +0 -439
  50. package/dist/chunk-2JDZLMS3.js.map +0 -1
  51. package/dist/chunk-2YMRODFE.js +0 -421
  52. package/dist/chunk-2YMRODFE.js.map +0 -1
  53. package/dist/chunk-2ZBPX5QB.js +0 -421
  54. package/dist/chunk-2ZBPX5QB.js.map +0 -1
  55. package/dist/chunk-3PIIST4D.js +0 -421
  56. package/dist/chunk-3PIIST4D.js.map +0 -1
  57. package/dist/chunk-42JETGDO.js +0 -421
  58. package/dist/chunk-42JETGDO.js.map +0 -1
  59. package/dist/chunk-4WWUKU4V.js +0 -421
  60. package/dist/chunk-4WWUKU4V.js.map +0 -1
  61. package/dist/chunk-5M7DS4DF.js +0 -519
  62. package/dist/chunk-5M7DS4DF.js.map +0 -1
  63. package/dist/chunk-6JQ3OMGF.js +0 -421
  64. package/dist/chunk-6JQ3OMGF.js.map +0 -1
  65. package/dist/chunk-7AOWCJHW.js +0 -421
  66. package/dist/chunk-7AOWCJHW.js.map +0 -1
  67. package/dist/chunk-7AS4ST73.js +0 -421
  68. package/dist/chunk-7AS4ST73.js.map +0 -1
  69. package/dist/chunk-7F5WOCIL.js +0 -421
  70. package/dist/chunk-7F5WOCIL.js.map +0 -1
  71. package/dist/chunk-7FPUAWSX.js +0 -421
  72. package/dist/chunk-7FPUAWSX.js.map +0 -1
  73. package/dist/chunk-APASMJBS.js +0 -421
  74. package/dist/chunk-APASMJBS.js.map +0 -1
  75. package/dist/chunk-BCEV3WV2.js +0 -421
  76. package/dist/chunk-BCEV3WV2.js.map +0 -1
  77. package/dist/chunk-CHGY4G27.js +0 -421
  78. package/dist/chunk-CHGY4G27.js.map +0 -1
  79. package/dist/chunk-CI7JDWKU.js +0 -421
  80. package/dist/chunk-CI7JDWKU.js.map +0 -1
  81. package/dist/chunk-CVFWWRL7.js +0 -421
  82. package/dist/chunk-CVFWWRL7.js.map +0 -1
  83. package/dist/chunk-EPDM2NIJ.js +0 -421
  84. package/dist/chunk-EPDM2NIJ.js.map +0 -1
  85. package/dist/chunk-ESGSYVGK.js +0 -421
  86. package/dist/chunk-ESGSYVGK.js.map +0 -1
  87. package/dist/chunk-GDCTM2SV.js +0 -421
  88. package/dist/chunk-GDCTM2SV.js.map +0 -1
  89. package/dist/chunk-GJ6FMIPD.js +0 -421
  90. package/dist/chunk-GJ6FMIPD.js.map +0 -1
  91. package/dist/chunk-H6JGSSAJ.js +0 -519
  92. package/dist/chunk-H6JGSSAJ.js.map +0 -1
  93. package/dist/chunk-IKQHGGUZ.js +0 -421
  94. package/dist/chunk-IKQHGGUZ.js.map +0 -1
  95. package/dist/chunk-IUKE3XDN.js +0 -421
  96. package/dist/chunk-IUKE3XDN.js.map +0 -1
  97. package/dist/chunk-J26MLMLN.js +0 -421
  98. package/dist/chunk-J26MLMLN.js.map +0 -1
  99. package/dist/chunk-J7BMB3ZW.js +0 -421
  100. package/dist/chunk-J7BMB3ZW.js.map +0 -1
  101. package/dist/chunk-JCBQRD5N.js +0 -421
  102. package/dist/chunk-JCBQRD5N.js.map +0 -1
  103. package/dist/chunk-JOB6YWEF.js +0 -421
  104. package/dist/chunk-JOB6YWEF.js.map +0 -1
  105. package/dist/chunk-JZRABTHU.js +0 -519
  106. package/dist/chunk-JZRABTHU.js.map +0 -1
  107. package/dist/chunk-K3GFQUMC.js +0 -421
  108. package/dist/chunk-K3GFQUMC.js.map +0 -1
  109. package/dist/chunk-LWYMRXBF.js +0 -421
  110. package/dist/chunk-LWYMRXBF.js.map +0 -1
  111. package/dist/chunk-M2R2NDPR.js +0 -421
  112. package/dist/chunk-M2R2NDPR.js.map +0 -1
  113. package/dist/chunk-MA3P7WCA.js +0 -421
  114. package/dist/chunk-MA3P7WCA.js.map +0 -1
  115. package/dist/chunk-MDMRCS4W.mjs +0 -421
  116. package/dist/chunk-MDMRCS4W.mjs.map +0 -1
  117. package/dist/chunk-MJXTA2R6.js +0 -421
  118. package/dist/chunk-MJXTA2R6.js.map +0 -1
  119. package/dist/chunk-NFVJQNDP.js +0 -421
  120. package/dist/chunk-NFVJQNDP.js.map +0 -1
  121. package/dist/chunk-O5TLYMQP.js +0 -421
  122. package/dist/chunk-O5TLYMQP.js.map +0 -1
  123. package/dist/chunk-OECAPVSX.js +0 -439
  124. package/dist/chunk-OECAPVSX.js.map +0 -1
  125. package/dist/chunk-OL5QDJ42.js +0 -483
  126. package/dist/chunk-OL5QDJ42.js.map +0 -1
  127. package/dist/chunk-PMOVVTHO.js +0 -519
  128. package/dist/chunk-PMOVVTHO.js.map +0 -1
  129. package/dist/chunk-QCHDPR2D.js +0 -421
  130. package/dist/chunk-QCHDPR2D.js.map +0 -1
  131. package/dist/chunk-R5MTVABN.js +0 -439
  132. package/dist/chunk-R5MTVABN.js.map +0 -1
  133. package/dist/chunk-RJ4H4YVA.js +0 -519
  134. package/dist/chunk-RJ4H4YVA.js.map +0 -1
  135. package/dist/chunk-S5U4IWCR.js +0 -439
  136. package/dist/chunk-S5U4IWCR.js.map +0 -1
  137. package/dist/chunk-SCKIOGKI.js +0 -421
  138. package/dist/chunk-SCKIOGKI.js.map +0 -1
  139. package/dist/chunk-TGJSIJYP.js +0 -421
  140. package/dist/chunk-TGJSIJYP.js.map +0 -1
  141. package/dist/chunk-TQZRBMU7.js +0 -421
  142. package/dist/chunk-TQZRBMU7.js.map +0 -1
  143. package/dist/chunk-TRL4RSEO.js +0 -421
  144. package/dist/chunk-TRL4RSEO.js.map +0 -1
  145. package/dist/chunk-TWUMRHQ7.js +0 -421
  146. package/dist/chunk-TWUMRHQ7.js.map +0 -1
  147. package/dist/chunk-UCJE36LL.js +0 -519
  148. package/dist/chunk-UCJE36LL.js.map +0 -1
  149. package/dist/chunk-VCASA6KL.js +0 -421
  150. package/dist/chunk-VCASA6KL.js.map +0 -1
  151. package/dist/chunk-VWPQ6ORV.js +0 -421
  152. package/dist/chunk-VWPQ6ORV.js.map +0 -1
  153. package/dist/chunk-WPXKIHLT.js +0 -421
  154. package/dist/chunk-WPXKIHLT.js.map +0 -1
  155. package/dist/chunk-WUNFFJ32.js +0 -421
  156. package/dist/chunk-WUNFFJ32.js.map +0 -1
  157. package/dist/chunk-WW7TRC7S.js +0 -519
  158. package/dist/chunk-WW7TRC7S.js.map +0 -1
  159. package/dist/chunk-XVSMRXBJ.js +0 -421
  160. package/dist/chunk-XVSMRXBJ.js.map +0 -1
  161. package/dist/chunk-YPPXXV3I.js +0 -421
  162. package/dist/chunk-YPPXXV3I.js.map +0 -1
  163. package/dist/chunk-ZKZVV4OQ.js +0 -421
  164. package/dist/chunk-ZKZVV4OQ.js.map +0 -1
  165. package/dist/chunk-ZOFEX73I.js +0 -421
  166. package/dist/chunk-ZOFEX73I.js.map +0 -1
  167. package/dist/content.mjs +0 -17
  168. package/dist/content.mjs.map +0 -1
  169. package/dist/index.mjs +0 -11
  170. package/dist/index.mjs.map +0 -1
  171. package/dist/search.mjs +0 -30
  172. package/dist/search.mjs.map +0 -1
  173. package/dist/types-BltYGlWI.d.ts +0 -36
@@ -0,0 +1,294 @@
1
+ ---
2
+ title: Provider Options
3
+ description: Configuring provider-specific tools and features.
4
+ ---
5
+
6
+ # Provider Options
7
+
8
+ Provider options let you enable provider-specific features like Anthropic's built-in tools and skills. These features run server-side on the provider's infrastructure.
9
+
10
+ > **Note**: For provider-agnostic code execution, use [Octavus Skills](/docs/protocol/skills) instead. Octavus Skills work with any LLM provider and run in isolated sandbox environments.
11
+
12
+ ## Anthropic Options
13
+
14
+ Configure Anthropic-specific features when using `anthropic/*` models:
15
+
16
+ ```yaml
17
+ agent:
18
+ model: anthropic/claude-sonnet-4-5
19
+ system: system
20
+ anthropic:
21
+ # Provider tools (server-side)
22
+ tools:
23
+ web-search:
24
+ display: description
25
+ description: Searching the web
26
+ code-execution:
27
+ display: description
28
+ description: Running code
29
+
30
+ # Skills (knowledge packages)
31
+ skills:
32
+ pdf:
33
+ type: anthropic
34
+ display: description
35
+ description: Processing PDF document
36
+ ```
37
+
38
+ > **Note**: Provider options are validated against the model provider. Using `anthropic:` options with non-Anthropic models will result in a validation error.
39
+
40
+ ## Provider Tools
41
+
42
+ Provider tools are executed server-side by the provider (Anthropic). Unlike external tools that you implement, provider tools are built-in capabilities.
43
+
44
+ ### Available Tools
45
+
46
+ | Tool | Description |
47
+ | ---------------- | -------------------------------------------- |
48
+ | `web-search` | Search the web for current information |
49
+ | `code-execution` | Execute Python/Bash in a sandboxed container |
50
+
51
+ ### Tool Configuration
52
+
53
+ ```yaml
54
+ anthropic:
55
+ tools:
56
+ web-search:
57
+ display: description # How to show in UI
58
+ description: Searching... # Custom display text
59
+ ```
60
+
61
+ | Field | Required | Description |
62
+ | ------------- | -------- | --------------------------------------------------------------------- |
63
+ | `display` | No | `hidden`, `name`, `description`, or `stream` (default: `description`) |
64
+ | `description` | No | Custom text shown to users during execution |
65
+
66
+ ### Web Search
67
+
68
+ Allows the agent to search the web for current information:
69
+
70
+ ```yaml
71
+ agent:
72
+ model: anthropic/claude-sonnet-4-5
73
+ anthropic:
74
+ tools:
75
+ web-search:
76
+ display: description
77
+ description: Looking up current information
78
+ ```
79
+
80
+ Use cases:
81
+
82
+ - Current events and news
83
+ - Real-time data (prices, weather)
84
+ - Fact verification
85
+ - Documentation lookups
86
+
87
+ ### Code Execution
88
+
89
+ Enables Python and Bash execution in a sandboxed container:
90
+
91
+ ```yaml
92
+ agent:
93
+ model: anthropic/claude-sonnet-4-5
94
+ anthropic:
95
+ tools:
96
+ code-execution:
97
+ display: description
98
+ description: Running analysis
99
+ ```
100
+
101
+ Use cases:
102
+
103
+ - Data analysis and calculations
104
+ - File processing
105
+ - Chart generation
106
+ - Script execution
107
+
108
+ > **Note**: Code execution is automatically enabled when skills are configured (skills require the container environment).
109
+
110
+ ## Skills
111
+
112
+ > **Important**: This section covers **Anthropic's built-in skills** (provider-specific). For provider-agnostic skills that work with any LLM, see [Octavus Skills](/docs/protocol/skills).
113
+
114
+ Anthropic skills are knowledge packages that give the agent specialized capabilities. They're loaded into Anthropic's code execution container at `/skills/{skill-id}/` and only work with Anthropic models.
115
+
116
+ ### Skill Configuration
117
+
118
+ ```yaml
119
+ anthropic:
120
+ skills:
121
+ pdf:
122
+ type: anthropic # 'anthropic' or 'custom'
123
+ version: latest # Optional version
124
+ display: description
125
+ description: Processing PDF
126
+ ```
127
+
128
+ | Field | Required | Description |
129
+ | ------------- | -------- | --------------------------------------------------------------------- |
130
+ | `type` | Yes | `anthropic` (built-in) or `custom` (uploaded) |
131
+ | `version` | No | Skill version (default: `latest`) |
132
+ | `display` | No | `hidden`, `name`, `description`, or `stream` (default: `description`) |
133
+ | `description` | No | Custom text shown to users |
134
+
135
+ ### Built-in Skills
136
+
137
+ Anthropic provides several built-in skills:
138
+
139
+ | Skill ID | Purpose |
140
+ | -------- | ----------------------------------------------- |
141
+ | `pdf` | PDF manipulation, text extraction, form filling |
142
+ | `xlsx` | Excel spreadsheet operations and analysis |
143
+ | `docx` | Word document creation and editing |
144
+ | `pptx` | PowerPoint presentation creation |
145
+
146
+ ### Using Skills
147
+
148
+ ```yaml
149
+ agent:
150
+ model: anthropic/claude-sonnet-4-5
151
+ system: system
152
+ anthropic:
153
+ skills:
154
+ pdf:
155
+ type: anthropic
156
+ description: Processing your PDF
157
+ xlsx:
158
+ type: anthropic
159
+ description: Analyzing spreadsheet
160
+ ```
161
+
162
+ When skills are configured:
163
+
164
+ 1. Code execution is automatically enabled
165
+ 2. Skill files are loaded into the container
166
+ 3. The agent can read skill instructions and execute scripts
167
+
168
+ ### Custom Skills
169
+
170
+ You can create and upload custom skills to Anthropic:
171
+
172
+ ```yaml
173
+ anthropic:
174
+ skills:
175
+ custom-analysis:
176
+ type: custom
177
+ version: latest
178
+ description: Running custom analysis
179
+ ```
180
+
181
+ Custom skills follow the [Agent Skills standard](https://agentskills.io) and contain:
182
+
183
+ - `SKILL.md` with instructions and metadata
184
+ - Optional `scripts/`, `references/`, and `assets/` directories
185
+
186
+ ### Octavus Skills vs Anthropic Skills
187
+
188
+ | Feature | Anthropic Skills | Octavus Skills |
189
+ | ----------------- | ------------------------ | ----------------------------- |
190
+ | **Provider** | Anthropic only | Any (agnostic) |
191
+ | **Execution** | Anthropic's container | Isolated sandbox |
192
+ | **Configuration** | `agent.anthropic.skills` | `agent.skills` |
193
+ | **Definition** | `anthropic:` section | `skills:` section |
194
+ | **Use Case** | Claude-specific features | Cross-provider code execution |
195
+
196
+ For provider-agnostic code execution, use Octavus Skills defined in the protocol's `skills:` section and enabled via `agent.skills`. See [Skills](/docs/protocol/skills) for details.
197
+
198
+ ## Display Modes
199
+
200
+ Both tools and skills support display modes:
201
+
202
+ | Mode | Behavior |
203
+ | ------------- | ------------------------------- |
204
+ | `hidden` | Not shown to users |
205
+ | `name` | Shows the tool/skill name |
206
+ | `description` | Shows the description (default) |
207
+ | `stream` | Streams progress if available |
208
+
209
+ ## Full Example
210
+
211
+ ```yaml
212
+ input:
213
+ COMPANY_NAME: { type: string }
214
+ USER_ID: { type: string, optional: true }
215
+
216
+ tools:
217
+ get-user-account:
218
+ description: Looking up your account
219
+ parameters:
220
+ userId: { type: string }
221
+
222
+ agent:
223
+ model: anthropic/claude-sonnet-4-5
224
+ system: system
225
+ input: [COMPANY_NAME, USER_ID]
226
+ tools: [get-user-account] # External tools
227
+ agentic: true
228
+ thinking: medium
229
+
230
+ # Anthropic-specific options
231
+ anthropic:
232
+ # Provider tools (server-side)
233
+ tools:
234
+ web-search:
235
+ display: description
236
+ description: Searching the web
237
+ code-execution:
238
+ display: description
239
+ description: Running code
240
+
241
+ # Skills (knowledge packages)
242
+ skills:
243
+ pdf:
244
+ type: anthropic
245
+ display: description
246
+ description: Processing PDF document
247
+ xlsx:
248
+ type: anthropic
249
+ display: description
250
+ description: Analyzing spreadsheet
251
+
252
+ triggers:
253
+ user-message:
254
+ input:
255
+ USER_MESSAGE: { type: string }
256
+
257
+ handlers:
258
+ user-message:
259
+ Add message:
260
+ block: add-message
261
+ role: user
262
+ prompt: user-message
263
+ input: [USER_MESSAGE]
264
+ display: hidden
265
+
266
+ Respond:
267
+ block: next-message
268
+ ```
269
+
270
+ ## Validation
271
+
272
+ The protocol validator enforces:
273
+
274
+ 1. **Model match**: Provider options must match the model provider
275
+ - `anthropic:` options require `anthropic/*` model
276
+ - Using mismatched options results in a validation error
277
+
278
+ 2. **Valid tool types**: Only recognized tools are accepted
279
+ - `web-search` and `code-execution` for Anthropic
280
+
281
+ 3. **Valid skill types**: Only `anthropic` or `custom` are accepted
282
+
283
+ ### Error Example
284
+
285
+ ```yaml
286
+ # This will fail validation
287
+ agent:
288
+ model: openai/gpt-4o # OpenAI model
289
+ anthropic: # Anthropic options - mismatch!
290
+ tools:
291
+ web-search: {}
292
+ ```
293
+
294
+ Error: `"anthropic" options require an anthropic model. Current model provider: "openai"`
@@ -0,0 +1,439 @@
1
+ ---
2
+ title: Skills Advanced Guide
3
+ description: Best practices and advanced patterns for using Octavus skills.
4
+ ---
5
+
6
+ # Skills Advanced Guide
7
+
8
+ This guide covers advanced patterns and best practices for using Octavus skills in your agents.
9
+
10
+ ## When to Use Skills
11
+
12
+ Skills are ideal for:
13
+
14
+ - **Code execution** - Running Python/Bash scripts
15
+ - **File generation** - Creating images, PDFs, reports
16
+ - **Data processing** - Analyzing, transforming, or visualizing data
17
+ - **Provider-agnostic needs** - Features that should work with any LLM
18
+
19
+ Use external tools instead when:
20
+
21
+ - **Simple API calls** - Database queries, external services
22
+ - **Authentication required** - Accessing user-specific resources
23
+ - **Backend integration** - Tight coupling with your infrastructure
24
+
25
+ ## Skill Selection Strategy
26
+
27
+ ### Defining Available Skills
28
+
29
+ Define all skills available to this agent in the `skills:` section. Then specify which skills are available for the chat thread in `agent.skills`:
30
+
31
+ ```yaml
32
+ # All skills available to this agent (defined once at protocol level)
33
+ skills:
34
+ qr-code:
35
+ display: description
36
+ description: Generating QR codes
37
+ pdf-processor:
38
+ display: description
39
+ description: Processing PDFs
40
+ data-analysis:
41
+ display: description
42
+ description: Analyzing data
43
+
44
+ # Skills available for this chat thread
45
+ agent:
46
+ model: anthropic/claude-sonnet-4-5
47
+ system: system
48
+ skills: [qr-code] # Skills available for this thread
49
+ ```
50
+
51
+ ### Match Skills to Use Cases
52
+
53
+ Define all skills available to this agent in the `skills:` section. Then specify which skills are available for the chat thread based on use case:
54
+
55
+ ```yaml
56
+ # All skills available to this agent (defined once at protocol level)
57
+ skills:
58
+ qr-code:
59
+ display: description
60
+ description: Generating QR codes
61
+ data-analysis:
62
+ display: description
63
+ description: Analyzing data and generating reports
64
+ visualization:
65
+ display: description
66
+ description: Creating charts and visualizations
67
+
68
+ # Skills available for this chat thread (support use case)
69
+ agent:
70
+ model: anthropic/claude-sonnet-4-5
71
+ system: system
72
+ skills: [qr-code] # Skills available for this thread
73
+ ```
74
+
75
+ For a data analysis thread, you would specify `[data-analysis, visualization]` in `agent.skills`, but still define all available skills in the `skills:` section above.
76
+
77
+ ## Display Mode Strategy
78
+
79
+ Choose display modes based on user experience:
80
+
81
+ ```yaml
82
+ skills:
83
+ # Background processing - hide from user
84
+ data-analysis:
85
+ display: hidden
86
+
87
+ # User-facing generation - show description
88
+ qr-code:
89
+ display: description
90
+
91
+ # Interactive progress - stream updates
92
+ report-generation:
93
+ display: stream
94
+ ```
95
+
96
+ ### Guidelines
97
+
98
+ - **`hidden`**: Background work that doesn't need user awareness
99
+ - **`description`**: User-facing operations (default)
100
+ - **`name`**: Quick operations where name is sufficient
101
+ - **`stream`**: Long-running operations where progress matters
102
+
103
+ ## System Prompt Integration
104
+
105
+ Skills are automatically injected into the system prompt. The LLM learns:
106
+
107
+ 1. **Available skills** - List of enabled skills with descriptions
108
+ 2. **How to use skills** - Instructions for using skill tools
109
+ 3. **Tool reference** - Available skill tools (`octavus_skill_read`, `octavus_code_run`, etc.)
110
+
111
+ You don't need to manually document skills in your system prompt. However, you can guide the LLM:
112
+
113
+ ```markdown
114
+ <!-- prompts/system.md -->
115
+
116
+ You are a helpful assistant that can generate QR codes.
117
+
118
+ ## When to Generate QR Codes
119
+
120
+ Generate QR codes when users want to:
121
+
122
+ - Share URLs easily
123
+ - Provide contact information
124
+ - Share WiFi credentials
125
+ - Create scannable data
126
+
127
+ Use the qr-code skill for all QR code generation tasks.
128
+ ```
129
+
130
+ ## Error Handling
131
+
132
+ Skills handle errors gracefully:
133
+
134
+ ```yaml
135
+ # Skill execution errors are returned to the LLM
136
+ # The LLM can retry or explain the error to the user
137
+ ```
138
+
139
+ Common error scenarios:
140
+
141
+ 1. **Invalid skill slug** - Skill not found in organization
142
+ 2. **Code execution errors** - Syntax errors, runtime exceptions
143
+ 3. **Missing dependencies** - Required packages not installed
144
+ 4. **File I/O errors** - Permission issues, invalid paths
145
+
146
+ The LLM receives error messages and can:
147
+
148
+ - Retry with corrected code
149
+ - Explain errors to users
150
+ - Suggest alternatives
151
+
152
+ ## File Output Patterns
153
+
154
+ ### Single File Output
155
+
156
+ ```python
157
+ # Save single file to /output/
158
+ import qrcode
159
+ import os
160
+
161
+ output_dir = os.environ.get('OUTPUT_DIR', '/output')
162
+ qr = qrcode.QRCode()
163
+ qr.add_data('https://example.com')
164
+ img = qr.make_image()
165
+ img.save(f'{output_dir}/qrcode.png')
166
+ ```
167
+
168
+ ### Multiple Files
169
+
170
+ ```python
171
+ # Save multiple files
172
+ import os
173
+
174
+ output_dir = os.environ.get('OUTPUT_DIR', '/output')
175
+
176
+ # Generate multiple outputs
177
+ for i in range(3):
178
+ filename = f'{output_dir}/output_{i}.png'
179
+ # ... generate file ...
180
+ ```
181
+
182
+ ### Structured Output
183
+
184
+ ```python
185
+ # Save structured data + files
186
+ import json
187
+ import os
188
+
189
+ output_dir = os.environ.get('OUTPUT_DIR', '/output')
190
+
191
+ # Save metadata
192
+ metadata = {
193
+ 'files': ['chart.png', 'data.csv'],
194
+ 'summary': 'Analysis complete'
195
+ }
196
+ with open(f'{output_dir}/metadata.json', 'w') as f:
197
+ json.dump(metadata, f)
198
+
199
+ # Save actual files
200
+ # ... generate chart.png and data.csv ...
201
+ ```
202
+
203
+ ## Performance Considerations
204
+
205
+ ### Lazy Initialization
206
+
207
+ Sandboxes are created only when a skill tool is first called:
208
+
209
+ ```yaml
210
+ # Sandbox not created until LLM calls a skill tool
211
+ agent:
212
+ skills: [qr-code] # Sandbox created on first use
213
+ ```
214
+
215
+ This means:
216
+
217
+ - No cost if skills aren't used
218
+ - Fast startup (no sandbox creation delay)
219
+ - Sandbox reused for all skill calls in a trigger
220
+
221
+ ### Timeout Limits
222
+
223
+ Sandboxes have a 5-minute default timeout:
224
+
225
+ - **Short operations**: QR codes, simple calculations
226
+ - **Medium operations**: Data analysis, report generation
227
+ - **Long operations**: May need to split into multiple steps
228
+
229
+ ### Sandbox Lifecycle
230
+
231
+ Each trigger execution gets a fresh sandbox:
232
+
233
+ - **Clean state** - No leftover files from previous executions
234
+ - **Isolated** - No interference between sessions
235
+ - **Destroyed** - Sandbox cleaned up after trigger completes
236
+
237
+ ## Combining Skills with Tools
238
+
239
+ Skills and tools can work together:
240
+
241
+ ```yaml
242
+ tools:
243
+ get-user-data:
244
+ description: Fetch user data from database
245
+ parameters:
246
+ userId: { type: string }
247
+
248
+ skills:
249
+ data-analysis:
250
+ display: description
251
+ description: Analyzing data
252
+
253
+ agent:
254
+ tools: [get-user-data]
255
+ skills: [data-analysis]
256
+ agentic: true
257
+
258
+ handlers:
259
+ analyze-user:
260
+ Get user data:
261
+ block: tool-call
262
+ tool: get-user-data
263
+ input:
264
+ userId: USER_ID
265
+ output: USER_DATA
266
+
267
+ Analyze:
268
+ block: next-message
269
+ # LLM can use data-analysis skill with USER_DATA
270
+ ```
271
+
272
+ Pattern:
273
+
274
+ 1. Fetch data via tool (from your backend)
275
+ 2. LLM uses skill to analyze/process the data
276
+ 3. Generate outputs (files, reports)
277
+
278
+ ## Skill Development Tips
279
+
280
+ ### Writing SKILL.md
281
+
282
+ Focus on **when** and **how** to use the skill:
283
+
284
+ ```markdown
285
+ ---
286
+ name: qr-code
287
+ description: >
288
+ Generate QR codes from text, URLs, or data. Use when the user needs to create
289
+ a QR code for any purpose - sharing links, contact information, WiFi credentials,
290
+ or any text data that should be scannable.
291
+ ---
292
+
293
+ # QR Code Generator
294
+
295
+ ## When to Use
296
+
297
+ Use this skill when users want to:
298
+
299
+ - Share URLs easily
300
+ - Provide contact information
301
+ - Create scannable data
302
+
303
+ ## Quick Start
304
+
305
+ [Clear examples of how to use the skill]
306
+ ```
307
+
308
+ ### Script Organization
309
+
310
+ Organize scripts logically:
311
+
312
+ ```
313
+ skill-name/
314
+ ├── SKILL.md
315
+ └── scripts/
316
+ ├── generate.py # Main script
317
+ ├── utils.py # Helper functions
318
+ └── requirements.txt # Dependencies
319
+ ```
320
+
321
+ ### Error Messages
322
+
323
+ Provide helpful error messages:
324
+
325
+ ```python
326
+ try:
327
+ # ... code ...
328
+ except ValueError as e:
329
+ print(f"Error: Invalid input - {e}")
330
+ sys.exit(1)
331
+ ```
332
+
333
+ The LLM sees these errors and can retry or explain to users.
334
+
335
+ ## Security Considerations
336
+
337
+ ### Sandbox Isolation
338
+
339
+ - **No network access** (unless explicitly configured)
340
+ - **No persistent storage** (sandbox destroyed after execution)
341
+ - **File output only** via `/output/` directory
342
+ - **Time limits** enforced (5-minute default)
343
+
344
+ ### Input Validation
345
+
346
+ Skills should validate inputs:
347
+
348
+ ```python
349
+ import sys
350
+
351
+ if not data:
352
+ print("Error: Data is required")
353
+ sys.exit(1)
354
+
355
+ if len(data) > 1000:
356
+ print("Error: Data too long (max 1000 characters)")
357
+ sys.exit(1)
358
+ ```
359
+
360
+ ### Resource Limits
361
+
362
+ Be aware of:
363
+
364
+ - **File size limits** - Large files may fail to upload
365
+ - **Execution time** - 5-minute sandbox timeout
366
+ - **Memory limits** - Sandbox environment constraints
367
+
368
+ ## Debugging Skills
369
+
370
+ ### Check Skill Documentation
371
+
372
+ The LLM can read skill docs:
373
+
374
+ ```python
375
+ # LLM calls octavus_skill_read to see skill instructions
376
+ ```
377
+
378
+ ### Test Locally
379
+
380
+ Test skills before uploading:
381
+
382
+ ```bash
383
+ # Test skill locally
384
+ python scripts/generate.py --data "test"
385
+ ```
386
+
387
+ ### Monitor Execution
388
+
389
+ Check execution logs in the platform debug view:
390
+
391
+ - Tool calls and arguments
392
+ - Code execution results
393
+ - File outputs
394
+ - Error messages
395
+
396
+ ## Common Patterns
397
+
398
+ ### Pattern 1: Generate and Return
399
+
400
+ ```yaml
401
+ # User asks for QR code
402
+ # LLM generates QR code
403
+ # File automatically available for download
404
+ ```
405
+
406
+ ### Pattern 2: Analyze and Report
407
+
408
+ ```yaml
409
+ # User provides data
410
+ # LLM analyzes with skill
411
+ # Generates report file
412
+ # Returns summary + file link
413
+ ```
414
+
415
+ ### Pattern 3: Transform and Save
416
+
417
+ ```yaml
418
+ # User uploads file (via tool)
419
+ # LLM processes with skill
420
+ # Generates transformed file
421
+ # Returns new file link
422
+ ```
423
+
424
+ ## Best Practices Summary
425
+
426
+ 1. **Enable only needed skills** - Don't overwhelm the LLM
427
+ 2. **Choose appropriate display modes** - Match user experience needs
428
+ 3. **Write clear skill descriptions** - Help LLM understand when to use
429
+ 4. **Handle errors gracefully** - Provide helpful error messages
430
+ 5. **Test skills locally** - Verify before uploading
431
+ 6. **Monitor execution** - Check logs for issues
432
+ 7. **Combine with tools** - Use tools for data, skills for processing
433
+ 8. **Consider performance** - Be aware of timeouts and limits
434
+
435
+ ## Next Steps
436
+
437
+ - [Skills](/docs/protocol/skills) - Basic skills documentation
438
+ - [Agent Config](/docs/protocol/agent-config) - Configuring skills
439
+ - [Tools](/docs/protocol/tools) - External tools integration