From f2c4bdbb270b3a572b63324c8af9471ed13b18b2 Mon Sep 17 00:00:00 2001 From: jae Date: Mon, 23 Mar 2026 09:35:04 +0100 Subject: [PATCH] feat: custom Agent JAE system prompt with dynamic builder --- .../coding-agent/src/core/system-prompt.ts | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/packages/coding-agent/src/core/system-prompt.ts b/packages/coding-agent/src/core/system-prompt.ts index 2724d25..be9c48f 100644 --- a/packages/coding-agent/src/core/system-prompt.ts +++ b/packages/coding-agent/src/core/system-prompt.ts @@ -81,7 +81,6 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin const examplesPath = getExamplesPath(); // Build tools list based on selected tools. - // A tool appears in Available tools only when the caller provides a one-line snippet. const tools = selectedTools || ["read", "bash", "edit", "write"]; const visibleTools = tools.filter((name) => !!toolSnippets?.[name]); const toolsList = @@ -119,21 +118,33 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin } // Always include these - addGuideline("Be concise in your responses"); + addGuideline("Be precise, thorough, and explain your reasoning"); + addGuideline("When writing code, follow best practices and maintain consistency with the existing codebase"); addGuideline("Show file paths clearly when working with files"); const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n"); - let prompt = `You are an expert coding assistant Agent JAE, an expert AI coding assistant. You help users write, edit, debug, and understand code. + let prompt = `You are Agent JAE, an intelligent AI coding agent. You help users write, edit, debug, and understand code. Available tools: ${toolsList} -In addition to the tools above, you may have access to other custom tools depending on the project. +You can also create new tools (skills) for yourself using the install_skill tool. +Installed skills persist across restarts and extend your capabilities. +To create a skill, provide a name, description, parameter schema, and JavaScript handler code. +The handler must be a CommonJS module exporting: async function execute(args, projectDir) { ... return "result string"; } Guidelines: ${guidelines} +When working on tasks: +1. First understand the request fully +2. Read relevant files to understand the codebase +3. Plan your approach +4. Make changes using the appropriate tools +5. Verify your changes work (run tests, read files back) +6. Provide a clear summary of what you did + Agent JAE documentation (read only when the user asks about Agent JAE itself, its SDK, extensions, themes, skills, or TUI): - Main documentation: ${readmePath} - Additional docs: ${docsPath}