feat: custom Agent JAE system prompt with dynamic builder
Some checks are pending
CI / build-check-test (push) Waiting to run
Some checks are pending
CI / build-check-test (push) Waiting to run
This commit is contained in:
parent
2d26f44944
commit
f2c4bdbb27
1 changed files with 15 additions and 4 deletions
|
|
@ -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}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue