agentleFS
intelintel/torch-xpu-ops/.claude/skills/ut-check/SKILL.md

ut-check

Skill121 starsChanged 5 months agoApache-2.0View on GitHub

Analyze UT (unit test) results for a torch-xpu-ops PR. Use when asked to check test results, analyze CI failures, or evaluate test coverage for a PR. Produces a structured report of new failures, failure relevance, and new test coverage.

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 7 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Read the UT data JSON at the path given in the request (default /tmp/ut_data.json).

    line 13
  2. Distinctive:

    Read the JSON. Understand the scope: failure count, changed files, new tests.

    line 75
  3. Distinctive:

    If you change a classification, briefly say why.

    line 90
  4. Very specific:

    Use new_tests_summary: passed, failed, skipped, not_run.

    line 94
  5. Distinctive:

    Follow the output format below exactly.

    line 99
  6. Very specific:

    If failures is empty and new_tests is empty, produce a concise report (New Failures: none.

    line 104
  7. Very specific:

    If the data looks internally inconsistent (e.g.

    line 106
  8. Distinctive:

    Do not invent a "Failure Relevance Analysis" for failures that are all clearly unrelated.

    line 109
  9. Very specific:

    New failures: If more than 20, show the first 20, then add: ...

    line 114
  10. Very specific:

    New/modified tests: If more than 20, show the first 20, then add: ...

    line 116
  11. Distinctive:

    Always include the total count so the reader knows the full scope.

    line 120
  12. Very specific:

    Every report MUST include: the New Failures section (with the Related to PR?

    line 124
  13. Distinctive:

    Omit sections that have no content: If the PR adds no tests, omit "New Test Coverage".

    line 158
  14. Distinctive:

    If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: ut-check.

    line 161

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

UT Result Check Skill

Analyze unit test results for a torch-xpu-ops PR: identify new failures, assess whether they relate to the PR changes, and verify new test coverage.

Quick start

  1. Read the UT data JSON at the path given in the request (default /tmp/ut_data.json). If it is missing or unreadable, say so and stop -- never reconstruct the data from elsewhere.
  2. Analyze it following the workflow below. The data is self-contained; no sub-agents or extra CI queries are needed.
  3. Emit the report as your final message. The calling workflow posts it as the PR comment -- do not post a comment yourself.

Input

The UT data is provided as a JSON file (typically /tmp/ut_data.json) produced by .github/scripts/bot_ut_check.py. The script already de-duplicates failures, classifies each failure's relevance, summarizes new-test coverage, and computes a baseline verdict. The JSON contains:

{
  "pr_number": 1234,
  "run_id": 56789,
  "failures": [
    {"category": "op_ut", "class": "a.b.TestFoo", "test": "test_bar",
     "status": "failed", "message": "...", "relevance": "Related"}
  ],
  "changed_files": {
    "operator_source": ["src/ATen/native/xpu/Foo.cpp"],
    "test_files": ["test/xpu/test_foo_xpu.py"],
    "skip_lists": [],
    "other": []
  },
  "new_tests": ["TestFoo::test_bar"],
  "new_tests_summary": {
    "passed": ["TestFoo::test_bar"],
    "failed": [],
    "skipped": [],
    "not_run": []
  },
  "passed_tests_count": 12345,
  "totals": {"test_cases": 0, "passed": 0, "skipped": 0,
             "failures": 0, "errors": 0},
  "verdict": "Safe to merge",
  "verdict_reason": "No new failures detected."
}

Ground Truth for New Failures

The authoritative source for new failures is the UT-Check-* artifacts which contain <ut_job>/new_failures.csv. This CSV is produced by the CI check job: ut_results.py identifies new failures (not in the known issues list) and enriches them with error messages.

The UT-Data-* artifact holds the raw reports (junit/*.xml), and the check's <ut_job>/cases/ut_failure_list.csv is the unfiltered failure list (known failures included); bot_ut_check.py reads only new_failures.csv and de-duplicates by (category, class, test). If you ever see the same failure listed twice, treat it as a single failure and note the collection anomaly.

Analysis Workflow

Step 1: Read the Data

Read the JSON. Understand the scope: failure count, changed files, new tests.

Step 2: Review / Refine Failure Relevance

Each failure already carries a deterministic relevance (Related / Possibly related / Unrelated) computed from the changed files. Trust it as a baseline, but refine using the error message and your judgment:

  • Related -- failure is in a test module that directly tests an operator or test file this PR modifies.
  • Possibly related -- failure is in a related subsystem or a plausible side effect of the change.
  • Unrelated -- failure is in an unrelated module; likely pre-existing flake or infrastructure issue (e.g. missing shared library, download error).

If you change a classification, briefly say why.

Step 3: Evaluate New Test Coverage

Use new_tests_summary: passed, failed, skipped, not_run. Newly added tests that FAILED or did NOT RUN are a concern and must be called out.

Step 4: Produce the Report

Follow the output format below exactly. Apply the truncation rules strictly.

Guardrails: Do Not Post Low-Quality Comments

  • Never fabricate or guess counts. Report exactly what the JSON contains.
  • If failures is empty and new_tests is empty, produce a concise report (New Failures: none; Recommendation) rather than padding with empty tables.
  • If the data looks internally inconsistent (e.g. a failure count that seems implausible for the diff, or totals missing), state the uncertainty plainly in the Recommendation instead of asserting a confident verdict.
  • Do not invent a "Failure Relevance Analysis" for failures that are all clearly unrelated; a one-line grouping is enough.

Truncation Rules

  • New failures: If more than 20, show the first 20, then add: ... and N more failure(s). See CI logs for the full list.
  • New/modified tests: If more than 20, show the first 20, then add: ... and N more new test(s). See CI logs for the full list.
  • Changed files: Summarize as counts per category.

Always include the total count so the reader knows the full scope.

Output Format

Every report MUST include: the New Failures section (with the Related to PR? column), a New Test Coverage summary line with counts whenever the PR adds tests, and a Recommendation with an explicit safe-to-merge verdict.

VERDICT: <one sentence — safe to merge or not, and why>

## UT Result Check: PR #<number>

### New Failures
<count> new failure(s) detected (not in known issues). / No new failures detected.

| Test | Category | Status | Related to PR? |
|------|----------|--------|----------------|
| `ClassName::test_name` | category | failed | Related / Possibly related / Unrelated |
...

### Failure Relevance Analysis
Brief explanation, grouping related failures together. Omit if there are no
failures or all are trivially unrelated (a one-line note then suffices).

### New Test Coverage
This PR adds/modifies **<N>** test(s): <p> passed, <f> failed, <s> skipped, <n> not run.

| New/Modified Test | Status |
|-------------------|--------|
| `ClassName::test_name` | PASSED / FAILED / SKIPPED / NOT RUN |
...

### Recommendation
**<Safe to merge | Likely safe to merge | Investigate before merging | Not safe to merge>.**
One-to-two sentence justification grounded in the failures and new-test results.

Omit sections that have no content. If the PR adds no tests, omit "New Test Coverage". Always keep the "New Failures" and "Recommendation" sections.

If a calling workflow explicitly requires a skill marker, append this exact literal final line: Custom skills applied: ut-check.

Otherwise, keep the reply in the requested report format and do not force an extra trailing sentence.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.