From d9c100ce76f2e9df764dff96a4891acfe088a613 Mon Sep 17 00:00:00 2001 From: yumoqing Date: Sat, 15 Aug 2026 19:45:02 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20to=5Fprompt=5Fblock=E5=89=A5?= =?UTF-8?q?=E7=A6=BBfrontmatter=E5=86=97=E4=BD=99(=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E5=B1=82=E5=B7=B2=E5=B1=95=E7=A4=BAname/description)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_core/skill_loader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pipeline_core/skill_loader.py b/pipeline_core/skill_loader.py index fbf7a60..5ee78fb 100644 --- a/pipeline_core/skill_loader.py +++ b/pipeline_core/skill_loader.py @@ -102,10 +102,16 @@ class Skill: def to_prompt_block(self) -> str: scope_tag = SCOPE_TAG.get(self.scope, self.scope) + body = self.content + # 剥离 frontmatter(--- 之间),只保留正文,避免 name/description 与目录层重复 + if body.startswith("---"): + end = body.find("---", 3) + if end != -1: + body = body[end + 3:].strip() return f"""## [{scope_tag}] {self.name} {self.description} -{self.content} +{body} """