Spec2Case 是生产级 AI 测试用例生成智能体,支持图片/文本需求理解、人工确认、LangGraph 流程编排和 Excel 用例导出。
# Add to your Claude Code skills
git clone https://github.com/blackhaiyu-sudo/spec2caseLast scanned: 7/5/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-07-05T07:25:12.463Z",
"npmAuditRan": true,
"pipAuditRan": false,
"promptInjectionRan": true
}spec2case is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by blackhaiyu-sudo. Spec2Case 是生产级 AI 测试用例生成智能体,支持图片/文本需求理解、人工确认、LangGraph 流程编排和 Excel 用例导出。. It has 107 GitHub stars.
Yes. spec2case passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/blackhaiyu-sudo/spec2case" and add it to your Claude Code skills directory (see the Installation section above).
spec2case is primarily written in Python. It is open-source under blackhaiyu-sudo on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh spec2case against similar tools.
No comments yet. Be the first to share your thoughts!
Spec2Case 是一个面向 QA、测试开发、产品和研发团队的生产级 AI 测试用例生成平台,可以把 PRD、需求文档、产品规格说明、原型图、设计稿、业务截图等输入,转换为结构化、可执行、可导出的测试用例。
这不是一个开源 demo 或概念验证项目,而是从真实业务测试交付中迭代出来的 AI 用例生成智能体。项目经过 80+ 小需求、十几个大版本需求验证,生成测试用例可用率达 90%+,可直接进入测试设计、用例评审和回归测试准备流程。
它也不是简单的“让大模型写用例”:系统会先审查需求缺口和逻辑不闭环问题,再通过人工确认补齐事实,生成用例。
成本也足够低:按当前推荐配置,即使用高质量模型组合,常见单任务成本约 1-2 元。


git clone https://github.com/blackhaiyu-sudo/spec2case.git
cd spec2case
bash scripts/quick-start.sh
国内网络也可以使用 Gitee 地址:
git clone https://gitee.com/blackhai/spec2case.git
cd spec2case
bash scripts/quick-start.sh
脚本支持 Ubuntu 20.04/22.04/24.04 等主流 Ubuntu 系统和 macOS。Ubuntu 缺少 Docker 时会自动安装 Docker Engine 与 Docker Compose 插件;macOS 需要 Docker Desktop。
访问:
http://localhost:5002
首次启动后可在页面“模型配置”中维护模型,也可以直接编辑 runtime/config/OAI_CONFIG_LIST 后重启容器。
测试用例生成质量强依赖模型能力。首次进入页面后,建议先打开“模型配置”,按下面三类用途填好模型并点击“测试”确认连通性:
| 用途 | 推荐模型 | 作用 | 选型建议 |
|---|---|---|---|
| 需求拆分模型 | GPT-5.5 或同等级/更强模型 | PRD 分块、LU 拆分、跨模块链路识别 | 这一步决定后续上下文是否完整,建议使用最新一代顶级模型 |
| 需求/测试用例模型 | DeepSeek V4 Pro 或同等级/更强模型 | 需求审查、确认整合、最终 PRD、测试用例生成 | 调用量最大,建议使用国内一线模型兼顾质量和成本 |
| 图片分析模型 | Doubao Seed 2.0 Pro 或同等级/更强视觉模型 | 原型图、设计稿、截图、箭头备注和文件名语义提取 | 图片需求必须配置,视觉理解弱会直接造成需求遗漏 |
费用参考:按当前推荐配置,常见单任务约 1-2 元。实际费用取决于模型、需求长度和图片数量,页面“AI 协作运行”会展示任务估算费用。
如果只想先体验页面,可以先查看内置示例任务;如果要生成自己的高质量用例,请先完成以上模型配置。
git clone https://github.com/blackhaiyu-sudo/spec2case.git
cd spec2case
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp config/OAI_CONFIG_LIST.example config/OAI_CONFIG_LIST
python database/init_db.py init
./start.sh
agents/ Agent 定义和提示词模板
config/ 模型配置示例
database/ 数据库模型和初始化脚本
routes/ Flask API
services/ 核心业务、LangGraph 流程、文件服务
static/ 前端静态资源
templates/ 页面模板
docs/ 开源文档
运行过程中会产生配置、上传文件、日志和导出结果。Docker Compose 默认写入 runtime/,本地开发默认写入项目下的运行目录:
config/OAI_CONFIG_LISTdata/logs/outputs/uploads/runtime/MIT
Spec2Case 的目标不是替代人工,而是把真实需求、人工确认和模型能力结合起来,让测试用例生成更高效、风格统一。现实里的 PRD、截图和业务说明很少天然完整,所以保留人工确认是必要的,AI 更适合做整理、补全和结构化。
没有把企业知识库或 RAG 放进主链路,是因为包袱太重,知识库本身质量不好反而适得其反。