feat: custom Agent JAE system prompt with dynamic builder

This commit is contained in:
jae 2026-03-23 09:35:04 +01:00
parent 779e6aed4e
commit 32c64f27e7

View file

@ -81,7 +81,6 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin
const examplesPath = getExamplesPath(); const examplesPath = getExamplesPath();
// Build tools list based on selected tools. // 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 tools = selectedTools || ["read", "bash", "edit", "write"];
const visibleTools = tools.filter((name) => !!toolSnippets?.[name]); const visibleTools = tools.filter((name) => !!toolSnippets?.[name]);
const toolsList = const toolsList =
@ -119,21 +118,33 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions = {}): strin
} }
// Always include these // 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"); addGuideline("Show file paths clearly when working with files");
const guidelines = guidelinesList.map((g) => `- ${g}`).join("\n"); 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: Available tools:
${toolsList} ${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:
${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): Agent JAE documentation (read only when the user asks about Agent JAE itself, its SDK, extensions, themes, skills, or TUI):
- Main documentation: ${readmePath} - Main documentation: ${readmePath}
- Additional docs: ${docsPath} - Additional docs: ${docsPath}