一键导入
write-tests
Write or update unit tests for changed code, following project conventions and ensuring coverage meets the 80% threshold.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Write or update unit tests for changed code, following project conventions and ensuring coverage meets the 80% threshold.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | write-tests |
| description | Write or update unit tests for changed code, following project conventions and ensuring coverage meets the 80% threshold. |
Read the source module(s). Focus on:
Skip: third-party internals, Streamlit UI, trivial pass-throughs.
Tests in tests/ mirror source modules:
| Source | Test file |
|---|---|
src/databao_cli/commands/init.py | tests/test_init.py |
src/databao_cli/commands/build.py | tests/test_build.py |
src/databao_cli/mcp/tools/<name>.py | tests/test_mcp.py |
src/databao_cli/commands/datasource/add.py | tests/test_add_datasource.py |
Add to existing file when possible.
pytest only, no unittest.TestCase.project_layout fixture for project dirs, tmp_path for filesystem.click.testing.CliRunner, import cli from databao_cli.__main__.test_<action>_<scenario>.-> None on all test functions.Specific assertions over truthiness. Include context:
assert result.exit_code == 0, f"Expected success but got: {result.output}"
uv run pytest tests/test_<module>.py -v
make test-cov-check
Repeat until 80% threshold met.
Run make check. Fix ruff/mypy errors in test code.
Run the full development pipeline autonomously without pausing between phases. Stops only on quality-gate failures.
Run test coverage measurement, analyze results, and fix gaps when coverage falls below the 80% threshold.
Fetch unresolved PR review threads, triage them, implement fixes, validate, reply in-thread, and resolve.
Stage, commit, push, and open a GitHub PR following project conventions. Use when code is ready to ship.
Run structured evaluations on skills to measure quality and track improvements.
Review local code changes for correctness, regressions, missing tests, and Databao-specific risks.