https://github.com/pardnio/skill-coverage-generate
https://github.com/pardnio/skill-coverage-generate
agentskills ai-generated
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/pardnio/skill-coverage-generate
- Owner: pardnio
- License: mit
- Created: 2026-02-28T17:51:02.000Z (4 months ago)
- Default Branch: master
- Last Pushed: 2026-03-01T16:20:34.000Z (4 months ago)
- Last Synced: 2026-04-24T17:35:29.989Z (about 2 months ago)
- Topics: agentskills, ai-generated
- Homepage:
- Size: 7.81 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
> [!NOTE]
> This document is available in Traditional Chinese: [README.zh.md](./README.zh.md)
# skill-coverage-generate [](LICENSE)
> A Claude Code Skill that automatically analyzes Go test coverage per function and generates table-driven test cases to bring projects to ≥90% coverage threshold.
> Invoke `/coverage-generate` from any Go project directory — it discovers source files, measures coverage, and writes missing test cases end-to-end.
## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Usage](#usage)
- [CLI Reference](#cli-reference)
- [License](#license)
## Features
- **Automated Coverage Analysis**: Runs `go test -coverprofile` and parses per-function coverage to identify gaps below 90%
- **Smart Test Generation**: Creates table-driven tests covering nominal, nil input, boundary, error path, and context cancellation scenarios
- **Multi-Package Support**: Processes entire Go modules via `./...`, handling all packages in one run
- **Intelligent Exclusions**: Skips `main.go`, generated files (`*.pb.go`, `*_generated.go`), and `init()` functions automatically
- **Quality Gates**: Validates compilation with `go build ./...` and re-runs coverage after generation to confirm improvement
## Installation
```bash
git clone https://github.com/pardnchiu/skill-coverage-generate ~/.claude/skills/coverage-generate
```
## Usage
From within a Go project directory, invoke the skill:
```
/coverage-generate
```
Claude will run the full 4-phase workflow — discovery, analysis, generation, and validation — and report the before/after coverage delta.
## CLI Reference
### Workflow Phases
| Phase | Action | Tool |
|-------|--------|------|
| 1. Discovery | Find non-test Go source files | `find` |
| 2. Analysis | Generate coverage report | `go test -coverprofile=coverage.out ./...` |
| 3. Generation | Parse gaps and write tests | `go tool cover -func=coverage.out` |
| 4. Validation | Compile + re-measure coverage | `go build ./...`, `go test ./...` |
### Excluded Files
| Pattern | Reason |
|---------|--------|
| `*_test.go` | Already test files |
| `*.pb.go`, `*_generated.go` | Generated code |
| `main.go` | Integration test scope |
| `init()` functions | Not directly testable |
## License
This project is licensed under the [MIT LICENSE](LICENSE).