common-architecture-di…
Draw architecture diagrams as editable draw.io files with a fixed house style, C4 levels, and evidence-tagged shapes. Use when producing a system context,…
Write unit tests with table-driven patterns and interface mocking in Go. Use when writing Go unit tests, table-driven tests, or using mock interfaces.
$ npx -y skills add hoangnguyen0403/agent-skills-standard --skill golang-testing --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/golang-testingContext preview
The summary Claude sees to decide when to auto-load this skill.
Write unit tests with table-driven patterns and interface mocking in Go. Use when writing Go unit tests, table-driven tests, or using mock interfaces.
name: golang-testing
description: Write unit tests with table-driven patterns and interface mocking in Go. Use when writing Go unit tests, table-driven tests, or using mock interfaces.
metadata:
triggers:
files:
- '**/*_test.go'
keywords:
- testing
- unit tests
- go test
- mocking
- testify1. **Write failing test first** — Follow Red-Green-Refactor TDD workflow. 2. **Use table-driven tests** — Define test cases as slice of structs; iterate with `t.Run()`. 3. **Zero Volatile Fields for Struct Comparison** — When asserting struct equality, zero out timestamps, dynamic IDs, or generated tokens before `assert.Equal` to prevent flaky assertions. 4. **Mock via interfaces** — Use DI and interfaces. Prefer `mockery` for auto-generated mocks or manual mocks for simple cases. 5. **Run parallel** — Use `t.Parallel()` for non-sequential tests to speed up CI. 6. **Clean up resources** — Use `t.Cleanup()` to restore state or release DB/file resources. 7. **Check coverage** — Aim for >80% line coverage. Run `go test -cover` to audit.
See [table-driven test examples](references/table-driven-tests.md)
The portable SDLC standards layer for AI coding agents. Sync once, then work in your own runtime.
Repo: hoangnguyen0403/agent-skills-standard
Draw architecture diagrams as editable draw.io files with a fixed house style, C4 levels, and evidence-tagged shapes. Use when producing a system context,…
Enforce SOLID principles, guard-clause style, function size limits, and intention-revealing naming across all languages. Use when refactoring for readability,…
Standardize BRD and BRD-lite discovery for business goals, stakeholder impact, current-to-future state, and measurable value outcomes. Use when creating BRD,…
Conduct high-quality, persona-driven code reviews. Use when reviewing PRs, critiquing code quality, or analyzing changes for team feedback.
Maximize context window efficiency, reduce latency, and prevent lost-in-middle issues through strategic masking and compaction. Use when token budgets are…
Standardize dynamic application security testing for backend APIs, frontend web apps, and mobile clients. Covers ZAP, Nuclei, Nikto, sqlmap, ffuf, browser…