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:
Nelson Herrera
2026-05-16 19:10:09 -07:00
Unverified
parent 734e08edf8
commit e2fd651eb9
@@ -59,11 +59,12 @@ export function buildSystemPrompt(options: BuildSystemPromptOptions): string {
// Append project context files
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";
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)