From 90ac91d501eae78602db747ec35ea16473d2fb8f Mon Sep 17 00:00:00 2001 From: marius-kilocode Date: Thu, 6 Aug 2026 08:53:49 +0200 Subject: [PATCH] fix(cli): preserve built-in skill markdown --- .changeset/calm-skill-examples.md | 5 +++++ packages/opencode/src/kilocode/skills/builtin.ts | 2 +- packages/opencode/test/tool/skill.test.ts | 11 +++++++++-- 3 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 .changeset/calm-skill-examples.md diff --git a/.changeset/calm-skill-examples.md b/.changeset/calm-skill-examples.md new file mode 100644 index 00000000000..a1ac64ae30e --- /dev/null +++ b/.changeset/calm-skill-examples.md @@ -0,0 +1,5 @@ +--- +"@kilocode/cli": patch +--- + +Prevent built-in skill documentation examples from triggering shell permission prompts. diff --git a/packages/opencode/src/kilocode/skills/builtin.ts b/packages/opencode/src/kilocode/skills/builtin.ts index 23275d040a3..50c6971dcfe 100644 --- a/packages/opencode/src/kilocode/skills/builtin.ts +++ b/packages/opencode/src/kilocode/skills/builtin.ts @@ -3,7 +3,7 @@ // Content is inlined at compile time via Bun's static import of .md files. // Registered before all discovery phases so user skills with the same name override. -import KILO_CONFIG from "./kilo-config.md" +import KILO_CONFIG from "./kilo-config.md" with { type: "text" } export interface BuiltinSkill { name: string diff --git a/packages/opencode/test/tool/skill.test.ts b/packages/opencode/test/tool/skill.test.ts index f3875fe1e7a..f0631cef6c3 100644 --- a/packages/opencode/test/tool/skill.test.ts +++ b/packages/opencode/test/tool/skill.test.ts @@ -136,7 +136,7 @@ Use this skill. ) // kilocode_change start - it.live("built-in kilo-config includes named command lookup guidance", () => + it.live("built-in kilo-config keeps rendered shell examples inert", () => provideTmpdirInstance( (dir) => Effect.gen(function* () { @@ -157,9 +157,13 @@ Use this skill. })).find((t) => t.id === SkillTool.id) if (!tool) throw new Error("Skill tool not found") + const requests: Array> = [] const ctx: Tool.Context = { ...baseCtx, - ask: () => Effect.void, + ask: (req) => + Effect.sync(() => { + requests.push(req) + }), } const result = yield* tool.execute({ name: "kilo-config" }, ctx) @@ -170,6 +174,9 @@ Use this skill. expect(result.output).toContain("~/.kilocode/") expect(result.output).toContain("**/command/") expect(result.output).toContain("explicit search") + expect(result.output).toContain("`` !`cmd` ``") + expect(result.output).not.toContain("[skill shell command failed]") + expect(requests.map((request) => request.permission)).toEqual(["skill"]) }), { git: true }, ),