generating-test-reports
Generate comprehensive test reports with metrics, coverage, and visualizations. Use when performing specialized testing. Trigger with phrases like "generate test report", "create test documentation", or "show test metrics".
What this skill does
# Test Report Generator ## Overview Generate structured, human-readable test reports from raw test runner output including JUnit XML, Jest JSON, pytest results, and coverage data. Produces Markdown summaries, HTML dashboards, and CI-compatible annotations. ## Prerequisites - Test results in a parseable format (JUnit XML, Jest `--json`, pytest `--junitxml`, or TAP) - Coverage data files (Istanbul `coverage-summary.json`, `lcov.info`, or `coverage.xml`) - Node.js or Python available for report generation scripts - Git history accessible for trend analysis across commits ## Instructions 1. Locate all test result files using Glob patterns (`**/junit.xml`, `**/test-results.json`, `**/coverage/lcov.info`). 2. Parse each result file and extract: - Total test count, passed, failed, skipped, and error counts. - Execution duration per test suite and per individual test. - Failure messages, stack traces, and assertion details. 3. Parse coverage data and extract: - Line, branch, function, and statement coverage percentages. - Per-file coverage breakdown identifying files below threshold. - Uncovered line ranges for targeted improvement. 4. Compute aggregate metrics: - Overall pass rate as a percentage. - Total execution time and average test duration. - Top 10 slowest tests with file paths and durations. - Coverage delta compared to the previous commit (if git history is available). 5. Generate a Markdown report with sections for summary, failures, coverage, and performance. 6. Optionally generate an HTML report with sortable tables and coverage heatmaps. 7. Write CI-compatible output (GitHub Actions job summary, GitLab report artifacts, or Slack webhook payload). ## Output - `test-report.md` -- Markdown summary with pass/fail table, coverage stats, and failure details - `test-report.html` -- Self-contained HTML report (optional) - Coverage summary table with per-file breakdown and delta from baseline - Slowest tests list ranked by execution time - CI annotation comments on failed test lines (GitHub Actions `::error` format) ## Error Handling | Error | Cause | Solution | |-------|-------|---------| | No test result files found | Tests did not run or output path is incorrect | Verify test runner `--outputFile` or `--junitxml` flag; check the output directory exists | | Malformed JUnit XML | Test runner crashed mid-output or encoding issues | Validate XML with `xmllint`; re-run failed test suite; check for binary output in XML | | Coverage data missing | Tests ran without `--coverage` flag | Add `--coverage` to the test command; verify coverage reporter is configured | | Metric trend unavailable | No previous report to compare against | Generate baseline report first; store reports as CI artifacts for historical comparison | | Report exceeds GitHub comment limit | Too many failures produce oversized Markdown | Truncate failure details to top 20; link to full report artifact | ## Examples **Markdown report structure:** ```markdown ## Test Results -- 2026-03-10 | Metric | Value | |--------|-------| | Total Tests | 847 | # 847 = configured value | Passed | 839 (99.1%) | # 839 = configured value | Failed | 5 | | Skipped | 3 | | Duration | 42.3s | ### Coverage | Category | Current | Threshold | Status | |----------|---------|-----------|--------| | Lines | 87.2% | 80% | PASS | | Branches | 74.1% | 70% | PASS | | Functions | 91.5% | 85% | PASS | ### Failed Tests 1. `src/utils/parser.test.ts` -- "handles malformed input" -- Expected Error but received null 2. `src/api/auth.test.ts` -- "rejects expired tokens" -- Timeout after 5000ms ``` **GitHub Actions job summary integration:** ```bash cat test-report.md >> "$GITHUB_STEP_SUMMARY" ``` ## Resources - Jest `--json` reporter: https://jestjs.io/docs/cli#--json - JUnit XML format specification: https://github.com/testmoapp/junitxml - Istanbul coverage reporters: https://istanbul.js.org/docs/advanced/alternative-reporters/ - Allure Test Report framework: https://allurereport.org/ - GitHub Actions job summaries: https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#adding-a-job-summary
Related in Code Review
gstack
IncludedFast headless browser for QA testing and site dogfooding. Navigate pages, interact with elements, verify state, diff before/after, take annotated screenshots, test responsive layouts, forms, uploads, dialogs, and capture bug evidence. Use when asked to open or test a site, verify a deployment, dogfood a user flow, or file a bug with screenshots. (gstack)
startup-due-diligence
IncludedLegal due diligence review for seed-stage and Series A startups (US, Delaware C-Corp focus). Supports both investor and founder perspectives. Capabilities include: (1) Interactive document review and issue spotting; (2) Document request list generation; (3) Cap table and SAFE/convertible note analysis; (4) Red flag identification with severity ratings; (5) Diligence report generation. TRIGGERS: due diligence, DD, startup investment, cap table review, Series A, seed round, investor diligence, legal review startup, SAFE analysis, convertible note, 409A, founder vesting.
interview-master
IncludedThis skill should be used when the user asks to "generate interview questions", "prepare for interview", "optimize resume", "conduct mock interview", "analyze git commits for resume", "generate resume from code", "review my resume", or mentions interview preparation, career assistance, or extracting project experience from git history. Provides comprehensive interview and career development guidance for both job seekers and interviewers.
fix-issue
IncludedFixes GitHub issues using parallel analysis agents for root cause investigation, code exploration, and regression detection. Reads issue context from gh CLI, searches codebase and memory for related patterns, generates a fix with tests, and links the resolution back to the issue via PR. Includes prevention analysis to avoid recurrence. Use when debugging errors, resolving regressions, fixing bugs, or triaging issues.
sf-apex
IncludedGenerates and reviews Salesforce Apex code with 150-point scoring. TRIGGER when: user writes, reviews, or fixes Apex classes, triggers, test classes, batch/queueable/schedulable jobs, or touches .cls/.trigger files. DO NOT TRIGGER when: LWC JavaScript (use sf-lwc), Flow XML (use sf-flow), SOQL-only queries (use sf-soql), or non-Salesforce code.
swift-development
IncludedComprehensive Swift development for building, testing, and deploying iOS/macOS applications. Use when Claude needs to: (1) Build Swift packages or Xcode projects from command line, (2) Run tests with XCTest or Swift Testing framework, (3) Manage iOS simulators with simctl, (4) Handle code signing, provisioning profiles, and app distribution, (5) Format or lint Swift code with SwiftFormat/SwiftLint, (6) Work with Swift Package Manager (SPM), (7) Implement Swift 6 concurrency patterns (async/await, actors, Sendable), (8) Create SwiftUI views with MVVM architecture, (9) Set up Core Data or SwiftData persistence, or any other Swift/iOS/macOS development tasks.