Updated system-prompt.ts to use xml boundaries during system and context file merging rather than using ## so that agents are less likely to ingest a prompt with inconsistent boundaries.
This commit is contained in:
@@ -59,11 +59,12 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions): string {
|
|||||||
|
|
||||||
// Append project context files
|
// Append project context files
|
||||||
if (contextFiles.length > 0) {
|
if (contextFiles.length > 0) {
|
||||||
prompt += "\n\n# Project Context\n\n";
|
prompt += "\n\n<project_context>\n\n";
|
||||||
prompt += "Project-specific instructions and guidelines:\n\n";
|
prompt += "Project-specific instructions and guidelines:\n\n";
|
||||||
for (const { path: filePath, content } of contextFiles) {
|
for (const { path: filePath, content } of contextFiles) {
|
||||||
prompt += `## ${filePath}\n\n${content}\n\n`;
|
prompt += `<project_instructions path="${filePath}">\n${content}\n</project_instructions>\n\n`;
|
||||||
}
|
}
|
||||||
|
prompt += "</project_context>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// Append skills section (only if read tool is available)
|
// Append skills section (only if read tool is available)
|
||||||
|
|||||||
Reference in New Issue
Block a user