← 返回 Skills 市场
121
总下载
0
收藏
0
当前安装
3
版本数
在 OpenClaw 中安装
/install testcase-gen
功能描述
Generates comprehensive test cases from MySQL/Redis data. Invoke when user wants to create test cases for an API endpoint.
安全使用建议
This skill will search project config files, resolve environment-variable placeholders, and connect to MySQL and Redis to read schemas and data (and can run arbitrary SQL). That is consistent with generating test cases but it means the skill can access sensitive credentials and production data. Before installing or running it: 1) Inspect application.yaml and the provided data_reader.py yourself; confirm no unexpected network calls or hardcoded endpoints. 2) Do not point it at production databases — use a sanitized or read-only replica. 3) Ensure you trust the skill source (owner unknown) or run in an isolated environment/container. 4) Verify that any database connections are read-only and consider removing or disabling execute_query if you only want SELECTs. 5) Ask the publisher to update registry metadata to explicitly declare required credentials and intended safeguards. If you cannot validate these, treat the skill as potentially risky and avoid running it against sensitive systems.
功能分析
Type: OpenClaw Skill
Name: testcase-gen
Version: 2.0.1
The skill bundle is designed to extract sensitive database credentials and records from MySQL and Redis by parsing local application configuration files (e.g., Spring Boot's application.yaml). While the stated purpose is generating test cases, the 'scripts/data_reader.py' script and 'SKILL.md' instructions grant the AI agent broad access to potentially sensitive data and include methods for executing arbitrary SQL queries. These high-risk capabilities are plausibly related to the tool's function but lack sufficient access controls, making the bundle a significant vector for data exposure if misused.
能力评估
Purpose & Capability
The name/description (generate test cases from MySQL/Redis data) aligns with the included code and SKILL.md: the skill reads application.yaml, extracts DB/Redis connection info, reads table schema/data and Redis keys, then emits test-case JSON. However the registry metadata declares no required environment variables or credentials even though the skill is explicitly designed to consume DB credentials (from config or ${VAR:default} env substitutions). This mismatch is noteworthy.
Instruction Scope
SKILL.md instructs the agent to read Controller/Service/Entity source code and service configuration and to run scripts that will connect to databases and Redis and read data. The included data_reader.py supports executing arbitrary SQL (execute_query) and scanning Redis keys (SCAN) and will resolve ${VAR:default} environment expressions. Those actions are within the stated purpose but also give the skill ability to access sensitive secrets and arbitrarily query the data store; the instructions do not contain explicit safeguards (e.g., non-production enforcement, read-only mode).
Install Mechanism
There is no install spec (instruction-only skill plus a single Python script). That keeps attack surface lower than remote downloads or package installs. The script does import third-party libs (pymysql, redis) but only warns if they are missing.
Credentials
The skill metadata declares no required env vars or primary credential, yet the runtime expects to find DB/Redis credentials in application YAML or via environment variable substitution. The script will read environment variables referenced in configs (via ${VAR:default}) and will therefore access secrets if present. The mismatch between declared requirements (none) and actual behavior (needs DB/Redis creds) is an incoherence and a privacy risk.
Persistence & Privilege
always is false and the skill does not request persistent or elevated platform privileges. It does not attempt to modify other skills or global agent settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install testcase-gen - 安装完成后,直接呼叫该 Skill 的名称或使用
/testcase-gen触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.0.1
Version 2.0.1
- Major refactor: removed old scripts, added unified data reading module.
- Added scripts/data_reader.py for MySQL and Redis data extraction.
- Removed scripts/jtest_generator.py, scripts/run_generator.py, and scripts/testcase_parser.py.
- The skill now focuses on generating comprehensive test cases (JSON) from database sources, intended for later use by JUnit test generators.
v2.0.0
Initial release of JUnit 5 test generator for Spring Boot:
- Added core scripts: `jtest_generator.py`, `run_generator.py`, `testcase_parser.py`
- Removed configuration files, advanced prompt templates, and all test case/quality assessment/export/review scripts from previous version
- Now generates JUnit 5 test classes from JSON test case files produced by "Test Case Generator"
- Supports batch conversion, API and service layer tests, and follows Spring Boot/JUnit 5 best practices
- Simplified workflow focused solely on transforming JSON test cases to Java test code
v1.0.0
- Major simplification and redesign: reduced feature set to focus on test case generation from real MySQL/Redis data.
- Removed all advanced exports, quality scoring, prompt customization, config management, and review scripts.
- New workflow: connect to MySQL/Redis, analyze business/service code, and generate comprehensive test cases based on actual data.
- Added new script `data_reader.py` for reading MySQL and Redis according to a given YAML config.
- All previous scripts and reference materials are removed; only the essential data reading and generation flow is retained.
元数据
常见问题
testcase-generator 是什么?
Generates comprehensive test cases from MySQL/Redis data. Invoke when user wants to create test cases for an API endpoint. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 121 次。
如何安装 testcase-generator?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install testcase-gen」即可一键安装,无需额外配置。
testcase-generator 是免费的吗?
是的,testcase-generator 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
testcase-generator 支持哪些平台?
testcase-generator 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 testcase-generator?
由 Hcyyy0120(@hcyyy0120)开发并维护,当前版本 v2.0.1。
推荐 Skills