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]: