spec2case

by blackhaiyu-sudoVerified

Spec2Case 是生产级 AI 测试用例生成智能体,支持图片/文本需求理解、人工确认、LangGraph 流程编排和 Excel 用例导出。

117
Stars
6
Forks
Python
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/blackhaiyu-sudo/spec2case

Getting Started

Guides for using skills like spec2case.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

Spec2Case

Spec2Case 是一个面向 QA、测试开发、产品和研发团队的生产级 AI 测试用例生成平台,可以把 PRD、需求文档、产品规格说明、原型图、设计稿、业务截图等输入,转换为结构化、可执行、可导出的测试用例。

这不是一个开源 demo 或概念验证项目,而是从真实业务测试交付中迭代出来的 AI 用例生成智能体。项目经过 80+ 小需求、十几个大版本需求验证,生成测试用例可用率达 90%+,可直接进入测试设计、用例评审和回归测试准备流程。

它也不是简单的“让大模型写用例”:系统会先审查需求缺口和逻辑不闭环问题,再通过人工确认补齐事实,生成用例。

成本也足够低:按当前推荐配置,即使用高质量模型组合,常见单任务成本约 1-2 元。

界面预览

Spec2Case 首页

AI 协作运行

功能

  • 文本需求导入:支持粘贴或上传 PRD/需求说明。
  • 图片需求导入:支持上传原型图、设计稿、截图和补充备注。
  • 人工确认:对需求缺口、逻辑不闭环或关键信息缺失进行一次性确认。
  • 测试用例生成:覆盖普通模块用例和跨模块链路用例。
  • 结果导出:支持在页面查看并下载 Excel/JSON。
  • 模型配置:页面内配置不同阶段使用的模型,并可测试连通性。

技术栈

  • Backend: Flask, SQLAlchemy, SQLite
  • Frontend: Vue 2, Element UI
  • Workflow: LangGraph
  • Model Config: OpenAI-compatible

快速开始

一键启动

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_LIST
  • data/
  • logs/
  • outputs/
  • uploads/
  • runtime/

License

MIT

开发者的话

Spec2Case 的目标不是替代人工,而是把真实需求、人工确认和模型能力结合起来,让测试用例生成更高效、风格统一。现实里的 PRD、截图和业务说明很少天然完整,所以保留人工确认是必要的,AI 更适合做整理、补全和结构化。

没有把企业知识库或 RAG 放进主链路,是因为包袱太重,知识库本身质量不好反而适得其反。

联系与反馈

Frequently Asked Questions

What is spec2case?

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 117 GitHub stars.

Is spec2case safe to use?

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.

How do I install spec2case?

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).

What programming language is spec2case written in?

spec2case is primarily written in Python. It is open-source under blackhaiyu-sudo on GitHub, so you can review or fork the full source.

Are there alternatives to spec2case?

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.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details
spec2case — AI Skill for Claude Code | SkillTip