AGENT SKILL

mh-cto-sdlc-test-health

暂无简介

License 许可
MIT
最近更新
2026-05-13
Stars
★ 2
Forks
0

02 资源文件 2

03 SKILL.md 正文

Test Suite Health Review

A flaky test suite is a dead test suite. Once the team learns to re-run tests that fail intermittently and expect them to pass on retry, the suite loses its authority. Failures are noise. Real failures get ignored. This is not a slow decline — it is a sudden collapse when a serious regression slips through.

This skill measures three properties of the test suite:

  1. Reliability — do tests produce consistent results? (flakiness rate)
  2. Relevance — does the suite still cover what matters? (coverage alignment with risk)
  3. Maintainability — is the suite getting harder to change over time? (maintenance burden)

Run on a cadence, not just at cycle end. This skill is designed to be invoked periodically — ideally every 2-4 sprints — not just at Phase 8. A suite that was healthy at Phase 5 may have drifted significantly after 10 sprints of active development.

Step 1 — Load Testing Strategy Context

Read Phase 5 outputs: test-strategy.md (risk matrix, coverage targets), cicd-gates-spec.md (gate thresholds).

The Phase 5 targets are the baseline against which this review measures drift.

Step 2 — Flakiness Audit

A flaky test is any test that produces different results on the same commit without code changes.

For each test suite layer (unit, integration, e2e, performance, contract):

Suite Layer Total Tests Flaky Count Flakiness Rate Acceptable?
Unit {N} {N} {%} <1%
Integration {N} {N} {%} <2%
E2E {N} {N} {%} <5%
Contract {N} {N} {%} 0%
Performance {N} {N} {%} <10%

Flakiness thresholds:

  • Contract tests at >0% flakiness: BLOCKER — contract tests must be deterministic
  • Unit tests at >1%: address immediately
  • E2E at >10%: suite is degraded; team is likely ignoring it

For each flaky test, classify the root cause:

  • Test isolation failure: test depends on shared state from another test
  • Timing sensitivity: test assumes things happen in a fixed time window
  • External dependency: test calls a real external service or clock
  • Environment inconsistency: test behaves differently across environments
  • Assertion fragility: test asserts on non-deterministic output (order, timestamps, IDs)

Step 3 — Coverage Drift Analysis

Compare current coverage against Phase 5 targets:

Target Phase 5 Threshold Current Drift Status
Unit coverage {N%} {N%} {±N%} ✅/⚠/❌
Integration coverage {N%} {N%} {±N%} ✅/⚠/❌
Critical path e2e coverage {N%} {N%} {±N%} ✅/⚠/❌

Coverage drift analysis:

  • Coverage dropping toward gate threshold: ⚠ — flag for next sprint
  • Coverage below gate threshold: ❌ — CI gate should be failing; investigate

Risk-coverage alignment: The Phase 5 risk matrix identified high-risk areas. Are they still adequately covered?

High-Risk Area Risk Level Current Coverage Adequate?
{area} High {%} Yes/No

Step 4 — Maintenance Burden Assessment

How hard is the test suite to change?

Quantitative signals:

  • Average time to add a test for a new behavior: {estimate}
  • Average time for a non-test code change to require test updates: {estimate}
  • Number of tests that required changes last sprint NOT due to intentional behavior change: {N} (brittle test indicator)

Test architecture smells:

Smell Present? Count Example
Test helpers >200 lines Yes/No {N} {file}
Tests with >10 assertions Yes/No {N} {file}
Setup/teardown >20 lines Yes/No {N} {file}
Tests that share mutable state Yes/No {N} {file}
Magic numbers/strings in tests Yes/No {N} {file}

Overall maintainability: High / Medium / Low

High = adding a test takes <5 min; Low = adding a test requires understanding >3 files of setup.

Step 5 — Remediation Plan

Prioritize by impact:

Immediate (this sprint):

  • {any contract test flakiness}
  • {unit flakiness >1%}
  • {coverage below CI gate threshold}

Near-term (next 2 sprints):

  • {E2E flakiness >5%}
  • {high-risk areas with coverage gaps}
  • {brittle tests causing maintenance drag}

Backlog:

  • {structural smells that are not yet causing pain}
  • {performance suite flakiness if <10%}

Step 6 — Write Output

Save to _mh-output/cto/sdlc/test-health/{YYYY-MM-DD}_{r###}_test-suite-health-report.md:

# Test Suite Health Report

**Product:** {name}
**Review date:** {date}
**Sprints since last review:** {N}

---

## Health Summary

| Property                | Status                              | Critical Issues |
| ----------------------- | ----------------------------------- | --------------- |
| Reliability (Flakiness) | ✅ Healthy / ⚠ Degraded / ❌ Broken | {N issues}      |
| Relevance (Coverage)    | ✅ / ⚠ / ❌                         | {N issues}      |
| Maintainability         | ✅ / ⚠ / ❌                         | {N issues}      |

**Overall health:** Healthy / Degraded / Broken

---

## Flakiness Audit

{Table from Step 2}

**Flaky test root causes:**
{Classification table}

## Coverage Drift

{Table from Step 3}

## Maintenance Burden

{Quantitative signals and smell table from Step 4}

## Remediation Plan

### Immediate

{List}

### Near-term

{List}

### Backlog

{List}

Step 7 — Present Summary

Test Suite Health Review complete.

Overall health: {Healthy / Degraded / Broken}

Flaky tests: {N} across all layers — {N} require immediate attention.

Coverage drift: {summary of any layers below threshold}

Next step: Run /mh-cto-sdlc-roadmap-refresh once all Phase 8 synthesis is complete.

04 同仓库更多 Skills

Imad-Oute
Imad-Oute/MicroHard

mh-vo-vault-brief

Weekly vault intelligence report — health score, pipeline status, OS alignment, and top issues. Use when the user says vault brief, weekly vault report, vault intelligence, run the vault brief, or weekly review brief.

★ 2
Imad-Oute
Imad-Oute/MicroHard

mh-vo-output-bridge

Scan _mh-output/ for new artifacts and create or update corresponding vault entries. Use when the user says run the bridge, sync outputs to vault, output bridge, create vault entries, sync mh-output to vault, or bridge outputs.

★ 2
Imad-Oute
Imad-Oute/MicroHard

mh-vo-moc-builder

Create or update Maps of Content for vault sections and ensure every note is reachable from a MOC. Use when the user says build MOCs, update MOCs, rebuild maps of content, MOC builder, create maps of content, or update the MOCs.

★ 2
Imad-Oute
Imad-Oute/MicroHard

mh-vo-link-architect

Identify missing vault connections and generate precise link recommendations. Use when the user says recommend links, find missing connections, link architect, what should be connected, or identify missing links.

★ 2
Imad-Oute
Imad-Oute/MicroHard

mh-vo-base-builder

Generate Obsidian Bases (.base files) for live database views of vault data. Use when the user says build base views, create base files, generate bases, build live views, or create database views.

★ 2
Imad-Oute
Imad-Oute/MicroHard

mh-vo-taxonomy-enforcer

Audit vault tags and frontmatter, find drift, and apply corrections. Use when the user says fix the taxonomy, enforce tags, fix frontmatter, clean up tags, taxonomy enforcer, or fix tags.

★ 2