用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/lefant/agent-skills --skill test-analyzer命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| name | test-analyzer |
| description | Analyze test failures from CTRF reports using jq for deterministic parsing |
| invocationPattern | when user asks to analyze test failures, investigate failing tests, or understand test patterns |
Analyze CTRF test reports to identify failure patterns, suggest fixes, and provide insights into test health. Uses deterministic jq parsing for efficient, token-friendly analysis.
Call this skill when:
Using ctrf-utils.sh:
ctrf-utils.sh summary <file> # Show pass/fail summary
ctrf-utils.sh failures <file...> # List failed test names
ctrf-utils.sh failures-detail <file> # Show failures with error messages
ctrf-utils.sh flaky <file> # Show tests with retry attempts
ctrf-utils.sh slowest <N> <file> # Show N slowest tests
Direct jq commands:
jq '.results.summary' report.ctrf.json
jq -r '.results.tests[] | select(.status == "failed") | .name' report.ctrf.json
CTRF reports have this structure:
{
"results": {
"tool": { "name": "vitest" },
"summary": { "tests": 50, "passed": 48, "failed": 2, "skipped": 0 },
"tests": [
{
"name": "should validate user input",
"status": "failed",
"duration": 156,
"suite": "UserForm",
"message": "Expected true, received false",
"filePath":
Required fields per test: name, status, duration
Full schema: ctrf-schema.json
jq '.results.summary' /workspace/artifacts/test/vitest.ctrf.json
jq -r '.results.summary | "Tests: \(.tests) | Passed: \(.passed) | Failed: \(.failed)"' /workspace/artifacts/test/vitest.ctrf.json
jq -r '.results.tests[] | select(.status == "failed") | .name' /workspace/artifacts/test/*.ctrf.json
jq -r '.results.tests[] | select(.status == "failed") | "❌ \(.name): \(.message // "No message")"' /workspace/artifacts/test/*.ctrf.json
jq '[.results.tests[] | select(.status == "failed")] | group_by(.message) | map({error: .[0].message, count: length, tests: map(.name)}) | sort_by(.count) | reverse' /workspace/artifacts/test/*.ctrf.json
jq '.results.tests | sort_by(.duration) | reverse | limit(10; .[]) | {name, duration}' /workspace/artifacts/test/vitest.ctrf.json
jq -r '.results.tests[] | select(.retries > 0 or .flaky == true) | "⚠️ \(.name) (retries: \(.retries // 0))"' /workspace/artifacts/test/*.ctrf.json
jq -r '[.results.tests[] | select(.status == "failed") | .filePath] | unique | .[]' /workspace/artifacts/test/vitest.ctrf.json
jq -s '{vitest: .[0].results.summary.failed, pytest: .[1].results.summary.failed, total: ((.[0].results.summary.failed // 0) + (.[1].results.summary.failed // 0))}' /workspace/artifacts/test/vitest.ctrf.json /workspace/artifacts/test/pytest.ctrf.json
jq -c '{summary: .results.summary, failures: [.results.tests[] | select(.status == "failed") | {name, suite, message, file: "\(.filePath):\(.line)"}]}' /workspace/artifacts/test/*.ctrf.json
For comprehensive examples (24+), see: jq-examples-comprehensive.md
Implementation scripts:
Context and research behind this approach:
When invoked:
Locate CTRF reports (common locations: artifacts/test/, test-results/, project root)
Get summary:
jq -r '.results.summary | "Tests: \(.tests) | Passed: \(.passed) | Failed: \(.failed)"' *.ctrf.json
If failures exist, list them:
jq -r '.results.tests[] | select(.status == "failed") | "❌ \(.name): \(.message // "No message")"' *.ctrf.json
Analyze patterns (group similar errors):
jq '[.results.tests[] | select(.status == "failed")] | group_by(.message) | map({error: .[0].message, count: length})' *.ctrf.json
Read source files for failed tests (extract file paths with jq, then read)
Suggest fixes based on patterns (group similar errors, identify root causes)
Rewrite prose (docs, READMEs, PR descriptions, error messages, release notes, comments, tool descriptions, system prompts — never code) into ASD-STE100 Simplified Technical English to remove "AI slop". Use when asked to make writing not sound like AI, make docs clear or plain, enforce a controlled writing style, review text for STE violations, or write technical documentation that reads human. Two modes — strict (procedures/safety) and STE-flavored (general prose).
Access GitHub repositories programmatically using the exe.dev GitHub integration, gh CLI, or REST API. Use when interacting with GitHub repositories, issues, pull requests, workflows, discussions, or actions. On exe.dev VMs, prefer the tokenless GitHub integration before falling back to local gh authentication or GH_TOKEN.
Use when browser automation needs a human checkpoint: the user wants to demonstrate a workflow once, watch and verify an agent-driven browser result before proceeding, log in or complete MFA/credential-sensitive steps manually, connect through VNC, or use agent-browser with human-in-the-loop browser control. This skill sets up and operates the bundled Browser Debug Hub runtime with safe loopback VNC/CDP defaults.
基于 SOC 职业分类