跳到正文
TakoAPI
返回技能列表

sovereign-test-generator

由 ryudi84 提供

Web & Frontend Development
303下载量由 clawskills.sh 提供
0浏览量
0 个赞登录后即可为这个技能点赞
—暂无评分
你的评分

简介

Analyzes codebases and generates comprehensive test suites.

描述

该技能的功能

Analyzes source code and generates runnable test suites covering unit tests, integration tests, edge cases, and mocking strategies. Supports JavaScript/TypeScript with Jest and Vitest, Python with pytest, and Go and Rust. Prioritizes error paths and boundary conditions over hitting coverage number targets.

It systematically triages code by complexity and coupling before writing any tests, so the highest-risk paths get covered first rather than the easiest ones.

何时使用

  • Writing unit tests for a newly built API endpoint
  • Generating mocking strategies for code that calls databases or external APIs
  • Adding edge case coverage to input validation logic
  • Setting up integration tests that verify HTTP request and response contracts
  • Creating parameterized test cases for functions with many valid and invalid input variants

示例工作流

输入

User asks: Write tests for this UserService class that creates users and sends welcome emails

智能体
  1. 1

    Identify the public API surface: createUser and getUser methods

  2. 2

    Assess complexity and coupling: database queries and email service calls flagged as high-priority targets

  3. 3

    Plan mocking strategy: stub UserRepository return values, mock EmailService to verify call arguments

  4. 4

    Generate complete Jest test file with imports, typed mocks, beforeEach hooks, and named describe blocks

  5. 5

    Cover edge cases including duplicate email, weak password, email service failure, and database rollback verification

输出

A complete Jest test file with all imports, typed mocks, shared fixtures, and test cases for the happy path, validation errors, and failure modes including rollback behavior

安装

clawhub install ryudi84/sovereign-test-generator

运行 CLI 命令,或把这段提示词粘贴到 Claude Code、Cursor、Codex 或你在用的任意编程智能体里。

链接