@botpress/adk-cli 1.19.0-beta.4 → 1.19.0-beta.6

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 (87) hide show
  1. package/{dist/index-a3ZL0_Jr-q145h35p.js → assets/ui-dist/assets/index-BC_iUF2d.js} +2 -2
  2. package/assets/ui-dist/assets/index-BxpvDT_K.css +1 -0
  3. package/{dist/index-BESZeTO5-2rpmcefa.js → assets/ui-dist/assets/index-C7gAokRv.js} +2 -2
  4. package/assets/ui-dist/assets/{index-B3b7PPgV.js → index-exyr_Djl.js} +424 -424
  5. package/assets/ui-dist/assets/jetbrains-mono-cyrillic-wght-normal-D73BlboJ.woff2 +0 -0
  6. package/assets/ui-dist/assets/jetbrains-mono-greek-wght-normal-Bw9x6K1M.woff2 +0 -0
  7. package/assets/ui-dist/assets/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a.woff2 +0 -0
  8. package/assets/ui-dist/assets/jetbrains-mono-latin-wght-normal-B9CIFXIH.woff2 +0 -0
  9. package/assets/ui-dist/assets/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq.woff2 +0 -0
  10. package/assets/ui-dist/index.html +2 -2
  11. package/dist/{README-wjb7z7f0.md → README-824wa4jj.md} +1 -1
  12. package/dist/SKILL-75ym6tcj.md +257 -0
  13. package/dist/SKILL-chnwzmt1.md +548 -0
  14. package/dist/SKILL-d4bs53y3.md +244 -0
  15. package/dist/SKILL-h4b2f1n9.md +114 -0
  16. package/dist/SKILL-hbw5nt95.md +111 -0
  17. package/dist/actions-h7hxxvxr.md +823 -0
  18. package/dist/adk-build-emhwd0tg.md +39 -0
  19. package/dist/adk-debug-yrrdtpmb.md +23 -0
  20. package/dist/adk-dev-console-7z9rtjpy.md +17 -0
  21. package/dist/adk-document-ras6zzzh.md +68 -0
  22. package/dist/adk-eval-vx76dwq0.md +17 -0
  23. package/dist/adk-explain-fcsaw852.md +22 -0
  24. package/dist/adk-init-9kmxmbbe.md +30 -0
  25. package/dist/adk-ship-dybzn884.md +29 -0
  26. package/dist/adk-test-xq67savs.md +27 -0
  27. package/dist/adk-validate-1p4skv4m.md +31 -0
  28. package/dist/advanced-patterns-z86m9h1a.md +669 -0
  29. package/dist/agent-config-1aqvkrgf.md +450 -0
  30. package/dist/agent-steps-zj4c1n9t.md +115 -0
  31. package/dist/assets-q7jt8r2q.md +237 -0
  32. package/dist/autonomous-execution-fymc12e5.md +747 -0
  33. package/dist/cli-c31e06yr.md +1334 -0
  34. package/dist/cli.js +4241 -6449
  35. package/dist/commands.json +25 -4
  36. package/dist/common-failures-ht29w2db.md +231 -0
  37. package/dist/component-registry-bbpw0see.md +43 -0
  38. package/dist/context-api-760cvh0h.md +461 -0
  39. package/dist/conversation-analysis-8ka4nrm4.md +420 -0
  40. package/dist/conversation-lifecycle-4seqqjc1.md +311 -0
  41. package/dist/conversations-gwfvxaee.md +1111 -0
  42. package/dist/custom-components-y5wdgpey.md +167 -0
  43. package/dist/debug-workflow-vz84q80v.md +239 -0
  44. package/dist/desk-k54ktvsd.md +852 -0
  45. package/dist/doc-standards-ck6ax2jd.md +124 -0
  46. package/dist/eval-format-7n9brja4.md +354 -0
  47. package/dist/evals-y1zcr1mc.md +11 -0
  48. package/dist/explain-config-1yaq3zzd.md +424 -0
  49. package/dist/files-dzt0wxn3.md +918 -0
  50. package/dist/{index-3t354nbw.html → index-0qts7wfk.html} +2 -2
  51. package/{assets/ui-dist/assets/index-a3ZL0_Jr.js → dist/index-BC_iUF2d-3h9mqazs.js} +2 -2
  52. package/dist/index-BxpvDT_K-62864175.css +1 -0
  53. package/{assets/ui-dist/assets/index-BESZeTO5.js → dist/index-C7gAokRv-zr7dzkba.js} +2 -2
  54. package/dist/{index-B3b7PPgV-zetkb01w.js → index-exyr_Djl-ksys08wc.js} +424 -424
  55. package/dist/integration-actions-xang7tma.md +659 -0
  56. package/dist/integrations-k5ss07f4.md +266 -0
  57. package/dist/interfaces-6t0bpxs4.md +97 -0
  58. package/dist/jetbrains-mono-cyrillic-wght-normal-D73BlboJ-6vpq1jfh.woff2 +0 -0
  59. package/dist/jetbrains-mono-greek-wght-normal-Bw9x6K1M-jv5dqe09.woff2 +0 -0
  60. package/dist/jetbrains-mono-latin-ext-wght-normal-DBQx-q_a-h2ysfc3f.woff2 +0 -0
  61. package/dist/jetbrains-mono-latin-wght-normal-B9CIFXIH-hj2e42wt.woff2 +0 -0
  62. package/dist/jetbrains-mono-vietnamese-wght-normal-Bt-aOZkq-wttk1pwp.woff2 +0 -0
  63. package/dist/knowledge-bases-20rg8p5c.md +456 -0
  64. package/dist/llm-debugging-76ng8rzm.md +209 -0
  65. package/dist/mcp-server-n1asyzhv.md +112 -0
  66. package/dist/messages-gkkg0b54.md +769 -0
  67. package/dist/model-configuration-f273kgd0.md +201 -0
  68. package/dist/multi-agent-dashboard-1mdfjdts.md +70 -0
  69. package/dist/pages-xn18xn73.md +273 -0
  70. package/dist/patterns-mistakes-5vb99dhf.md +469 -0
  71. package/dist/plugins-ttnx8f49.md +280 -0
  72. package/dist/tables-x45t36dd.md +1136 -0
  73. package/dist/tags-46td3qrg.md +516 -0
  74. package/dist/test-patterns-hj47w4nc.md +355 -0
  75. package/dist/testing-workflow-2vkp932f.md +225 -0
  76. package/dist/tools-wk7bq24z.md +581 -0
  77. package/dist/trace-summarization-hdyx1c2e.md +313 -0
  78. package/dist/traces-and-logs-f2kjfh19.md +203 -0
  79. package/dist/triggers-4j2cc86x.md +719 -0
  80. package/dist/ui-server-entry.js +1839 -791
  81. package/dist/workflow-steps-mrdrf1c5.md +851 -0
  82. package/dist/workflows-gadx3s69.md +1408 -0
  83. package/dist/zai-agent-reference-e6644aad.md +454 -0
  84. package/dist/zai-complete-guide-mnna5d6f.md +1408 -0
  85. package/package.json +4 -4
  86. package/assets/ui-dist/assets/index-DIFGtVmI.css +0 -1
  87. package/dist/index-DIFGtVmI-d4dhjg97.css +0 -1
