skills/automate-tests/SKILL.md
Discover and execute repository test commands safely with evidence-based command selection and safety guardrails.
npx skillsauth add nesnilnehc/ai-cortex automate-testsInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
确定目标存储库期望如何执行自动化测试(命令、框架、先决条件和范围),然后使用安全第一的交互策略运行最佳匹配的测试套件。
首要目标:通过基于证据的命令选择和安全护栏生成测试执行结果。
成功标准(必须满足所有要求):
验收测试:开发人员可以在没有额外上下文的情况下按照测试计划摘要重现测试执行吗?
本技能负责:
本技能不负责:
转交点:当测试完成(通过或失败)时,移交给“自动修复”以修复故障或“审查测试”以进行质量评估。
建立范围和约束(询问是否不明确)
fast:仅进行单元测试,最少的设置。ci:尽可能接近地镜像 CI 工作流命令。full:包括集成/e2e 测试和服务依赖项。发现测试计划(基于证据)
CLAUDE.md 或 .ai-cortex/config.yaml,优先读取其中的 test_command;否则按以下来源发现。参见 docs/guides/project-config.md。README.md、CONTRIBUTING.md、TESTING.md、docs/testing*、Makefile.github/workflows/*.yml、.gitlab-ci.yml、azure-pipelines.yml、Jenkinsfilepackage.json、pyproject.toml、setup.cfg、tox.ini、go.mod、pom.xml、build.gradle*、*.csproj、Cargo.tomlnpm test、pnpm test、yarn test、pytest、tox、go test、dotnet test、mvn test、gradle test、cargo test等)选择执行计划
有护栏执行
不要做这些(其他技能可以处理它们):
review-codebase何时停止并交接:
rm -rf、git clean、docker system prune、数据库删除)?开发人员可以在没有额外上下文的情况下通过遵循测试计划摘要来重现测试执行吗?
如果否:测试计划摘要不完整。添加缺失的证据、命令或先决条件。
如果是:技能执行完成。如果需要,继续转交。
用户:“为此存储库运行测试。”
代理人:
package.json 脚本和 .github/Workflows/*。npm test (或者 pnpm test / yarn test 如果仓库对其进行了标准化)
3.询问:“安装依赖项(npm ci)并允许网络?”npm cinpm 测试用户:“在本地镜像 CI。”
代理:
.github/workflows/ci.yml 并识别单独的作业:
development
Generate an LLM agent test suite (golden cases, mock-LLM unit tests, evaluator harness) from an agent implementation and its agent-test contract. Use when an agent has no tests, or a contract exists but the test code is missing.
development
After code changes, auto-detect the project's build system and local deployment method for a given directory, then build the project and restart its locally-deployed environment (Docker Compose / systemd / process manager). Never assumes — asks only when detection is ambiguous. Caches detected commands per project in .cortex/redeploy-local.yaml; re-invocations on the same project skip re-scanning until signal files change, the cache expires (30 days), or the skill version bumps.
tools
Publish a NATS message conforming to a cross-team contract, using NATS MCP tools. Authors the contract on first use if missing. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting basics across sessions.
tools
Drain pending NATS messages from a producer contract via NATS MCP tools (default batch / drain-style). Applies Tolerant Reader semantics and per-message ack/nak/term, returning aggregated stats. Reads project-level cache (.cortex/nats.yaml) to avoid re-prompting.