tweak: adjust way skills are presented to agent to increase likelyhood of skill invocations. (#17053)

This commit is contained in:
Aiden Cline
2026-03-11 10:24:55 -05:00
committed by GitHub
parent 7291e28273
commit 0f6bc8ae71
4 changed files with 50 additions and 24 deletions

View File

@@ -10,6 +10,9 @@ import PROMPT_GEMINI from "./prompt/gemini.txt"
import PROMPT_CODEX from "./prompt/codex_header.txt"
import PROMPT_TRINITY from "./prompt/trinity.txt"
import type { Provider } from "@/provider/provider"
import type { Agent } from "@/agent/agent"
import { PermissionNext } from "@/permission/next"
import { Skill } from "@/skill"
export namespace SystemPrompt {
export function instructions() {
@@ -34,6 +37,7 @@ export namespace SystemPrompt {
`Here is some useful information about the environment you are running in:`,
`<env>`,
` Working directory: ${Instance.directory}`,
` Workspace root folder: ${Instance.worktree}`,
` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`,
` Platform: ${process.platform}`,
` Today's date: ${new Date().toDateString()}`,
@@ -51,4 +55,16 @@ export namespace SystemPrompt {
].join("\n"),
]
}
export async function skills(agent: Agent.Info) {
if (PermissionNext.disabled(["skill"], agent.permission).has("skill")) return
const list = await Skill.available(agent)
return [
"Skills provide specialized instructions and workflows for specific tasks.",
"Use the skill tool to load a skill when a task matches its description.",
list.length === 0 ? "No skills are currently available." : "\n" + Skill.fmt(list),
].join("\n")
}
}