@@ -0,0 +1,548 @@
1
+ ---
2
+ name: adk
3
+ description: a set of guidelines to build with Botpress's Agent Development Kit (ADK) - use these whenever you're tasked with building a feature using the ADK
4
+ license: MIT
5
+ ---
6
+
7
+ # Botpress ADK Guidelines
8
+
9
+ Use this skill when you've got questions about the Botpress Agent Development Kit (ADK) - like when you're building a feature that involves tables, actions, tools, workflows, conversations, files, knowledge bases, triggers, assets, integrations, plugins, evals, or Zai.
10
+
11
+ ## What is the ADK?
12
+
13
+ The Botpress ADK is a **convention-based TypeScript framework** where **file structure maps directly to bot behavior**. Place files in the correct directories, and they automatically become available as bot capabilities.
14
+
15
+ The ADK provides primitives for:
16
+
17
+ - Actions & Tools (reusable functions and AI-callable tools)
18
+ - Workflows (long-running, resumable processes)
19
+ - Conversations (message handling)
20
+ - Tables (data storage with semantic search)
21
+ - Files (file storage with semantic search)
22
+ - Knowledge Bases (RAG implementation)
23
+ - Triggers (event-driven automation)
24
+ - Assets (static files with permanent URLs)
25
+ - Integrations (external service connections managed via CLI and lock files)
26
+ - Plugins (reusable agent extensions with interface dependencies)
27
+ - **Zai** (production-ready LLM utility library for common AI operations)
28
+
29
+ ### Project Structure (Convention-Based)
30
+
31
+ Most primitives must be placed in `src/` directory (assets use the `assets/` directory at the project root):
32
+
33
+ ```
34
+ / # Project root
35
+ ├── assets/ # Static files → synced to Botpress Cloud with permanent URLs
36
+ ├── src/
37
+ │ ├── actions/ # Strongly-typed functions → auto-registered
38
+ │ ├── tools/ # AI-callable tools → available via execute()
39
+ │ ├── workflows/ # Long-running processes → resumable/scheduled
40
+ │ ├── conversations/ # Message handlers → routes by channel
41
+ │ ├── tables/ # Database schemas → auto-created with search
42
+ │ ├── triggers/ # Event handlers → subscribe to events
43
+ │ ├── knowledge/ # Knowledge bases → RAG with semantic search
44
+ │ └── utils/ # Shared helpers (not auto-registered)
45
+ ├── dependencies.dev.lock.json # Integration/plugin state (dev)
46
+ ├── dependencies.prod.lock.json # Integration/plugin state (prod)
47
+ └── agent.config.ts # Bot configuration
48
+ ```
49
+
50
+ > **Note:** Integrations and plugins are managed via lock files and the `adk integrations` / `adk plugins` CLI. See `integrations.md` and `plugins.md`.
51
+
52
+ > **Critical:** Files outside `src/` are not discovered. Location = behavior.
53
+
54
+ ## Session Start
55
+
56
+ The first time you help with an ADK project in a session, silently check the project's health:
57
+
58
+ 1. Run `adk check --format json` and `adk status --format json`.
59
+ 2. If there are errors or warnings (unconfigured integrations, missing models, validation issues), proactively mention them before answering the user's question: *"Before we start — I noticed [issue]. Want me to help fix that?"*
60
+ 3. Only do this once per session. Don't re-run on every question.
61
+
62
+ ## Available Commands
63
+
64
+ If the user asks "what can you help with?", "what commands are available?", or invokes `/adk-explain` without arguments, present:
65
+
66
+ - **Build**: `/adk-init` (scaffold project), `/adk-build` (interview & build a primitive), `/adk-integration` (add services), `/adk-frontend` (build UI)
67
+ - **Test & Debug**: `/adk-validate` (check a primitive's schema/types/config), `/adk-test` (invoke a primitive once), `/adk-eval` (write assertion tests), `/adk-debug` (fix issues)
68
+ - **Ship**: `/adk-ship` (pre-flight checks + deploy)
69
+ - **Document**: `/adk-document` (create, review, update, sync, search)
70
+ - **Understand**: `/adk-explain` (explain bot architecture and components), `/adk-dev-console` (navigate the Dev Console)
71
+
72
+ Then ask: *"What are you working on?"*
73
+
74
+ ## When to Use This Skill
75
+
76
+ Activate this skill when users ask ADK-related questions like:
77
+
78
+ - "How do I create an Action/Tool/Workflow/Conversation?"
79
+ - "What is the difference between X and Y?"
80
+ - "Show me an example of..."
81
+ - "How do I configure...?"
82
+ - "What's the CLI command for...?"
83
+ - "How do I use the Context API?"
84
+ - "How do I call integration actions?"
85
+ - "How do I use Zai for [extract/check/label/etc]?"
86
+ - "What are the best practices for...?"
87
+ - "How do I avoid common mistakes?"
88
+ - "How do I handle ticket assignment/escalation?"
89
+ - "Explain my config"
90
+ - "What does my bot do?"
91
+ - "What models am I using?"
92
+ - "What integrations do I have?"
93
+ - "What state does my bot track?"
94
+
95
+ ## Plugin Installation Prompt
96
+
97
+ If you are running inside Claude Code and the `/adk-*` commands (like `/adk-debug`, `/adk-eval`, `/adk-init`) are not available as slash commands, suggest that the user install the Botpress ADK plugin to get the full set of skills and commands:
98
+
99
+ ```
100
+ /plugin marketplace add botpress/skills
101
+ /plugin install adk@botpress-skills
102
+ ```
103
+
104
+ Only suggest this once per session. If the user declines, do not ask again.
105
+
106
+ ## How to Answer ADK Questions
107
+
108
+ ADK questions fall into two categories: **CLI queries** and **documentation lookups**.
109
+
110
+ ### Option 1: Direct CLI Commands (FAST - Use First!)
111
+
112
+ For integration discovery and CLI queries, use the Bash tool to run commands directly:
113
+
114
+ **Integration Discovery:**
115
+
116
+ ```bash
117
+ # Search for integrations
118
+ adk integrations search <query>
119
+
120
+ # List all available integrations
121
+ adk integrations list --available
122
+
123
+ # Get detailed integration info (actions, channels, events)
124
+ adk integrations info <integration-name>
125
+
126
+ # Check installed integrations (must be in ADK project)
127
+ adk integrations list
128
+ ```
129
+
130
+ **Project Info:**
131
+
132
+ ```bash
133
+ # Check CLI version
134
+ adk --version
135
+
136
+ # Show project status
137
+ adk
138
+
139
+ # Get help
140
+ adk --help
141
+ ```
142
+
143
+ **Prefer non-interactive paths when driving ADK workflows:**
144
+
145
+ ```bash
146
+ # Login without browser prompts
147
+ adk login --token "$BOTPRESS_TOKEN"
148
+
149
+ # Scaffold with sensible defaults and skip linking
150
+ adk init my-agent --yes --skip-link
151
+
152
+ # Link directly when IDs are known
153
+ adk link --workspace ws_123 --bot bot_456
154
+
155
+ # More automation-friendly dev mode (NDJSON events, no TUI)
156
+ adk dev --non-interactive
157
+
158
+ # Auto-approve non-destructive deploy-plan changes
159
+ adk deploy --yes
160
+ ```
161
+
162
+ Use these defaults when relevant:
163
+
164
+ - Prefer `adk login --token "$BOTPRESS_TOKEN"` or `adk login --token <token>` over interactive login.
165
+ - Treat bare `BOTPRESS_TOKEN` as a no-TTY convenience, not a guaranteed interactive-terminal shortcut.
166
+ - Prefer `adk init <name> --yes --skip-link` for AI-driven scaffolding, but only after login is already completed.
167
+ - Treat `adk link --workspace ... --bot ...` as scriptable, but not guaranteed safe in every no-TTY environment.
168
+ - Treat `adk dev --non-interactive` as CI-friendly, not fully prompt-free.
169
+ - Treat `adk deploy --yes` as auto-approving non-destructive deploy-plan changes; config validation and destructive storage changes can still block automation.
170
+
171
+ **When to use CLI commands:**
172
+
173
+ - "What integrations are available?"
174
+ - "Search for Slack integration"
175
+ - "Show me details about the Linear integration"
176
+ - "What actions does the Slack integration have?"
177
+ - "What version of ADK am I using?"
178
+ - "How do I add an integration?"
179
+
180
+ **Response pattern:**
181
+
182
+ 1. Use Bash tool to run the appropriate `adk` command
183
+ 2. Parse and present the output to the user
184
+ 3. Optionally suggest next steps (e.g., "Run `adk integrations add slack@3.0.0` to install")
185
+
186
+ ### Option 2: Documentation Questions (For Conceptual Questions)
187
+
188
+ For documentation, patterns, and how-to questions, search and reference the documentation files directly:
189
+
190
+ **When to use documentation:**
191
+
192
+ - "How do I create a workflow?"
193
+ - "What's the difference between Actions and Tools?"
194
+ - "Show me an example of using Zai"
195
+ - "What are best practices for state management?"
196
+ - "How do I fix this error?"
197
+ - "What's the pattern for X?"
198
+
199
+ **How to answer documentation questions:**
200
+
201
+ 1. **Find relevant files** - Use Glob to discover documentation:
202
+
203
+ ```
204
+ pattern: **/references/*.md
205
+ ```
206
+
207
+ 2. **Search for keywords** - Use Grep to find relevant content:
208
+
209
+ ```
210
+ pattern: <keyword from user question>
211
+ path: <path to references directory from step 1>
212
+ output_mode: files_with_matches
213
+ ```
214
+
215
+ 3. **Read the files** - Use Read to load relevant documentation
216
+
217
+ 4. **Provide answer** with:
218
+ - Concise explanation
219
+ - Code examples from the references
220
+ - File references with line numbers (e.g., "From references/actions.md:215")
221
+ - Common pitfalls if relevant
222
+ - Related topics for further reading
223
+
224
+ ### Option 3: Config Explanation (CLI + File Reading)
225
+
226
+ For questions about what a bot does, how it's configured, or what it's capable of, combine CLI and file reading:
227
+
228
+ **When to use:**
229
+
230
+ - "What does my bot do?"
231
+ - "Explain my config"
232
+ - "What models am I using?"
233
+ - "What integrations do I have?"
234
+ - "What state does my bot track?"
235
+
236
+ **Response pattern:**
237
+
238
+ 1. Run `adk status --format json` to get the structured project overview
239
+ 2. Read `agent.config.ts` for full configuration details
240
+ 3. Follow the explanation patterns in **references/explain-config.md**
241
+ 4. Produce a structured explanation covering metadata, models, integrations, state, and primitives
242
+ 5. Flag any issues (unconfigured integrations, missing models, hardcoded secrets)
243
+
244
+ ## Available Documentation
245
+
246
+ Documentation should be located in `./references/` directory relative to this skill. When answering questions, search for these topics:
247
+
248
+ ### Core Concepts
249
+
250
+ - **actions.md** - Actions with strong typing and validation
251
+ - **tools.md** - AI-callable tools and Autonomous namespace
252
+ - **autonomous-execution.md** - Advanced execute() API: Objects, Exits, hooks, configuration
253
+ - **workflows.md** - Workflows and step-based execution
254
+ - **workflow-steps.md** - Complete Workflow Step API reference (step.request, step.map, step.notify, etc.)
255
+ - **conversations.md** - Conversation handlers and message routing
256
+ - **conversation-lifecycle.md** - Nudge/expiration lifecycle management for conversations
257
+ - **triggers.md** - Event-driven automation
258
+ - **messages.md** - Sending messages and events
259
+ - **custom-components.md** - Custom webchat components (`.bp.tsx` files, metadata, usage in conversations)
260
+
261
+ ### Zai (AI Operations)
262
+
263
+ - **zai-agent-reference.md** - Quick reference: all operations, everyday problems Zai solves, edge cases & gotchas
264
+ - **zai-complete-guide.md** - Full developer guide: architecture, active learning, chunking, performance tuning
265
+
266
+ ### Data & Content
267
+
268
+ - **tables.md** - Data storage with semantic search
269
+ - **files.md** - File storage and management
270
+ - **knowledge-bases.md** - RAG implementation
271
+ - **assets.md** - Static files with permanent URLs and sync lifecycle
272
+
273
+ ### Configuration & Integration
274
+
275
+ - **agent-config.md** - Bot configuration and state management
276
+ - **explain-config.md** - How to interpret and explain an agent's configuration to developers
277
+ - **model-configuration.md** - AI model configuration reference
278
+ - **context-api.md** - Runtime context access
279
+ - **integration-actions.md** - Using integration actions
280
+ - **tags.md** - Entity tags for bot, user, conversation, and workflow
281
+ - **cli.md** - Complete CLI command reference
282
+ - **mcp-server.md** - MCP server for AI assistants
283
+ - **desk.md** - Desk integration for ticket/support workflows
284
+ - **integrations.md** - Integration management overview (points to adk-integrations skill)
285
+ - **interfaces.md** - Built-in interface abstraction layer over integrations (typing indicators, LLM, listable)
286
+ - **plugins.md** - Plugin consumption: discovery, installation, configuration, and usage
287
+
288
+ ### Patterns & Best Practices
289
+
290
+ - **advanced-patterns.md** - Guardrails, admin auth, logging/observability, extension composition
291
+ - **patterns-mistakes.md** - Common mistakes, correct patterns, and context access reference
292
+
293
+ ### Frontend Integration
294
+
295
+ > **Note:** Frontend integration docs are in the separate **adk-frontend** skill. Install it with `npx skills add botpress/skills --skill adk-frontend`. The `adk-frontend` skill covers @botpress/client, calling actions, type generation, and authentication. You need it if you are touching any frontend code.
296
+
297
+ ### Evals
298
+
299
+ > **Note:** Detailed eval docs are in the separate **adk-evals** skill. Install it with `npx skills add botpress/skills --skill adk-evals`. The `adk-evals` skill covers writing evals, assertion types, testing workflows, and CLI usage. You usually always need it, for testing and evaluations.
300
+
301
+ ## Runtime Access Patterns
302
+
303
+ Quick reference for accessing ADK runtime services:
304
+
305
+ ### Imports
306
+
307
+ ```typescript
308
+ // Always import from @botpress/runtime
309
+ import {
310
+ Action,
311
+ Autonomous,
312
+ Workflow,
313
+ Conversation,
314
+ z,
315
+ actions,
316
+ adk,
317
+ user,
318
+ bot,
319
+ conversation,
320
+ configuration,
321
+ context,
322
+ } from "@botpress/runtime";
323
+ ```
324
+
325
+ ### State Management
326
+
327
+ ```typescript
328
+ // Bot state (defined in agent.config.ts)
329
+ bot.state.maintenanceMode = true;
330
+ bot.state.lastDeployedAt = new Date().toISOString();
331
+
332
+ // User state (defined in agent.config.ts)
333
+ user.state.preferredLanguage = "en";
334
+ user.state.onboardingComplete = true;
335
+
336
+ // User tags
337
+ user.tags.email; // Access user metadata
338
+ ```
339
+
340
+ ### Calling Actions
341
+
342
+ ```typescript
343
+ // Call bot actions
344
+ await actions.fetchUser({ userId: "123" });
345
+ await actions.processOrder({ orderId: "456" });
346
+
347
+ // Call integration actions
348
+ await actions.slack.sendMessage({ channel: "...", text: "..." });
349
+ await actions.linear.issueList({ teamId: "..." });
350
+
351
+ // Convert action to tool
352
+ tools: [fetchUser.asTool()];
353
+ ```
354
+
355
+ ### Context API
356
+
357
+ ```typescript
358
+ // Get runtime services
359
+ const client = context.get("client"); // Botpress client
360
+ const cognitive = context.get("cognitive"); // AI model client
361
+ const citations = context.get("citations"); // Citation manager
362
+ ```
363
+
364
+ ### File Naming
365
+
366
+ - **Actions/Tools/Workflows**: `myAction.ts`, `searchDocs.ts` (camelCase)
367
+ - **Tables**: `Users.ts`, `Orders.ts` (PascalCase)
368
+ - **Conversations/Triggers**: `chat.ts`, `slack.ts` (lowercase)
369
+
370
+ ## Critical ADK Patterns (Always Reference in Answers)
371
+
372
+ When answering questions, always verify these patterns against the documentation:
373
+
374
+ ### Package Management
375
+
376
+ ```bash
377
+ # All package managers are supported
378
+ bun install # Recommended (fastest)
379
+ npm install # Works fine
380
+ yarn install # Works fine
381
+ pnpm install # Works fine
382
+
383
+ # ADK auto-detects based on lock files
384
+ # - bun.lockb → uses bun
385
+ # - package-lock.json → uses npm
386
+ # - yarn.lock → uses yarn
387
+ # - pnpm-lock.yaml → uses pnpm
388
+ ```
389
+
390
+ ### Imports
391
+
392
+ ```typescript
393
+ // ✅ CORRECT - Always from @botpress/runtime
394
+ import { Action, Autonomous, Workflow, z } from "@botpress/runtime";
395
+
396
+ // ❌ WRONG - Never from zod or @botpress/sdk
397
+ import { z } from "zod"; // ❌ Wrong
398
+ import { Action } from "@botpress/sdk"; // ❌ Wrong
399
+ ```
400
+
401
+ ### Export Patterns
402
+
403
+ ```typescript
404
+ // ✅ Both patterns work - export const is recommended
405
+ export const myAction = new Action({ ... }); // Recommended
406
+ export default new Action({ ... }); // Also valid
407
+
408
+ // Why export const?
409
+ // - Enables direct imports: import { myAction } from "./actions/myAction"
410
+ // - Can pass to execute(): tools: [myAction.asTool()]
411
+ ```
412
+
413
+ ### Actions
414
+
415
+ ```typescript
416
+ // ✅ CORRECT - Handler receives { input, client }
417
+ export const fetchUser = new Action({
418
+ name: "fetchUser",
419
+ async handler({ input, client }) { // ✅ Destructure from props
420
+ const { userId } = input; // ✅ Then destructure fields
421
+ return { name: userId };
422
+ }
423
+ });
424
+
425
+ // ❌ WRONG - Cannot destructure input fields directly
426
+ handler({ userId }) { // ❌ Wrong - must be { input }
427
+ return { name: userId };
428
+ }
429
+ ```
430
+
431
+ ### Tools
432
+
433
+ ```typescript
434
+ // ✅ CORRECT - Tools CAN destructure directly
435
+ export const myTool = new Autonomous.Tool({
436
+ handler: async ({ query, maxResults }) => {
437
+ // ✅ Direct destructuring OK
438
+ return search(query, maxResults);
439
+ },
440
+ });
441
+ ```
442
+
443
+ ### Conversations
444
+
445
+ ```typescript
446
+ // ✅ CORRECT - Use conversation.send() method
447
+ await conversation.send({
448
+ type: "text",
449
+ payload: { text: "Hello!" }
450
+ });
451
+
452
+ // ❌ WRONG - Never use client.createMessage() directly
453
+ await client.createMessage({ ... }); // ❌ Wrong
454
+ ```
455
+
456
+ ### Conversation Handler Types
457
+
458
+ ```typescript
459
+ // Handler receives typed context based on the event type:
460
+ // type: "message" | "event" | "workflow_request" | "workflow_callback"
461
+ async handler({ type, message, event, request, completion, conversation, execute }) {
462
+ if (type === "workflow_request") {
463
+ // event: WorkflowDataRequestEventType, request: WorkflowRequest
464
+ await request.workflow.provide("email", { email: "..." });
465
+ }
466
+ if (type === "workflow_callback") {
467
+ // event: WorkflowCallbackEventType, completion: WorkflowCallback
468
+ console.log(completion.status); // "completed" | "failed" | "canceled" | "timed_out"
469
+ }
470
+ }
471
+
472
+ // ⚠️ isWorkflowDataRequest() and isWorkflowCallback() are deprecated
473
+ // Use type === "workflow_request" / "workflow_callback" instead
474
+ ```
475
+
476
+ ## Examples of Questions This Skill Answers
477
+
478
+ ### Beginner Questions
479
+
480
+ - "What is an Action?"
481
+ - "How do I create my first workflow?"
482
+ - "What's the difference between Actions and Tools?"
483
+
484
+ ### Implementation Questions
485
+
486
+ - "How do I access the Botpress client?"
487
+ - "How do I use citations in RAG?"
488
+ - "What's the syntax for searchable table columns?"
489
+ - "How do I call a Slack integration action?"
490
+ - "How do I use Zai to extract structured data?"
491
+ - "How do I validate content with Zai?"
492
+
493
+ ### Advanced Pattern Questions
494
+
495
+ - "How do I add guardrails to prevent hallucinations?"
496
+ - "How do I implement admin authentication?"
497
+ - "How do I add logging and observability?"
498
+ - "How do I compose multiple extensions?"
499
+ - "How do I manage context in async tool handlers?"
500
+
501
+ ### Troubleshooting Questions
502
+
503
+ - "Why am I getting 'Cannot destructure property' error?"
504
+ - "How do I fix import errors?"
505
+ - "What's wrong with my workflow state access?"
506
+
507
+ ### Best Practices Questions
508
+
509
+ - "What are common mistakes to avoid?"
510
+ - "How should I structure my project?"
511
+ - "What's the recommended pattern for X?"
512
+
513
+ ## Response Format
514
+
515
+ **Match your response depth to the question depth.** Not every question needs a full walkthrough.
516
+
517
+ ### Conceptual Questions ("what is X?", "what's the difference between X and Y?")
518
+
519
+ One sentence definition + one short code example. That's it.
520
+
521
+ ```
522
+ Knowledge bases add RAG to your bot — place markdown or PDF files in `src/knowledge/` and they become queryable with semantic search.
523
+
524
+ import { Autonomous } from '@botpress/runtime'
525
+ export default new Autonomous.Tool({
526
+ handler: async ({ query }) => adk.knowledgeBase.search({ query }),
527
+ })
528
+ ```
529
+
530
+ ### How-To Questions ("how do I create X?", "how do I use X?")
531
+
532
+ Brief explanation + working code example + one critical pitfall only if it's a common trap.
533
+
534
+ ### Implementation Questions ("implement X in my project", "add X to my bot")
535
+
536
+ Read the user's existing files first (`src/actions/`, `src/tools/`, `src/tables/`, `agent.config.ts`). Generate code that uses their actual names, patterns, and conventions. Only mention pitfalls they're likely to hit given their specific code.
537
+
538
+ ### Architecture Questions ("explain my bot", "how does X work in my project?")
539
+
540
+ Full structured response: read `adk status --format json`, `agent.config.ts`, and relevant source files. Map the data flow and identify the bot's archetype (RAG assistant, support agent, automation, etc.).
541
+
542
+ ### Troubleshooting Questions ("X is broken", "why is X failing?")
543
+
544
+ Don't answer with documentation. Run `adk check --format json` and `adk logs error --format json`, show evidence, and point to the root cause. Follow the debug loop from the `adk-debugger` skill.
545
+
546
+ ### Default Rule
547
+
548
+ If the answer fits in one sentence and a code snippet, don't add headers, pitfall sections, or related topics. More structure ≠ more helpful.