check-test-diff

Blocks Git diffs that delete Go test files or remove more than 100 lines from them.

Updated Jan 19, 2026
One-click install
npx skills add https://github.com/COLDTURNIP/longhorn-workspace --skill check-test-diff
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: check-test-diff
Source: https://github.com/COLDTURNIP/longhorn-workspace/tree/main/.opencode/skills/check-test-diff
Command: npx skills add https://github.com/COLDTURNIP/longhorn-workspace --skill check-test-diff

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill prevents risky git diffs by blocking deletions or mass removals of Go test files.

Core Features & Use Cases

  • Guards against deletions of *_test.go files in diffs.
  • Flags large deletions in test files (>100 lines) and reports violations.
  • Ideal for CI/pre-merge checks to preserve test coverage.

Quick Start

Run the script to scan the current repository for test-file changes: bash ./check_test_diff.sh

You can also specify a repository path to run the check against: bash ./check_test_diff.sh --repo /path/to/your/repo

Frequently Asked Questions about check-test-diff

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

FAQPage Schema
How do I prevent accidental deletions of Go test files in a git pre-merge hook?

To prevent accidental deletions of Go test files in a pre-merge hook, you can run a script that scans git diffs for deleted *_test.go files and exits with a non-zero status to block the merge.

Can I block large removals of Go test code during CI workflows?

Yes, you can block large removals of Go test code during CI by flagging diffs that delete more than 100 lines from *_test.go files, emitting a clear report of the violations.

How do I check a specific repository path for destructive test file diffs?

To check a specific repository path for destructive test file diffs, run the check script with the --repo flag followed by your target directory path to scan for test file deletions.

What is considered a risky git diff for Go test files?

A risky git diff for Go test files includes any deletion of *_test.go files or mass removals exceeding 100 lines of test code, which are flagged to preserve test coverage.

Does this pre-merge check verify deletions against the current HEAD?

Yes, this pre-merge check verifies deletions against HEAD to accurately detect violations in the current branch's git diff before allowing a merge.