Test Structure Analysis

Analyze Go test and source files to identify coverage gaps without executing tests.

112|305|Updated Oct 10, 2025
One-click install
npx skills add https://github.com/openshift-eng/ai-helpers --skill test-structure-analysis
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Test Structure Analysis
Source: https://github.com/openshift-eng/ai-helpers/tree/main/plugins/test-coverage/skills/analyze
Command: npx skills add https://github.com/openshift-eng/ai-helpers --skill test-structure-analysis

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Analyze test code structure directly from Go test files without running tests to identify coverage gaps and untested areas.

Core Features & Use Cases

  • Discover test and source files based on Go conventions
  • Parse test files to extract tests, line ranges, targets, and test types
  • Parse source files to enumerate functions, methods, and types
  • Map tests to source code and identify coverage gaps
  • Generate HTML, JSON, and text reports under .work/test-coverage/analyze/

Quick Start

Run the skill against a file or directory: /test-coverage:analyze <path-to-test-or-dir>

Frequently Asked Questions about Test Structure Analysis

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I identify test coverage gaps in Go projects without running tests?

Test coverage analysis examines Go test files and source code statically to map which functions and files lack tests. This Skill parses test and source files using Go conventions, discovers test types (unit, integration, e2e), and generates reports showing untested areas without executing any tests.

What test types does Go test structure analysis discover?

Go test structure analysis identifies unit tests, integration tests, and end-to-end (e2e) tests using Go naming patterns and markers. It extracts test names, line ranges, and their target functions or packages to classify tests and map coverage comprehensively.

Can I analyze test coverage for Go projects with Python and a Go toolchain?

Yes, test structure analysis requires Python 3.8+ and a Go toolchain to parse files and run analysis. These tools enable discovery of Go test and source files, extraction of test and function metadata, and generation of coverage reports.

What report formats does Go test coverage analysis generate?

Test structure analysis generates three report formats: HTML for visual inspection, JSON for programmatic use, and text summaries. All reports are written to `.work/test-coverage/analyze/` and include details on test-to-source mappings and coverage gaps.

How do I run test coverage analysis on a specific file or directory?

Run the analysis using `/test-coverage:analyze <path>` where path points to a Go test file, source file, or directory. The Skill discovers relevant files, parses them according to Go conventions, maps tests to sources, and outputs reports to `.work/test-coverage/analyze/`.

What happens if a Go function has no tests?

Functions without tests are flagged in the coverage reports as untested areas. Test structure analysis identifies files and functions lacking test coverage by comparing parsed source code against discovered tests, highlighting gaps for targeted test development.