test-coverage-check
Check whether changed source files have corresponding test files. Use for code quality review before merging a PR, or when asked whether new code has tests.
- License 许可
- MIT
- 最近更新
- 2026-05-15
- Stars
- ★ 13
- Forks
- 1
01 前言 Front Matter
- name
- test-coverage-check
- agent
- Explore
- title
- test-coverage-check
- context
- fork
- description
- Check whether changed source files have corresponding test files. Use for code quality review before merging a PR, or when asked whether new code has tests.
- allowed-tools
- Grep Glob Read Bash(git diff *) Bash(find *)
02 资源文件 1
- 参考文档agents/openai.yaml160 B
03 SKILL.md 正文
Check whether changed source files have test coverage.
Changed source files
!git diff --name-only HEAD~1 2>/dev/null || git diff --name-only origin/main...HEAD 2>/dev/null || echo "none"
Filter the list above to source files only. Exclude:
- Files already in test directories (
test/,spec/,__tests__/,tests/) - Files with
.test.,.spec.in the name - Non-source files:
.md,.json,.yaml,.yml,.lock,.txt,.env,.gitignore - Configuration files:
*.config.ts,*.config.js,vite.config.*,jest.config.*
If the output was "none" or after filtering there are no source files, output: COVERAGE FINDINGS: none — no changed source files detected
Check each source file
For each changed source file, derive candidate test file paths using these conventions:
Given source file src/utils/parser.ts, check for:
src/utils/parser.test.tssrc/utils/parser.spec.tssrc/utils/__tests__/parser.tssrc/utils/__tests__/parser.test.tstests/utils/parser.test.tstests/utils/parser.spec.tstest/utils/parser.test.tstest/utils/parser.spec.ts
Apply the same pattern for .py, .js, .jsx, .tsx, .go, .rb files, substituting the appropriate test file extension:
- Python:
_test.pyortest_<name>.py - JavaScript/TypeScript:
.test.js,.spec.js,.test.ts,.spec.ts - Go:
_test.goin the same directory - Ruby:
_spec.rbinspec/
Use Glob to check whether any of the candidate paths exist.
If a test file is found, use Grep to check whether it imports or requires the source file, or references the source file's name. If no import is found, mark as "test file exists but may not cover new changes".
Output format
Output exactly:
COVERAGE FINDINGS:
- <source-file> — no test file found
- <source-file> — test file exists but may not cover new changes
Examples:
COVERAGE FINDINGS:
- src/auth/loginHandler.ts — no test file found
- src/utils/formatDate.ts — test file exists but may not cover new changes
If all changed source files have test files that reference them: output exactly COVERAGE FINDINGS: none
Do not add any prose before or after the findings block.
04 同仓库更多 Skills
tag-version
Bump the package version and create an annotated git tag. Accepts a semantic version number (1.2.0) or a bump type (patch, minor, major). Does not push — use the publish skill to push. Use as part of a release workflow.
release
Run the complete release workflow: changelog entry, version bump, git tag, and GitHub release. Invokes changelog-entry, tag-version, and publish in sequence. Use when releasing a new version of the project.
publish
Push the current branch and all tags to origin, then create a GitHub release using the latest tag and its CHANGELOG.md entry. Use after tag-version to complete a release.
changelog-entry
Draft the changelog entry for all unreleased commits in Keep a Changelog format. Groups commits into Added, Changed, Fixed, Removed, and Security. Use before releasing a new version or when updating CHANGELOG.md.
auto-format-on-edit
Automatically format code files after every edit using Prettier and ESLint. Active in the background whenever Claude edits a file. Formatting is silent — no prompts, no output unless a formatter fails. Use when you want consistent formatting enforced automatically during a coding session.
code-quality-audit
Run a comprehensive code quality audit covering security, performance, and maintainability. Use for quarterly audits, pre-release reviews, or when onboarding to a large codebase.