← 返回
未分类 中文

Skill Test Generator

Automatically generate test documentation for existing skills that have scripts but lack testing guidance. Use when a skill has scripts/ directory but no TES...
自动为已有脚本但缺少测试指南的技能生成测试文档。当技能包含 scripts/ 目录但没有测试时使用。
834948655 834948655 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 347
下载
💾 0
安装
1
版本
#latest

概述

Skill Test Generator

Overview

This skill analyzes existing skill scripts and automatically generates comprehensive test documentation. It identifies scripts in the scripts/ directory, analyzes their functionality, and produces test cases covering both normal and exceptional scenarios.

When to Use This Skill

Use this skill when:

  • A skill has scripts but lacks testing documentation
  • You need to create TESTING.md for a skill
  • You want to add a testing section to an existing SKILL.md
  • You need test case examples for skill scripts

Workflow

Step 1: Analyze Scripts

First, identify and analyze the scripts in the target skill:

  1. List all files in the skill's scripts/ directory
  2. Read each script to understand its purpose and parameters
  3. Identify entry points, inputs, outputs, and dependencies

Step 2: Generate Test Cases

For each script, generate test cases covering:

Normal Cases:

  • Standard usage with valid inputs
  • Typical parameter combinations
  • Expected successful execution paths

Edge Cases:

  • Empty or minimal inputs
  • Boundary values (max/min lengths, sizes)
  • Special characters and encoding
  • Invalid file paths or missing files
  • Permission issues
  • Malformed arguments

Error Cases:

  • Missing required parameters
  • Invalid parameter types
  • Non-existent input files
  • Network failures (if applicable)
  • Resource exhaustion scenarios

Step 3: Create Test Documentation

Generate documentation in one of two formats:

Option A: Create TESTING.md

Create a standalone testing document with:

  • Test case tables (ID, Description, Input, Expected Output, Command)
  • Test execution instructions
  • Environment setup requirements

Option B: Update SKILL.md

Add a "Testing" section to the existing SKILL.md with:

  • Overview of test approach
  • Test case summaries
  • Example commands

Step 4: Provide Test Commands

Include concrete test command examples that can be copied and executed:

# Example test commands for a hypothetical script
python scripts/process_data.py --input test_data/valid.json
python scripts/process_data.py --input test_data/empty.json  # Edge case
python scripts/process_data.py --input nonexistent.json      # Error case

Test Case Format

Use this standard format for test cases:

IDScriptTypeDescriptionInputExpected OutputCommand
----------------------------------------------------------------
TC001process.pyNormalProcess valid JSON{"key": "value"}Success, output file createdpython scripts/process.py input.json
TC002process.pyEdgeProcess empty fileEmpty fileGraceful handling, empty outputpython scripts/process.py empty.json
TC003process.pyErrorMissing input fileN/AError message, exit code 1python scripts/process.py missing.json

Resources

scripts/

  • test_template.py - Template generator for creating test case documentation

Example Output

When run against a skill with scripts, this skill produces:

  1. TESTING.md (or updated SKILL.md section) containing:
    • Test case inventory
    • Test execution commands
    • Expected results for each test
  1. Test commands ready to copy-paste and execute

Best Practices

  1. Cover the happy path first - Ensure basic functionality works
  2. Test boundaries - Check min/max values, empty inputs
  3. Verify error handling - Scripts should fail gracefully
  4. Document prerequisites - Note any required test data or environment setup
  5. Make commands executable - Provide copy-paste ready commands

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 15:03 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 681 📥 330,007
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 78 📥 182,652
knowledge-management

Skill Doc Enhancer

834948655
Automatically analyze and enhance content-short SKILL.md files by analyzing skill directory structure, adding usage exam
★ 0 📥 433