Give bots skills: runbooks they load when a job matches

A skill is a runbook: a name, a unique slug, a one-line description of when
it applies, and the markdown body. A run only ever sees the slug and
description (one load_skill tool carries them), and reads the whole body
only when it calls the tool, so a long runbook costs nothing until needed.

Skills are the third extension kind beside MCP servers and custom tools, on
the same botExtensionsSql path, so per-bot, per-workspace and all-bots
grants work the same way, and attachDefaultExtensions hands an every-bot
skill to new bots. load_skill is a reserved tool name, so a custom tool
cannot shadow it, and a built-in wins a clash.

Managed on Settings > Skills; ExtensionRow links each kind to its own page
and a skill never reports a failure, since nothing connects or runs.
This commit is contained in:
2026-10-22 12:31:42 +01:00
parent 379ef35e08
commit 08d02e6033
62 changed files with 1438 additions and 79 deletions
+9 -1
View File
@@ -14,6 +14,7 @@ import grabUserWorkspaces from "@/src/functions/backend/db/workspaces/grab-user-
import runTextLoop from "@/src/harness/text/run-text-loop";
import openComputerTools from "@/src/harness/tools/computer/open-computer-tools";
import openBotExtensions, { type OpenBotExtensions } from "@/src/harness/tools/extensions/open-bot-extensions";
import openBotSkills, { type OpenBotSkills } from "@/src/harness/tools/skills/open-bot-skills";
import grabBotTools from "@/src/harness/tools/bot/grab-bot-tools";
import createWorkspaceTool from "@/src/harness/tools/bot/create-workspace-tool";
import updateWorkspaceTool from "@/src/harness/tools/bot/update-workspace-tool";
@@ -71,6 +72,7 @@ export default async function runBotTask({
: null;
let extensions: OpenBotExtensions | undefined;
let skills: OpenBotSkills | undefined;
try {
const session_id = await jobSessionId({ job });
@@ -173,6 +175,11 @@ export default async function runBotTask({
signal,
});
skills = openBotSkills({
skills: extensions.skills,
taken: [...tools, ...extensions.tools].map((tool) => tool.name),
});
const result = await runTextLoop({
system: [
prompt,
@@ -200,6 +207,7 @@ export default async function runBotTask({
.map((env) => `- ${env.key}${env.description ? `: ${env.description}` : ""}`)
.join("\n")}`
: "",
skills.note,
extensions.note,
]
.filter(Boolean)
@@ -214,7 +222,7 @@ export default async function runBotTask({
}),
},
],
tools: [...tools, ...extensions.tools],
tools: [...tools, ...extensions.tools, ...skills.tools],
bot_id: bot.id,
workspace_id,
signal,