chore: move the unit-test convention into a go-unit-tests skill#122
Merged
Conversation
Extract the unit-test rules from AGENTS.md into a tracked .claude/skills/go-unit-tests skill and have AGENTS.md reference it as the source of truth, instead of duplicating the table-driven / testify / gomock-from-contract.go convention inline. Co-Authored-By: Claude Opus 4.8 <[email protected]>
…to a pointer Rewrite the go-unit-tests skill description to say WHEN to apply the skill (triggering scenarios) instead of summarizing its rules, and reduce the AGENTS.md "Unit tests" section to a single sentence pointing at the skill. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Move "A note on scope" to the beginning of the skill and reduce it to a single statement that these rules apply in full only to unit tests; drop the detailed Integration/API and repository-tests subsections. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Tighten the intro and the scope note (cover integration / API / e2e generically). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Extract the unit-test rules out of
AGENTS.mdinto a trackedgo-unit-testsskill(
.claude/skills/go-unit-tests/). TheAGENTS.md«Unit tests» section now references theskill as the single source of truth instead of duplicating the convention inline.
Why
The convention (strict table-driven,
testify,gomock-from-contract.go) is operationalguidance an author applies when writing tests — a skill is its natural home, and this keeps
AGENTS.mdfocused on architecture. The skill also encodes finer rules the proseunder-emphasized: one build-func per dependency, entity-based
contract.gointerface names(
<entity>Repo/Service/Client; role names likedeleterforbidden), and that subgenrepository tests are integration (
//go:build integration+dbtest), not mock unit tests.Changes
.claude/skills/go-unit-tests/SKILL.mdAGENTS.md: replace the «Unit tests» section body with a pointer to the skill (−51/+9)CHANGELOG.md: entryNo Go code changed;
go build ./...is green. The broader architecture sections inAGENTS.md(the
contract.go+mockgen dependency declaration, error wrapping, Public API, and the apitest /integration-test section) are intentionally kept.
🤖 Generated with Claude Code