Skip to main content

test-analyze

Analyze test results and create a fix plan with subagents. Use when triaging failing tests, analyzing JUnit XML, planning fixes for accessibility/security, or categorizing flaky/E2E failures.

来源信息

仓库
laurigates/claude-plugins
最近来源活动
2026年10月13日 07:22
检测到的 SKILL.md 语言
英语
星标
59
Forks
6

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
3 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
description
Analyze test results and create a fix plan with subagents. Use when triaging failing tests, analyzing JUnit XML, planning fixes for accessibility/security, or categorizing flaky/E2E failures.
args
<results-path> [--type <test-type>] [--focus <area>]
argument-hint
Path to test results (e.g., ./test-results/), optional --type and --focus filters
allowed-tools
Task, Read, Glob, Grep, TodoWrite
created
2025-12-16T00:00:00.000Z
modified
2026-10-11T00:00:00.000Z
reviewed
2026-09-02T00:00:00.000Z
name
test-analyze
agent
general-purpose
context
fork
# Test Analysis and Fix Planning Analyzes test results from any testing framework, uses PAL planner to create a systematic fix strategy, and delegates fixes to appropriate subagents. ## When to Use This Skill | Use this skill when... | Use test-report instead when... | |---|---| | Triaging a directory of failing-test results into a fix plan | You only need a quick cached status read | | Categorizing flaky, performance, accessibility, or security failures | Running the tests in the first place (use test-run) | | Delegating fixes to specialized subagents | Asking strategic "how should we test X?" questions (use test-consult) | | Producing a structured plan from JUnit XML or coverage output | Iterating on a single failing spec (use test-focus) | ## Usage ```bash /test:analyze <results-path> [--type <test-type>] [--focus <area>] ``` ## Parameters - `<results-path>`: Path to test results directory or file (required) - Examples: `./test-results/`, `./coverage/`, `pytest-report.xml` - `--type <test-type>`: Type of tests (optional, auto-detected if omitted) - `accessibility` - Playwright a11y, axe-core - `unit` - Jest, pytest, cargo test - `integration` - API tests, database tests - `e2e` - Playwright, Cypress, Selenium - `security` - OWASP ZAP, Snyk, TruffleHog - `performance` - Lighthouse, k6, JMeter - `--focus <area>`: Specific area to focus on (optional) - Examples: `authentication`, `api`, `ui-components`, `database` Examples, a flow overview, output shape, and related commands: [references/usage.md](references/usage.md). The **Prompt** below is the procedure. ## Subagent Routing **This table is the single source of truth for delegation.** Every `subagent_type` this skill dispatches is listed here; no other section restates it. The values are plugin-qualified `plugin:agent` IDs — the form the `Task`/`Agent` tool resolves for plugin-provided agents (a bare name only resolves for user- or project-level agents in `~/.claude/agents/` or `.claude/agents/`). It is also the contract the workflow harness's `category` enum and `AGENT_FOR` map encode — **edit them together.** `scripts/check-subagent-types.sh` fails CI if any value here stops resolving to a real `agents-plugin/agents/*.md`. | Issue category | Triggers | Dispatch | Focus to pass | |---|---|---|---| | Accessibility violations | WCAG, ARIA, colour contrast, keyboard nav | `subagent_type: agents-plugin:review` | WCAG 2.1 compliance, semantic HTML, ARIA best practices | | Security vulnerabilities | XSS, SQLi, CSRF, auth bypass | `subagent_type: agents-plugin:security-audit` | OWASP Top 10, input validation, authentication | | Performance issues | Slow tests/queries, memory leaks, timeouts | `subagent_type: agents-plugin:performance` | Profiling, bottleneck identification, optimization | | Code quality / smells | Duplication, complexity, coupling, maintainability | `subagent_type: agents-plugin:refactor` | SOLID principles, DRY, behaviour-preserving restructure | | Flaky tests / test infrastructure | Race conditions, timing, shared state, isolation | `subagent_type: agents-plugin:test` | Test stability, isolation, determinism | | Integration failures | Failing behaviour needing root-cause diagnosis | `subagent_type: agents-plugin:debug` | Root cause, minimal fix, verification | | Build / CI failures | Pipeline errors, dependency issues | `subagent_type: agents-plugin:ci` | GitHub Actions, dependency management, caching | | Documentation gaps | Missing docs, outdated examples | `subagent_type: agents-plugin:docs` | API docs, test documentation, migration guides | ## Workflow harness (template) `workflows/test-analyze.workflow.js` ships beside this skill. **It is a TEMPLATE to adapt, not a script to run verbatim.** Read it, then rewrite it for the work in front of you. **Adapt freely:** the agent prompts, the severity vocabulary, the result-file globs and format hints for your test framework, the `--focus` weighting, and the verification command each plan agent is told to emit. The parse stage runs on `agents-plugin:lean-reader` (Haiku 5.5, no CLAUDE.md, Read/Grep/Glob only), so its brief must carry everything it needs. Without `agents-plugin`, drop its `agentType`. **Preserve across any adaptation:** (a) the fan-out width comes from the `AGENT_FOR` table above — one agent per *agent type*, never a prose "for each failure", which is what caps the harness at 8 concurrent agents; (b) the `category` and `severity` enums in `RoutedFailuresSchema`, which force every failure either onto a route or into `unroutable[]` with a stated reason instead of the nearest-looking row; (c) the `parallel()` barrier before Synthesize — group agents emit `depends_on` edges pointing at failures in *other* groups, so the ordering only exists once every group has returned. **Agent budget:** 2 + agent types — parse and synthesize, plus one planning agent per routed agent type (at most 8, the `AGENT_FOR` table). The scale guard asks before every run, because the groups are derived from the parsed failures. **Skip the harness when:** there are fewer than 5 routable failures — the script returns `{mode:'inline'}` at that floor, because below it one opus agent per category costs more than the linear pass. That floor is a hard bound, not a tunable knob. The steps below remain the authoritative description of *what* each stage must produce; the harness only fixes *how* the work is split. Two consequences worth stating inline: - **The harness surrenders `mcp__pal-mcp-server__planner`.** A workflow script cannot reach MCP tools, so the dependency edges in the merged plan are *inferred by the group agents*, not planned. A run that genuinely needs PAL planning (Step 2 below) should stay inline. - **`context: fork` stays, and it is not what justifies the harness.** The pin lives in `scripts/plugin-compliance-check.sh` (the `for fork_skill in` loop inside `check_skill_body()` — cited by name, because a line number in that file drifts every time a regression guard is inserted) and is unchanged by this template. Per `.claude/rules/workflow-vs-skill.md` § "The `context: fork` corollary", fork already bought context isolation for free — so this harness has to earn its tokens by **splitting** the planning work across agent types behind a real barrier, which it does. The `parallel()` width is capped at the fixed agent-type set (8) precisely so it does not become the wide fan-out `.claude/rules/skill-fork-context.md` warns about. --- **Prompt:** Analyze test results from `<results-path>` and create a systematic fix plan. Bind the three values from `$ARGUMENTS` first (see [Parameters](#parameters)) — they come from the **caller**, and nothing substitutes them for you: | Value | Source | When absent | |---|---|---| | `<results-path>` | first non-flag token (required) | ask for it; do not guess a path | | `<test-type>` | `--type <test-type>` | auto-detect from the result files' formats and content | | `<focus-area>` | `--focus <area>` | analyze all areas with no prioritization bias | **Step 1: Analyze Test Results** Read the test result files from `<results-path>` and extract: - Failed tests with error messages - Warnings and deprecations - Performance metrics (if available) - Coverage gaps (if available) - Categorize by: severity (critical/high/medium/low), type (functional/security/performance/accessibility) **Step 2: Use PAL Planner** Call `mcp__pal-mcp-server__planner` (no model call; omit `model`) to create a systematic fix plan: - Step 1: Summarize findings and identify root causes - Step 2: Prioritize issues (impact × effort matrix) - Step 3: Break down fixes into actionable tasks - Step 4: Identify dependencies between fixes - Step 5: Assign each fix category to appropriate subagent - Continue planning steps as needed for complex scenarios **Step 3: Subagent Delegation Strategy** For each issue category found, look it up in the **Subagent Routing** table above and dispatch a `Task` with that row's `subagent_type` (a plugin-qualified `plugin:agent` ID) and that row's focus. Do not invent a `subagent_type` that is absent from the table — an unlisted value does not resolve and the dispatch fails. **Step 4: Create Execution Plan** For each subagent assignment: 1. **Context**: What files/areas need attention 2. **Objective**: Specific fix goal 3. **Success Criteria**: How to verify the fix 4. **Dependencies**: What must be done first 5. **Verification**: Commands to re-run tests **Step 5: Present Summary** Provide: - 📊 **Issue Breakdown**: Count by category and severity - 🎯 **Priorities**: Top 3-5 issues to fix first - 🤖 **Subagent Plan**: Which agents will handle what - ✅ **Next Steps**: Concrete actions to take - 🔍 **Verification**: How to confirm fixes worked When a `<focus-area>` was bound: prioritize issues related to that area and give the relevant subagents extra context about it. When none was passed, skip this — do not invent a focus. **Documentation-First Reminder**: Before implementing fixes, research relevant documentation using context7 to verify: - Test framework best practices - Accessibility standards (WCAG 2.1) - Security patterns (OWASP) - Performance optimization techniques **TDD Workflow**: Follow RED → GREEN → REFACTOR: 1. Verify tests fail (RED) ✓ (already done) 2. Implement minimal fix (GREEN) 3. Refactor for quality 4. Re-run tests to confirm Proceed with the analysis and planning now — this skill runs `context: fork` and cannot wait for a reply. Present the completed Step 5 summary as the deliverable; the caller reviews the plan after the fact, not before it.
在 GitHub 查看