Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/calm-skill-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@kilocode/cli": patch
---

Prevent built-in skill documentation examples from triggering shell permission prompts.
2 changes: 1 addition & 1 deletion packages/opencode/src/kilocode/skills/builtin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 9 additions & 2 deletions packages/opencode/test/tool/skill.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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* () {
Expand All @@ -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<Omit<PermissionV1.Request, "id" | "sessionID" | "tool">> = []
const ctx: Tool.Context = {
...baseCtx,
ask: () => Effect.void,
ask: (req) =>
Effect.sync(() => {
requests.push(req)
}),
}

const result = yield* tool.execute({ name: "kilo-config" }, ctx)
Expand All @@ -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 },
),
Expand Down
Loading