From 1899333b95d058761433da13a25a895e8fe7142c Mon Sep 17 00:00:00 2001 From: hetaoBackend Date: Sat, 31 Jan 2026 21:54:29 +0800 Subject: [PATCH] refactor: update skills XML format in prompt template Change skills rendering from attribute-based format to nested element format with , , , , and tags for better readability and structure. Co-Authored-By: Claude Opus 4.5 --- backend/src/agents/lead_agent/prompt.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/backend/src/agents/lead_agent/prompt.py b/backend/src/agents/lead_agent/prompt.py index 2e64086..cb2ca5f 100644 --- a/backend/src/agents/lead_agent/prompt.py +++ b/backend/src/agents/lead_agent/prompt.py @@ -97,9 +97,7 @@ You have access to skills that provide optimized workflows for specific tasks. E **Skills are located at:** {skills_base_path} - {skills_list} - @@ -181,10 +179,17 @@ def apply_prompt_template() -> str: container_base_path = "/mnt/skills" # Generate skills list XML with paths (path points to SKILL.md file) - skills_list = "\n".join(f'\n{skill.description}\n' for skill in skills) - - # If no skills found, provide empty list - if not skills_list: + if skills: + skill_items = "\n".join( + f" \n" + f" {skill.name}\n" + f" {skill.description}\n" + f" {skill.get_container_file_path(container_base_path)}\n" + f" " + for skill in skills + ) + skills_list = f"\n{skill_items}\n" + else: skills_list = "" # Format the prompt with dynamic skills