refactor: centralize skills prompt resolution

This commit is contained in:
Peter Steinberger
2026-01-09 21:27:11 +01:00
parent cf8d7139e1
commit 24605379b9
7 changed files with 78 additions and 62 deletions

View File

@@ -139,6 +139,14 @@ export function buildAgentSystemPrompt(params: {
runtimeProvider === "telegram" &&
runtimeCapabilitiesLower.has("inlinebuttons");
const skillsLines = skillsPrompt ? [skillsPrompt, ""] : [];
const skillsSection = skillsPrompt
? [
"## Skills",
"Skills provide task-specific instructions. Use `read` to load the SKILL.md at the location listed for that skill.",
...skillsLines,
"",
]
: [];
const lines = [
"You are a personal assistant running inside Clawdbot.",
@@ -166,10 +174,7 @@ export function buildAgentSystemPrompt(params: {
"TOOLS.md does not control tool availability; it is user guidance for how to use external tools.",
"If a task is more complex or takes longer, spawn a sub-agent. It will do the work for you and ping you when it's done. You can always check up on it.",
"",
"## Skills",
"Skills provide task-specific instructions. Use `read` to load the SKILL.md at the location listed for that skill.",
...skillsLines,
"",
...skillsSection,
hasGateway ? "## Clawdbot Self-Update" : "",
hasGateway
? [