Skip to content

chore: move the unit-test convention into a go-unit-tests skill#122

Merged
Postlog merged 4 commits into
mainfrom
chore/go-unit-tests-skill
Jun 30, 2026
Merged

chore: move the unit-test convention into a go-unit-tests skill#122
Postlog merged 4 commits into
mainfrom
chore/go-unit-tests-skill

Conversation

@Postlog

@Postlog Postlog commented Jun 28, 2026

Copy link
Copy Markdown
Owner

What

Extract the unit-test rules out of AGENTS.md into a tracked go-unit-tests skill
(.claude/skills/go-unit-tests/). The AGENTS.md «Unit tests» section now references the
skill as the single source of truth instead of duplicating the convention inline.

Why

The convention (strict table-driven, testify, gomock-from-contract.go) is operational
guidance an author applies when writing tests — a skill is its natural home, and this keeps
AGENTS.md focused on architecture. The skill also encodes finer rules the prose
under-emphasized: one build-func per dependency, entity-based contract.go interface names
(<entity>Repo/Service/Client; role names like deleter forbidden), and that subgen
repository tests are integration (//go:build integration + dbtest), not mock unit tests.

Changes

  • add .claude/skills/go-unit-tests/SKILL.md
  • AGENTS.md: replace the «Unit tests» section body with a pointer to the skill (−51/+9)
  • CHANGELOG.md: entry

No Go code changed; go build ./... is green. The broader architecture sections in AGENTS.md
(the contract.go+mockgen dependency declaration, error wrapping, Public API, and the apitest /
integration-test section) are intentionally kept.

🤖 Generated with Claude Code

Postlog and others added 4 commits June 28, 2026 18:29
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]>
@Postlog Postlog merged commit 1705f64 into main Jun 30, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant