xiaohongshu
xiaohongshu
adk
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
Full skill instructions
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, or Zai.
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.
The ADK provides primitives for:
All primitives must be placed in src/ directory:
/ # Project root
├── src/
│ ├── actions/ # Strongly-typed functions → auto-registered
│ ├── tools/ # AI-callable tools → available via execute()
│ ├── workflows/ # Long-running processes → resumable/scheduled
│ ├── conversations/ # Message handlers → routes by channel
│ ├── tables/ # Database schemas → auto-created with search
│ ├── triggers/ # Event handlers → subscribe to events
│ ├── knowledge/ # Knowledge bases → RAG with semantic search
│ └── utils/ # Shared helpers (not auto-registered)
└── agent.config.ts # Bot configuration (includes integrations)
Note:
dependencies.jsonwas removed in ADK 1.9+. All configuration including integrations now lives inagent.config.ts.
Critical: Files outside
src/are not discovered. Location = behavior.
Activate this skill when users ask ADK-related questions like:
ADK questions fall into two categories: CLI queries and documentation lookups.
For integration discovery and CLI queries, use the Bash tool to run commands directly:
Integration Discovery:
# Search for integrations
adk search <query>
# List all available integrations
adk list --available
# Get detailed integration info (actions, channels, events)
adk info <integration-name>
# Check installed integrations (must be in ADK project)
adk list
Project Info:
# Check CLI version
adk --version
# Show project status
adk
# Get help
adk --help
When to use CLI commands:
Response pattern:
adk commandadk add [email protected] to install")For documentation, patterns, and how-to questions, search and reference the documentation files directly:
When to use documentation:
How to answer documentation questions:
Find relevant files - Use Glob to discover documentation:
pattern: **/references/*.md
Search for keywords - Use Grep to find relevant content:
pattern: <keyword from user question>
path: <path to references directory from step 1>
output_mode: files_with_matches
Read the files - Use Read to load relevant documentation
Provide answer with:
Documentation should be located in ./references/ directory relative to this skill. When answering questions, search for these topics:
Quick reference for accessing ADK runtime services:
// Always import from @botpress/runtime
import {
Action,
Autonomous,
Workflow,
Conversation,
z,
actions,
adk,
user,
bot,
conversation,
context,
} from "@botpress/runtime";
// Bot state (defined in agent.config.ts)
bot.state.maintenanceMode = true;
bot.state.lastDeployedAt = new Date().toISOString();
// User state (defined in agent.config.ts)
user.state.preferredLanguage = "en";
user.state.onboardingComplete = true;
// User tags
user.tags.email; // Access user metadata
// Call bot actions
await actions.fetchUser({ userId: "123" });
await actions.processOrder({ orderId: "456" });
// Call integration actions
await actions.slack.sendMessage({ channel: "...", text: "..." });
await actions.linear.issueList({ teamId: "..." });
// Convert action to tool
tools: [fetchUser.asTool()];
// Get runtime services
const client = context.get("client"); // Botpress client
const cognitive = context.get("cognitive"); // AI model client
const citations = context.get("citations"); // Citation manager
myAction.ts, searchDocs.ts (camelCase)Users.ts, Orders.ts (PascalCase)chat.ts, slack.ts (lowercase)When answering questions, always verify these patterns against the documentation:
# All package managers are supported
bun install # Recommended (fastest)
npm install # Works fine
yarn install # Works fine
pnpm install # Works fine
# ADK auto-detects based on lock files
# - bun.lockb → uses bun
# - package-lock.json → uses npm
# - yarn.lock → uses yarn
# - pnpm-lock.yaml → uses pnpm
// ✅ CORRECT - Always from @botpress/runtime
import { Action, Autonomous, Workflow, z } from "@botpress/runtime";
// ❌ WRONG - Never from zod or @botpress/sdk
import { z } from "zod"; // ❌ Wrong
import { Action } from "@botpress/sdk"; // ❌ Wrong
// ✅ Both patterns work - export const is recommended
export const myAction = new Action({ ... }); // Recommended
export default new Action({ ... }); // Also valid
// Why export const?
// - Enables direct imports: import { myAction } from "./actions/myAction"
// - Can pass to execute(): tools: [myAction.asTool()]
// ✅ CORRECT - Handler receives { input, client }
export const fetchUser = new Action({
name: "fetchUser",
async handler({ input, client }) { // ✅ Destructure from props
const { userId } = input; // ✅ Then destructure fields
return { name: userId };
}
});
// ❌ WRONG - Cannot destructure input fields directly
handler({ userId }) { // ❌ Wrong - must be { input }
return { name: userId };
}
// ✅ CORRECT - Tools CAN destructure directly
export const myTool = new Autonomous.Tool({
handler: async ({ query, maxResults }) => {
// ✅ Direct destructuring OK
return search(query, maxResults);
},
});
// ✅ CORRECT - Use conversation.send() method
await conversation.send({
type: "text",
payload: { text: "Hello!" }
});
// ❌ WRONG - Never use client.createMessage() directly
await client.createMessage({ ... }); // ❌ Wrong
When answering ADK questions, follow this structure:
Example Response Structure:
Actions are strongly-typed functions that can be called from anywhere in your bot.
**Example:**
[code example]
**Common Pitfall:** Remember to destructure `input` first (see troubleshooting section)
**Related:** You can convert Actions to Tools using `.asTool()` - see the "When to Use What" decision tree.
**Next Steps:** Create your action in `src/actions/myAction.ts` and it will be auto-registered.
xiaohongshu
technical spec
product ux expert
database patterns
Conduct multi-agent task orchestration and workflow coordination.
Initialize project with Conductor artifacts (product definition,
Expert in web animations, transitions, and motion design using Framer Motion and CSS
Creates Mermaid and ASCII diagrams for flowcharts, architecture, ERDs, state machines, mindmaps, and more. Use when user mentions diagram, flowchart, mermaid, ASCII diagram, text diagram, terminal diagram, visualize, C4, mindmap, architecture diagram, sequence diagram, ERD, or needs visual docume...
PostgreSQL bindings for H3 hexagonal grid system. Use when working with H3 cells in Postgres, including spatial indexing, geometry/geography integration, and raster analysis.
Context-Driven Development skill for projects using Conductor. Use this skill when you detect a `conductor/` directory in the project, when working on tasks defined in a `plan.md` file, or when the user asks about tracks, specs, or plans. Automatically applies TDD workflow, tracks task completion...
Display project status, active tracks, and next actions
Official Stakpak application containerization standard operating procedure, a step-by-step guidline to properly dockerize applications. This is a rule book curated by the Stakpak Team.
Generate, edit, and beat-sync AI video with leading models in one workspace.
The world's fastest calendar for remote work
Transform Your Design with AI Designer by ImgCreator.ai
Revolutionizing Video Production with AI-Powered Creativity
Extend an image past the frame and let AI fill the new aspect ratio.
Discover your celebrity doppelgänger with StarByFace!
ChainClarity explains 700+ crypto whitepapers in plain English, with layered summaries, comparisons, research tools, alerts, and a $4.99 Pro plan.
Opus.ai: Revolutionize Your Web Experience