From 57e36c7ea2196a9c54e2db2e9bafcd606e5439a6 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 14:42:17 +0200 Subject: [PATCH 1/6] feat(cli): add config location awareness to system prompt Add project and global config paths to the block so the model knows where to create commands, agents, and config files by default. --- packages/opencode/src/session/system.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index 348fd881062..ed2eeee1cfd 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -1,5 +1,6 @@ import { Ripgrep } from "../file/ripgrep" +import { Global } from "../global" // kilocode_change import { Instance } from "../project/instance" import PROMPT_ANTHROPIC from "./prompt/anthropic.txt" @@ -67,6 +68,8 @@ export namespace SystemPrompt { ` Working directory: ${Instance.directory}`, ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, ` Platform: ${process.platform}`, + ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md)`, // kilocode_change + ` Global config: ${Global.Path.config}/ (same structure)`, // kilocode_change ...staticEnvLines(editorContext), // kilocode_change ``, ``, From ba436a7896a3390a3d1933300741745258a7b6f2 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 14:42:30 +0200 Subject: [PATCH 2/6] feat(cli): add tip about saving repetitive tasks as commands --- packages/opencode/src/kilocode/components/tips.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/opencode/src/kilocode/components/tips.tsx b/packages/opencode/src/kilocode/components/tips.tsx index e485afb3274..5dd5981eeb3 100644 --- a/packages/opencode/src/kilocode/components/tips.tsx +++ b/packages/opencode/src/kilocode/components/tips.tsx @@ -142,4 +142,5 @@ const TIPS = [ "Run {highlight}/help{/highlight} to show the help dialog", "Use {highlight}/rename{/highlight} to rename the current session", "Press {highlight}Ctrl+Z{/highlight} to suspend the terminal and return to your shell", + "Doing something often? Ask Kilo to save it as a {highlight}/command{/highlight}", ] From 433912769d581723304db2cdfdb8114f52ab7332 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 17:03:24 +0200 Subject: [PATCH 3/6] fix(cli): prefer existing config dir over creating .kilo/ Instruct the model to reuse .kilocode/ or .opencode/ when already present, falling back to .kilo/ only when no config dir exists. --- packages/opencode/src/session/system.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index ed2eeee1cfd..472bf2c4ea5 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -68,7 +68,7 @@ export namespace SystemPrompt { ` Working directory: ${Instance.directory}`, ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, ` Platform: ${process.platform}`, - ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md)`, // kilocode_change + ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Reuse .kilocode/ or .opencode/ if already present; otherwise create .kilo/.`, // kilocode_change ` Global config: ${Global.Path.config}/ (same structure)`, // kilocode_change ...staticEnvLines(editorContext), // kilocode_change ``, From 5d5433681fcc8328965c3127a500f5c544666b0c Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 17:07:16 +0200 Subject: [PATCH 4/6] fix(cli): remove .opencode/ from config dir hint Only suggest .kilo/ and .kilocode/ as config directories, dropping .opencode/ to avoid confusion with upstream naming. --- packages/opencode/src/session/system.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index 472bf2c4ea5..0c135605d45 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -68,7 +68,7 @@ export namespace SystemPrompt { ` Working directory: ${Instance.directory}`, ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, ` Platform: ${process.platform}`, - ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Reuse .kilocode/ or .opencode/ if already present; otherwise create .kilo/.`, // kilocode_change + ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Reuse .kilocode/ if already present; otherwise create .kilo/.`, // kilocode_change ` Global config: ${Global.Path.config}/ (same structure)`, // kilocode_change ...staticEnvLines(editorContext), // kilocode_change ``, From 2847ec4a8571cf04d66c58cfec4e1fee1c15a736 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 18:03:00 +0200 Subject: [PATCH 5/6] fix(cli): use strict .kilo/ directive in config hint Replace conditional fallback language with an imperative instruction to always use .kilo/ and never create config under .kilocode/ or .opencode/. --- packages/opencode/src/session/system.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index 0c135605d45..720ad5cf548 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -68,7 +68,7 @@ export namespace SystemPrompt { ` Working directory: ${Instance.directory}`, ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, ` Platform: ${process.platform}`, - ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Reuse .kilocode/ if already present; otherwise create .kilo/.`, // kilocode_change + ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Always use .kilo/ for new config. Do not use .kilocode/ or .opencode/.`, // kilocode_change ` Global config: ${Global.Path.config}/ (same structure)`, // kilocode_change ...staticEnvLines(editorContext), // kilocode_change ``, From 26f207e8fae1047011a48cb6de88ae64f6b78596 Mon Sep 17 00:00:00 2001 From: Alex Alecu Date: Mon, 23 Mar 2026 18:24:28 +0200 Subject: [PATCH 6/6] fix(cli): clarify config paths --- packages/opencode/src/session/system.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/opencode/src/session/system.ts b/packages/opencode/src/session/system.ts index 720ad5cf548..1550d03398b 100644 --- a/packages/opencode/src/session/system.ts +++ b/packages/opencode/src/session/system.ts @@ -68,7 +68,7 @@ export namespace SystemPrompt { ` Working directory: ${Instance.directory}`, ` Is directory a git repo: ${project.vcs === "git" ? "yes" : "no"}`, ` Platform: ${process.platform}`, - ` Project config: .kilo/ (command/*.md, agent/*.md, kilo.json, AGENTS.md). Always use .kilo/ for new config. Do not use .kilocode/ or .opencode/.`, // kilocode_change + ` Project config: .kilo/command/*.md, .kilo/agent/*.md, kilo.json, AGENTS.md. Put new commands and agents in .kilo/. Do not use .kilocode/ or .opencode/.`, // kilocode_change ` Global config: ${Global.Path.config}/ (same structure)`, // kilocode_change ...staticEnvLines(editorContext), // kilocode_change ``,