npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

harmony-skills-defect-to-testcase

v1.0.0

Published

Skills: defect-to-testcase

Readme

defect-to-testcase 知识库使用说明

缺陷文本 → 标准测试用例(text-to-testcase 规则 + QMD 本地知识库 grounding)。不限被测对象,知识域由调用方通过 --domain 显式提供。

1. 知识库路径

  • 本地知识库目录:knowledge-base/(项目根下)。往这里放 .md 文件即知识库内容。
  • 注册表 knowledge/knowledge-sources.yamlsample-business 域(示例业务域)的 sample-business-qmd 源已指向该目录:
providers:
  qmd-local:
    type: qmd
    command: qmd
    index: defect-case-knowledge      # QMD 具名索引
    enabled: true
languages:
  sample-business:
    kind: business                     # 业务域(不分 stage,任何阶段都查)
    sources:
      - id: sample-business-qmd
        provider: qmd-local
        path: xxx   # 知识库路径
        collection: sample-business    # QMD collection 名
        mask: '**/*.md'
        search_mode: search           # BM25
        enabled: true

sample-business 仅为示例业务域名,请按你的被测对象替换为真实业务域(如 myapp-live),并相应调整 collectionindex

2. QMD 安装

npm i -g @tobilu/[email protected]

验证:

qmd --version      # 期望: qmd 2.5.3
qmd status         # 期望: 正常输出索引状态、不崩溃

3. 知识库更新方法

知识库路径 加/改 .md 后,重索引即可

qmd --index defect-case-knowledge update

或经 skill 同步:

python defect-to-testcase/code-knowledge-query/scripts/knowledge_source.py sync --source-id sample-business-qmd

首次建索引(仅供还原参考,当前已建好):

qmd --index defect-case-knowledge collection add "xxx" --name sample-business --mask "**/*.md"
qmd --index defect-case-knowledge context add "qmd://sample-business" "business knowledge domain: sample-business"
qmd --index defect-case-knowledge update

4. 检索(query)

python defect-to-testcase/code-knowledge-query/scripts/knowledge_source.py query \
  --source-id sample-business-qmd \
  --question '<决策级问题>' \
  --keyword '<精确术语>'
  • BM25 默认、无需模型 key。中文术语务必作为可重复 --keyword 传入(自然语言句子 tokenize 不好时靠 keyword 兜底)。
  • 返回 status: answered + citations(.md 路径),回填到用例「知识:」区。

环境

  • Python 依赖:首次跑 python defect-to-testcase/code-knowledge-query/scripts/init_knowledge.py --skip-deepwiki-check 建 venv + 装 PyYAML。