From 66132bd4e63387e9830e31cc012c0a09bf2ed271 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E5=94=AF?= Date: Fri, 11 Sep 2026 01:42:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(skill-find):=20=E5=81=9C=E7=94=A8=E8=AF=8D?= =?UTF-8?q?=E6=8C=89=E8=AF=8D=E5=88=87=EF=BC=88'=E6=80=8E=E4=B9=88'=20?= =?UTF-8?q?=E6=9B=BE=E8=A2=AB=E5=88=87=E6=88=90=E5=8D=95=E5=AD=97=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E8=AF=AF=E5=91=BD=E4=B8=AD=EF=BC=89+=20=E5=BC=B1?= =?UTF-8?q?=E5=8C=B9=E9=85=8D=E9=98=88=E5=80=BC=2012=20=E4=B8=8E=E9=99=8D?= =?UTF-8?q?=E7=BA=A7=E9=98=B6=E6=A2=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - QSTOP 原为 set(字符串)=单字集合,'怎么/如何' 等双字疑问词不在其中 → 「量子计算机怎么修」误命中 FRP 技能。改为 单字集 ∪ 显式双字疑问词表。 - 最高分 < 12 时提示『没有强匹配』并给三级阶梯(搜现成→装→自建), 而不是硬塞一个低分候选。 - 回归:6 个正例仍 6/6 命中正确技能(obsidian/密钥清历史/vault整理/看板/验收/2B下沉) --- scripts/skill-find.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/scripts/skill-find.py b/scripts/skill-find.py index b35938c0..850b1c02 100755 --- a/scripts/skill-find.py +++ b/scripts/skill-find.py @@ -13,7 +13,11 @@ import os, re, sys, glob SKILLS = os.path.expanduser("~/.hermes/skills") -QSTOP = set("的了和与及怎么如何要要不要是否有我你他她它把被给对为在从到就都也很呢吗个这那注意事项问题办法方法请问帮我一下做个") +QSTOP = set("的了和与及是否我你他她它把被给对为在从到就都也很呢吗个这那") | { + "怎么", "如何", "什么", "为什么", "哪些", "多少", "可以", "需要", "我们", + "这个", "那个", "问题", "方法", "办法", "一下", "帮我", "请问", "注意", + "事项", "一个", "做个", "要做", "不要", "有没有", "是不是", +} def load_skills(): @@ -87,9 +91,11 @@ def main(): if sc: scored.append((sc, s, why)) scored.sort(key=lambda x: -x[0]) - if not scored: - print(f"❌ 技能库无匹配:「{q}」") - print(" → 下一步:web_search 找现成技能库 → 装(skill-library-porting);都没有 → 按方法论自建(hermes-self-improvement)") + if not scored or scored[0][0] < 12: + print(f"⚠️ 没有强匹配:「{q}」(最高分 {scored[0][0] if scored else 0} < 12,下列仅为弱相关)") + print(" 阶梯:web_search 找现成技能库 → 装(skill-library-porting)→ 都没有 → 按 hermes-self-improvement 自建\n") + for sc, s, _ in scored[:3]: + print(f" [{sc:>3}] {s['name']} — {s['desc'][:80]}") return print(f"🔍 「{q}」→ {len(scored)} 个候选,取前 {min(top,len(scored))}:\n") for sc, s, why in scored[:top]: