360 Secure SkillHub
360 安全技能中心

unit-test-namer

根据被测单元与行为条件,给出 2–3 个 test_... 或 it(...) 风格的测试函数名,并避免 vague words;不生成测试体,也不运行测试。依赖为空,仅处理文本。

hmahmadcs
hmahmadcs
热度 27.56
最近更新 2026-10-17 20:52:19
分类:开发依赖:纯提示词应用场景:代码生成

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add hmahmadcs/unit-test-namer
Metadata
name
unit-test-namer
description
Suggest clear unit-test function names from a short behavior description. Use when writing tests and stuck on naming.

Unit Test Namer

Purpose / Overview

Turns a behavior phrase into 2–3 test_... / it(...) style names.

When to Use

  • Authoring new tests
  • Renaming vague tests like test1

Usage / Instructions

  1. Ask for the unit under test and the behavior.
  2. Prefer users' pattern in other test cases,if not found use this pattern: test_<unit>_<condition>_<expected>.
  3. Avoid vague words: correct, works, success.

Examples

Input: "user with empty email is rejected" Output: test_create_user_rejects_empty_email

Requirements / Dependencies

None.

Limitations / Caveats

Does not generate test bodies.

Security / Permissions

Text-only.

Description

Suggest clear unit-test function names from a short behavior description.

License or terms

MIT

Use case

Use when you are the operator responsible for tasks described as: Suggest clear unit-test function names from a short behavior description.

Risks and mitigations

References

Ethical considerations

Illegal use of this skill is not allowed. The publisher will not be accountable for outcomes arising from unlawful use under country or international law. Prohibited examples include breaking into accounts without authorization, deploying ransomware, and trafficking in stolen personal data. Misuse against third-party systems without authorization is illegal.