test-reporting-triage-skill
Automatically categorizes test failures, suggests responsible owners, and provides common fix checklists. Generates actionable test reports with failure analysis. Use for "test reporting", "failure triage", "test analysis", or "test automation".
What this skill does
# Test Reporting & Triage Skill
Automatically triage test failures and suggest next actions.
## Failure Categorization
```typescript
// types/test-failure.ts
export type FailureCategory =
| "timeout"
| "assertion"
| "network"
| "database"
| "authentication"
| "permission"
| "configuration"
| "flaky"
| "infrastructure"
| "unknown";
export interface TestFailure {
testName: string;
category: FailureCategory;
errorMessage: string;
stackTrace: string;
suggestedOwner: string;
suggestedFixes: string[];
runId: string;
timestamp: Date;
}
```
## Failure Analyzer
```typescript
// analyzers/failure-analyzer.ts
export class FailureAnalyzer {
categorize(error: Error, testName: string): TestFailure {
const errorMessage = error.message.toLowerCase();
const stackTrace = error.stack || "";
// Timeout detection
if (errorMessage.includes("timeout") || errorMessage.includes("exceeded")) {
return {
testName,
category: "timeout",
errorMessage: error.message,
stackTrace,
suggestedOwner: "Performance Team",
suggestedFixes: [
"Check if API is slow",
"Increase timeout value",
"Optimize database query",
"Check for network issues",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
// Network errors
if (
errorMessage.includes("econnrefused") ||
errorMessage.includes("network") ||
errorMessage.includes("fetch failed")
) {
return {
testName,
category: "network",
errorMessage: error.message,
stackTrace,
suggestedOwner: "DevOps Team",
suggestedFixes: [
"Check if service is running",
"Verify network connectivity",
"Check firewall rules",
"Verify DNS resolution",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
// Database errors
if (
errorMessage.includes("database") ||
errorMessage.includes("prisma") ||
errorMessage.includes("unique constraint")
) {
return {
testName,
category: "database",
errorMessage: error.message,
stackTrace,
suggestedOwner: "Backend Team",
suggestedFixes: [
"Check database connection",
"Verify test data cleanup",
"Check for race conditions",
"Review migration status",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
// Authentication errors
if (
errorMessage.includes("unauthorized") ||
errorMessage.includes("authentication") ||
errorMessage.includes("401")
) {
return {
testName,
category: "authentication",
errorMessage: error.message,
stackTrace,
suggestedOwner: "Auth Team",
suggestedFixes: [
"Check auth token validity",
"Verify test user credentials",
"Check session expiration",
"Review auth middleware",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
// Assertion failures
if (
errorMessage.includes("expected") &&
errorMessage.includes("received")
) {
return {
testName,
category: "assertion",
errorMessage: error.message,
stackTrace,
suggestedOwner: this.determineOwnerFromPath(stackTrace),
suggestedFixes: [
"Review recent code changes",
"Check if test expectations are correct",
"Verify test data setup",
"Check for breaking changes",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
// Default: unknown
return {
testName,
category: "unknown",
errorMessage: error.message,
stackTrace,
suggestedOwner: "On-Call Engineer",
suggestedFixes: [
"Review error message and stack trace",
"Check recent commits",
"Run test locally to reproduce",
"Add more specific error handling",
],
runId: process.env.CI_RUN_ID || "local",
timestamp: new Date(),
};
}
private determineOwnerFromPath(stackTrace: string): string {
if (stackTrace.includes("/frontend/")) return "Frontend Team";
if (stackTrace.includes("/backend/")) return "Backend Team";
if (stackTrace.includes("/api/")) return "API Team";
if (stackTrace.includes("/database/")) return "Database Team";
return "Development Team";
}
}
```
## Test Report Generator
```typescript
// reporters/test-report.ts
import { FailureAnalyzer } from "../analyzers/failure-analyzer";
export class TestReporter {
private analyzer = new FailureAnalyzer();
private failures: TestFailure[] = [];
recordFailure(error: Error, testName: string) {
const failure = this.analyzer.categorize(error, testName);
this.failures.push(failure);
}
generateReport(): string {
const grouped = this.groupByCategory();
const report: string[] = [];
report.push("# Test Failure Report\n");
report.push(`Generated: ${new Date().toISOString()}\n`);
report.push(`Total Failures: ${this.failures.length}\n\n`);
// Summary by category
report.push("## Summary by Category\n");
Object.entries(grouped).forEach(([category, failures]) => {
report.push(`- ${category}: ${failures.length} failures`);
});
report.push("\n");
// Detailed failures
report.push("## Detailed Failures\n\n");
Object.entries(grouped).forEach(([category, failures]) => {
report.push(`### ${category.toUpperCase()} (${failures.length})\n\n`);
failures.forEach((failure, i) => {
report.push(`#### ${i + 1}. ${failure.testName}\n`);
report.push(`**Owner:** ${failure.suggestedOwner}\n\n`);
report.push(`**Error:**\n\`\`\`\n${failure.errorMessage}\n\`\`\`\n\n`);
report.push(`**Suggested Fixes:**\n`);
failure.suggestedFixes.forEach((fix) => {
report.push(`- ${fix}\n`);
});
report.push("\n");
});
});
return report.join("");
}
generateSlackMessage(): string {
const grouped = this.groupByCategory();
const messages: string[] = [];
messages.push("๐ด *Test Failures Detected*\n");
messages.push(`Total: ${this.failures.length} failures\n`);
Object.entries(grouped).forEach(([category, failures]) => {
const icon = this.getCategoryIcon(category);
messages.push(`${icon} ${category}: ${failures.length}`);
});
// Top 3 failures
messages.push("\n*Top Failures:*");
this.failures.slice(0, 3).forEach((failure, i) => {
messages.push(`\n${i + 1}. \`${failure.testName}\``);
messages.push(` Owner: @${failure.suggestedOwner}`);
});
return messages.join("\n");
}
private groupByCategory(): Record<string, TestFailure[]> {
return this.failures.reduce((acc, failure) => {
if (!acc[failure.category]) {
acc[failure.category] = [];
}
acc[failure.category].push(failure);
return acc;
}, {} as Record<string, TestFailure[]>);
}
private getCategoryIcon(category: string): string {
const icons: Record<string, string> = {
timeout: "โฑ๏ธ",
network: "๐",
database: "๐พ",
authentication: "๐",
assertion: "โ",
flaky: "๐",
infrastructure: "๐๏ธ",
unknown: "โ",
};
return icons[category] || "โ";
}
}
```
## Common Fix Checklists
```typescript
// checklists/fix-checklists.ts
export const fixChecklists = {
timeout: {
title: "Timeout Failure Checklist",
steps: [
"โ Check if the timeout is too short",
"โ Verify API response time in logs",
"โ Check database query performance",
"โ Look for network latency issues",
"โ Verify no infinite loops or deadRelated in Data & Analytics
clawarr-suite
IncludedComprehensive management for self-hosted media stacks (Sonarr, Radarr, Lidarr, Readarr, Prowlarr, Bazarr, Overseerr, Plex, Tautulli, SABnzbd, Recyclarr, Unpackerr, Notifiarr, Maintainerr, Kometa, FlareSolverr). Deep library exploration, analytics, dashboard generation, content management, request handling, subtitle management, indexer control, download monitoring, quality profile sync, library cleanup automation, notification routing, collection/overlay management, and media tracker integration (Trakt, Letterboxd, Simkl).
querying-soql
IncludedSOQL query generation, optimization, and analysis with 100-point scoring. Use this skill when the user needs SOQL/SOSL authoring or optimization: natural-language-to-query generation, relationship queries, aggregates, query-plan analysis, and performance or safety improvements for Salesforce queries. TRIGGER when: user writes, optimizes, or debugs SOQL/SOSL queries, touches .soql files, or asks about relationship queries, aggregates, or query performance. DO NOT TRIGGER when: bulk data operations (use handling-sf-data), Apex DML logic (use generating-apex), or report/dashboard queries.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
habit-flow
IncludedAI-powered atomic habit tracker with natural language logging, streak tracking, smart reminders, and coaching. Use for creating habits, logging completions naturally ("I meditated today"), viewing progress, and getting personalized coaching.
app-store-optimization
IncludedApp Store Optimization (ASO) toolkit for researching keywords, analyzing competitor rankings, generating metadata suggestions, and improving app visibility on Apple App Store and Google Play Store. Use when the user asks about ASO, app store rankings, app metadata, app titles and descriptions, app store listings, app visibility, or mobile app marketing on iOS or Android. Supports keyword research and scoring, competitor keyword analysis, metadata optimization, A/B test planning, launch checklists, and tracking ranking changes.
visualizing-data
IncludedBuilds dashboards, reports, and data-driven interfaces requiring charts, graphs, or visual analytics. Provides systematic framework for selecting appropriate visualizations based on data characteristics and analytical purpose. Includes 24+ visualization types organized by purpose (trends, comparisons, distributions, relationships, flows, hierarchies, geospatial), accessibility patterns (WCAG 2.1 AA compliance), colorblind-safe palettes, and performance optimization strategies. Use when creating visualizations, choosing chart types, displaying data graphically, or designing data interfaces.