用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/zhuxixi/zima-blue-cli --skill gen-test命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | gen-test |
| description | Generate pytest unit tests for a given source module or function |
Generate pytest unit tests for a target Python module or function.
/gen-test zima/models/agent.py — generate tests for the agent model/gen-test zima/config/manager.py::ConfigManager.save_config — generate tests for a specific methodRead the target source file to understand its public API, classes, and functions.
Determine the test file path using the project convention:
zima/foo/bar.py -> Test: tests/unit/test_foo_bar.py (flattened with underscores)zima/models/agent.py -> tests/unit/test_models_agent.pyGenerate tests following these conventions:
TestIsolator (from tests/base.py) when filesystem/config isolation is neededmonkeypatch for ZIMA_HOME isolation (handled by TestIsolator)tests/conftest.py (config_manager, cli_runner, unique_code, isolated_zima_home)pytest.raises for expected exceptionstmp_path or TestIsolator.get_test_path() for temp filesExample test structure:
"""Tests for <module description>."""
import pytest
from zima.<module> import <TargetClass>
from tests.base import TestIsolator
class Test<TargetClass>(TestIsolator):
"""Tests for <TargetClass>."""
def test_<behavior>_success(self):
"""Test <behavior> with valid input."""
# arrange
...
# act
result = ...
# assert
assert result == expected
def test_<behavior>_invalid_input(self):
"""Test <behavior> raises on invalid input."""
with pytest.raises(ValueError):
...
After generating, run the test to verify it passes:
pytest <test_file> -v
Report the test file path, number of tests generated, and pass/fail status.