[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6CFNFW5GHVA150TB17Y89WN":3,"skill-same:01M6CFNFW5GHVA150TB17Y89WN":108},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":39,"linkOnly":40,"markdownContent":41,"markdownBody":42,"frontMatter":43,"refName":62,"commitSha":63,"skillDirectory":64,"forksCount":65,"repositoryHtmlUrl":66,"repositoryHomepageUrl":6,"ownerHtmlUrl":67,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":68,"install":69,"resources":81},"01M6CFNFW5GHVA150TB17Y89WN","golang-testing",null,"Production-ready Golang tests — table-driven tests, testify suites and mocks, parallel tests, fuzzing, fixtures, goroutine leak detection with goleak, snapshot testing, code coverage, integration tests, idiomatic test naming. Use when writing or reviewing Go tests, choosing a testing approach, setting up Go test CI, or debugging flaky\u002Fslow tests. For testify-specific APIs see `golang-stretchr-testify`; for measurement methodology see `golang-benchmark`.","rockcookies\u002Fskills","rockcookies","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F3498265?v=4","01M6CF9C16X3SDSKZX6ANH7HQM","Jacob He","01M6CF9C53JP821FCW6R9B00AJ",1,"MIT","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002FSKILL.md",[],[19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],"testing","golang","golang testing","cc","up","ready","snapshot","coverage","edit","write","read","projects","Bash","ci","git","benchmark","code","debugging","go","writing","2026-11-10 10:12:30",false,"---\nname: golang-testing\ndescription: >-\n  Production-ready Golang tests — table-driven tests, testify suites and mocks,\n  parallel tests, fuzzing, fixtures, goroutine leak detection with goleak,\n  snapshot testing, code coverage, integration tests, idiomatic test naming. Use\n  when writing or reviewing Go tests, choosing a testing approach, setting up Go\n  test CI, or debugging flaky\u002Fslow tests. For testify-specific APIs see\n  `golang-stretchr-testify`; for measurement methodology see `golang-benchmark`.\nuser-invocable: true\nlicense: MIT\ncompatibility: >-\n  Designed for Claude Code, Codex or similar harness, and for projects using\n  Golang.\nmetadata:\n  author: samber\n  version: 1.3.0\n  openclaw:\n    emoji: ?\n    homepage: https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang\n    requires:\n      bins:\n        - go\n        - gotests\n    install:\n      - kind: go\n        package: github.com\u002Fcweill\u002Fgotests\u002Fgotests@latest\n        bins:\n          - gotests\nallowed-tools: >-\n  Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent\n  Bash(gotests:*) AskUserQuestion\npaths:\n  - '**\u002F*.go'\n---\n\n**Persona:** You are a Go engineer who treats tests as executable specifications. You write tests to constrain behavior, not to hit coverage targets.\n\n**Thinking mode:** Reason as thoroughly as possible for test strategy design and failure analysis — shallow reasoning misses edge cases and produces brittle tests that pass today but break tomorrow. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Orchestration mode:** Fan out the three sub-agents described in Audit mode (unit quality and coverage gaps, integration isolation, goroutine\u002Frace issues) for auditing a large test suite, and merge their findings into one gap report. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Write mode** — generating new tests for existing or new code. Work sequentially through the code under test; use `gotests` to scaffold table-driven tests, then enrich with edge cases and error paths.\n- **Review mode** — reviewing a PR's test changes. Focus on the diff: check coverage of new behaviour, assertion quality, table-driven structure, and absence of flakiness patterns. Sequential.\n- **Audit mode** — auditing an existing test suite for gaps, flakiness, or bad patterns (order-dependent tests, missing `t.Parallel()`, implementation-detail coupling). Launch up to 3 parallel sub-agents split by concern: (1) unit test quality and coverage gaps, (2) integration test isolation and build tags, (3) goroutine leaks and race conditions.\n- **Debug mode** — a test is failing or flaky. Work sequentially: reproduce reliably, isolate the failing assertion, trace the root cause in production code or test setup.\n\n> **Community default.** A company skill that explicitly supersedes `golang-testing` skill takes precedence.\n\n**Dependencies:**\n\n- gotests: `go install github.com\u002Fcweill\u002Fgotests\u002Fgotests@latest`\n\n# Go Testing Best Practices\n\nThis skill guides the creation of production-ready tests for Go applications. Follow these principles to write maintainable, fast, and reliable tests.\n\n## Best Practices Summary\n\n1. Table-driven tests MUST use named subtests -- every test case needs a `name` field passed to `t.Run`\n2. Integration tests MUST use build tags (`\u002F\u002Fgo:build integration`) to separate from unit tests\n3. Tests MUST NOT depend on execution order -- each test MUST be independently runnable\n4. Independent tests SHOULD use `t.Parallel()` when possible\n5. NEVER test implementation details -- test observable behavior and public API contracts\n6. Packages with goroutines SHOULD use `goleak.VerifyTestMain` in `TestMain` to detect goroutine leaks\n7. Use testify as helpers, not a replacement for standard library\n8. Mock interfaces, not concrete types\n9. Keep unit tests fast (\u003C 1ms), use build tags for integration tests\n10. Run tests with race detection in CI\n11. Include examples as executable documentation\n12. Test files MUST be named after the source file under test, not after the function or method being tested\n13. Test functions SHOULD appear in the same order as the functions\u002Fmethods they test in the source file\n\n## Test Structure and Organization\n\n### File Conventions\n\n```go\n\u002F\u002F package_test.go - tests in same package (white-box, access unexported)\npackage mypackage\n\n\u002F\u002F mypackage_test.go - tests in test package (black-box, public API only)\npackage mypackage_test\n```\n\nName the test file after the source file it tests, not after the function or method under test. Go's convention is one test file per source file (`foo.go` -> `foo_test.go`), because tools (`go test`, coverage reports, IDE \"jump to test\" navigation, `gotests`) and reviewers all resolve tests by source file, not by symbol. A source file usually declares several functions\u002Fmethods; splitting its tests by symbol name scatters them across many files and breaks that file-to-file mapping.\n\n```\n\u002F\u002F ✓ Good — one test file per source file\nhelloworld.go       -> helloworld_test.go   \u002F\u002F contains TestHelloWorld, TestAbcd, TestXyz, ...\n\n\u002F\u002F ✗ Bad — test file named after the function\u002Fmethod instead of the source file\nhelloworld.go       -> abcd_test.go         \u002F\u002F wrong: should be helloworld_test.go\n```\n\nException: very large source files MAY be split into multiple `_test.go` files by concern (e.g. `foo_test.go` + `foo_edgecases_test.go`), but each split file's name MUST still be derived from the source file name, never from an individual function name. Prefer keeping a single `_test.go` file per source file even when it grows large — splitting adds navigation overhead and is rarely worth it; reach for the exception only when a single file becomes genuinely unwieldy to browse or review.\n\nWithin a test file, order test functions to match the order their tested functions\u002Fmethods appear in the source file. A reader (human or agent) scrolling `foo.go` alongside `foo_test.go` can then find the matching test by position instead of searching; drift between the two orderings compounds every time either file grows.\n\n### Naming Conventions\n\n```go\nfunc TestAdd(t *testing.T) { ... }               \u002F\u002F function test\nfunc TestMyStruct_MyMethod(t *testing.T) { ... } \u002F\u002F method test\nfunc BenchmarkAdd(b *testing.B) { ... }          \u002F\u002F benchmark\nfunc ExampleAdd() { ... }                        \u002F\u002F example\nfunc FuzzAdd(f *testing.F) { ... }               \u002F\u002F fuzz test\n```\n\n## Table-Driven Tests\n\nTable-driven tests are the idiomatic Go way to test multiple scenarios. Always name each test case.\n\n```go\nfunc TestCalculatePrice(t *testing.T) {\n    tests := []struct {\n        name     string\n        quantity int\n        unitPrice float64\n        expected  float64\n    }{\n        {\n            name:      \"single item\",\n            quantity:  1,\n            unitPrice: 10.0,\n            expected:  10.0,\n        },\n        {\n            name:      \"bulk discount - 100 items\",\n            quantity:  100,\n            unitPrice: 10.0,\n            expected:  900.0, \u002F\u002F 10% discount\n        },\n        {\n            name:      \"zero quantity\",\n            quantity:  0,\n            unitPrice: 10.0,\n            expected:  0.0,\n        },\n    }\n\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            got := CalculatePrice(tt.quantity, tt.unitPrice)\n            if got != tt.expected {\n                t.Errorf(\"CalculatePrice(%d, %.2f) = %.2f, want %.2f\",\n                    tt.quantity, tt.unitPrice, got, tt.expected)\n            }\n        })\n    }\n}\n```\n\n## Common Pitfall: Assert Scope Leaking into Subtests\n\nNever create a testify `assert`\u002F`require` instance in the parent test function and reuse it inside `t.Run` closures. `assert.New(t)` captures the exact `*testing.T` it was built with, so if that `t` belongs to the parent, every failure raised inside the subtest gets attributed to the _parent_ test in `go test` output — the failing subtest itself still reports `--- PASS`, silently hiding which case broke. This happens whether or not the subtest calls `t.Parallel()`.\n\n```go\n\u002F\u002F WRONG -- `is` is bound to the parent's t\nfunc TestCalculatePrice(t *testing.T) {\n    is := assert.New(t)\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            is.Equal(tt.expected, CalculatePrice(tt.quantity, tt.unitPrice)) \u002F\u002F misattributed on failure\n        })\n    }\n}\n\n\u002F\u002F RIGHT -- each subtest builds its own instance from its own t\nfunc TestCalculatePrice(t *testing.T) {\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            is := assert.New(t)\n            is.Equal(tt.expected, CalculatePrice(tt.quantity, tt.unitPrice))\n        })\n    }\n}\n```\n\nVerify with a deliberately-broken case: if `go test -v -run TestName` shows `--- FAIL: TestName` but every `--- PASS: TestName\u002Fsubtest_name` line still says PASS, the assert scope is leaking.\n\n## Unit Tests\n\nUnit tests should be fast (\u003C 1ms), isolated (no external dependencies), and deterministic.\n\n## Testing HTTP Handlers\n\nUse `httptest` for handler tests with table-driven patterns. See [HTTP Testing](.\u002Freferences\u002Fhttp-testing.md) for examples with request\u002Fresponse bodies, query parameters, headers, and status code assertions.\n\n## Goroutine Leak Detection with goleak\n\nUse `go.uber.org\u002Fgoleak` to detect leaking goroutines, especially for concurrent code:\n\n```go\nimport (\n    \"testing\"\n    \"go.uber.org\u002Fgoleak\"\n)\n\nfunc TestMain(m *testing.M) {\n    goleak.VerifyTestMain(m)\n}\n```\n\nTo exclude specific goroutine stacks (for known leaks or library goroutines):\n\n```go\nfunc TestMain(m *testing.M) {\n    goleak.VerifyTestMain(m,\n        goleak.IgnoreCurrent(),\n    )\n}\n```\n\nOr per-test:\n\n```go\nfunc TestWorkerPool(t *testing.T) {\n    defer goleak.VerifyNone(t)\n    \u002F\u002F ... test code ...\n}\n```\n\n## testing\u002Fsynctest for Deterministic Goroutine Testing\n\n`testing\u002Fsynctest` (Go 1.25+) provides deterministic tests for goroutines, timers, deadlines, and context cancellation. Time advances only when all goroutines are blocked, making ordering predictable.\n\nWhen to use `synctest` instead of real time:\n\n- Testing concurrent code with time-based operations (time.Sleep, time.After, time.Ticker)\n- When race conditions need to be reproducible\n- When tests are flaky due to timing issues\n\n```go\nimport (\n    \"context\"\n    \"testing\"\n    \"testing\u002Fsynctest\"\n    \"time\"\n)\n\nfunc TestContextTimeout(t *testing.T) {\n    synctest.Test(t, func(t *testing.T) {\n        const timeout = 5 * time.Second\n\n        ctx, cancel := context.WithTimeout(t.Context(), timeout)\n        defer cancel()\n\n        time.Sleep(timeout - time.Nanosecond)\n        synctest.Wait()\n        if err := ctx.Err(); err != nil {\n            t.Fatalf(\"before timeout: %v\", err)\n        }\n\n        time.Sleep(time.Nanosecond)\n        synctest.Wait()\n        if err := ctx.Err(); err != context.DeadlineExceeded {\n            t.Fatalf(\"after timeout: got %v, want DeadlineExceeded\", err)\n        }\n    })\n}\n```\n\nUse `synctest.Test` in Go 1.25+ and Go 1.26+. Do not use the old Go 1.24 experimental `synctest.Run` API in Go 1.25+ or Go 1.26+ code. If a module explicitly targets Go 1.24 and opts into `GOEXPERIMENT=synctest`, use the old API only as a compatibility fallback.\n\nKey differences in `synctest`:\n\n- `time.Sleep` advances synthetic time instantly when the goroutine blocks\n- `time.After` fires when synthetic time reaches the duration\n- All goroutines run to blocking points before time advances\n- Test execution is deterministic and repeatable\n\n## Test Timeouts\n\nFor tests that may hang, use a timeout helper that panics with caller location. See [Helpers](.\u002Freferences\u002Fhelpers.md).\n\n## Benchmarks\n\n→ See `golang-benchmark` skill for advanced benchmarking: `b.Loop()` (Go 1.24+), `benchstat`, profiling from benchmarks, and CI regression detection.\n\nWrite benchmarks to measure performance and detect regressions:\n\n```go\nfunc BenchmarkStringConcatenation(b *testing.B) {\n    b.Run(\"plus-operator\", func(b *testing.B) {\n        for b.Loop() {\n            result := \"a\" + \"b\" + \"c\"\n            _ = result\n        }\n    })\n\n    b.Run(\"strings.Builder\", func(b *testing.B) {\n        for b.Loop() {\n            var builder strings.Builder\n            builder.WriteString(\"a\")\n            builder.WriteString(\"b\")\n            builder.WriteString(\"c\")\n            _ = builder.String()\n        }\n    })\n}\n```\n\nBenchmarks with different input sizes:\n\n```go\nfunc BenchmarkFibonacci(b *testing.B) {\n    sizes := []int{10, 20, 30}\n    for _, size := range sizes {\n        b.Run(fmt.Sprintf(\"n=%d\", size), func(b *testing.B) {\n            b.ReportAllocs()\n            for b.Loop() {\n                Fibonacci(size)\n            }\n        })\n    }\n}\n```\n\nFor Go 1.24+, new benchmarks should use `b.Loop()`. Use legacy `b.N` loops only when the module targets Go \u003C1.24 or when preserving old benchmark code intentionally.\n\n### Go 1.26+: test artifacts\n\nWhen a test, benchmark, or fuzz target needs to persist files for inspection, use `ArtifactDir()` instead of ad-hoc paths or repo-local output.\n\n```go\nfunc TestRenderGoldenArtifact(t *testing.T) {\n    dir := t.ArtifactDir()\n\n    out := filepath.Join(dir, \"rendered.json\")\n    if err := os.WriteFile(out, renderedBytes, 0o644); err != nil {\n        t.Fatal(err)\n    }\n\n    t.Logf(\"artifact written: %s\", out)\n}\n```\n\nAvailable on `*testing.T`, `*testing.B`, and `*testing.F` in Go 1.26+.\n\n## Parallel Tests\n\nUse `t.Parallel()` to run tests concurrently:\n\n```go\nfunc TestParallelOperations(t *testing.T) {\n    tests := []struct {\n        name string\n        data []byte\n    }{\n        {\"small data\", make([]byte, 1024)},\n        {\"medium data\", make([]byte, 1024*1024)},\n    }\n\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            t.Parallel()\n            is := assert.New(t)\n\n            result := Process(tt.data)\n            is.NotNil(result)\n        })\n    }\n}\n```\n\n## Fuzzing\n\nUse fuzzing to find edge cases and bugs:\n\n```go\nfunc FuzzReverse(f *testing.F) {\n    f.Add(\"hello\")\n    f.Add(\"\")\n    f.Add(\"a\")\n\n    f.Fuzz(func(t *testing.T, input string) {\n        reversed := Reverse(input)\n        doubleReversed := Reverse(reversed)\n        if input != doubleReversed {\n            t.Errorf(\"Reverse(Reverse(%q)) = %q, want %q\", input, doubleReversed, input)\n        }\n    })\n}\n```\n\n## Examples as Documentation\n\nExamples are executable documentation verified by `go test`:\n\n```go\nfunc ExampleCalculatePrice() {\n    price := CalculatePrice(100, 10.0)\n    fmt.Printf(\"Price: %.2f\\n\", price)\n    \u002F\u002F Output: Price: 900.00\n}\n\nfunc ExampleCalculatePrice_singleItem() {\n    price := CalculatePrice(1, 25.50)\n    fmt.Printf(\"Price: %.2f\\n\", price)\n    \u002F\u002F Output: Price: 25.50\n}\n```\n\n## Code Coverage\n\n```bash\n# Generate coverage file\ngo test -coverprofile=coverage.out .\u002F...\n\n# View coverage in HTML\ngo tool cover -html=coverage.out\n\n# Coverage by function\ngo tool cover -func=coverage.out\n\n# Total coverage percentage\ngo tool cover -func=coverage.out | grep total\n```\n\n## Integration Tests\n\nUse build tags to separate integration tests from unit tests:\n\n```go\n\u002F\u002Fgo:build integration\n\npackage mypackage\n\nfunc TestDatabaseIntegration(t *testing.T) {\n    db, err := sql.Open(\"postgres\", os.Getenv(\"DATABASE_URL\"))\n    if err != nil {\n        t.Fatal(err)\n    }\n    defer db.Close()\n\n    \u002F\u002F Test real database operations\n}\n```\n\nRun integration tests separately:\n\n```bash\ngo test -tags=integration .\u002F...\n```\n\nFor Docker Compose fixtures, SQL schemas, and integration test suites, see [Integration Testing](.\u002Freferences\u002Fintegration-testing.md).\n\n## Mocking\n\nMock interfaces, not concrete types. Define interfaces where consumed, then create mock implementations.\n\nFor mock patterns, test fixtures, and time mocking, see [Mocking](.\u002Freferences\u002Fmocking.md).\n\n## Enforce with Linters\n\nMany test best practices are enforced automatically by linters: `thelper`, `paralleltest`, `testifylint`. See the `golang-lint` skill for configuration and usage.\n\n## Cross-References\n\n- -> See `golang-stretchr-testify` skill for detailed testify API (assert, require, mock, suite)\n- -> See `golang-database` skill (testing.md) for database integration test patterns\n- -> See `golang-concurrency` skill for goroutine leak detection with goleak\n- -> See `golang-continuous-integration` skill for CI test configuration and GitHub Actions workflows\n- -> See `golang-lint` skill for testifylint and paralleltest configuration\n- -> See `golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines\n\n## Quick Reference\n\n```bash\ngo test .\u002F...                          # all tests\ngo test -run TestName .\u002F...            # specific test by exact name\ngo test -run TestName\u002Fsubtest .\u002F...    # subtests within a test\ngo test -run 'Test(Add|Sub)' .\u002F...     # multiple tests (regexp OR)\ngo test -run 'Test[A-Z]' .\u002F...         # tests starting with capital letter\ngo test -run 'TestUser.*' .\u002F...        # tests matching prefix\ngo test -run '.*Validation.*' .\u002F...    # tests containing substring\ngo test -run TestName\u002F. .\u002F...          # all subtests of TestName\ngo test -run '\u002F(unit|integration)' .\u002F... # filter by subtest name\ngo test -race .\u002F...                    # race detection\ngo test -cover .\u002F...                   # coverage summary\ngo test -bench=. -benchmem .\u002F...       # benchmarks\ngo test -fuzz=FuzzName .\u002F...           # fuzzing\ngo test -tags=integration .\u002F...        # integration tests\n```\n","**Persona:** You are a Go engineer who treats tests as executable specifications. You write tests to constrain behavior, not to hit coverage targets.\n\n**Thinking mode:** Reason as thoroughly as possible for test strategy design and failure analysis — shallow reasoning misses edge cases and produces brittle tests that pass today but break tomorrow. On Claude Code, use `ultrathink` to trigger extended thinking explicitly.\n\n**Orchestration mode:** Fan out the three sub-agents described in Audit mode (unit quality and coverage gaps, integration isolation, goroutine\u002Frace issues) for auditing a large test suite, and merge their findings into one gap report. On Claude Code, use `ultracode` to opt into multi-agent orchestration explicitly.\n\n**Modes:**\n\n- **Write mode** — generating new tests for existing or new code. Work sequentially through the code under test; use `gotests` to scaffold table-driven tests, then enrich with edge cases and error paths.\n- **Review mode** — reviewing a PR's test changes. Focus on the diff: check coverage of new behaviour, assertion quality, table-driven structure, and absence of flakiness patterns. Sequential.\n- **Audit mode** — auditing an existing test suite for gaps, flakiness, or bad patterns (order-dependent tests, missing `t.Parallel()`, implementation-detail coupling). Launch up to 3 parallel sub-agents split by concern: (1) unit test quality and coverage gaps, (2) integration test isolation and build tags, (3) goroutine leaks and race conditions.\n- **Debug mode** — a test is failing or flaky. Work sequentially: reproduce reliably, isolate the failing assertion, trace the root cause in production code or test setup.\n\n> **Community default.** A company skill that explicitly supersedes `golang-testing` skill takes precedence.\n\n**Dependencies:**\n\n- gotests: `go install github.com\u002Fcweill\u002Fgotests\u002Fgotests@latest`\n\n# Go Testing Best Practices\n\nThis skill guides the creation of production-ready tests for Go applications. Follow these principles to write maintainable, fast, and reliable tests.\n\n## Best Practices Summary\n\n1. Table-driven tests MUST use named subtests -- every test case needs a `name` field passed to `t.Run`\n2. Integration tests MUST use build tags (`\u002F\u002Fgo:build integration`) to separate from unit tests\n3. Tests MUST NOT depend on execution order -- each test MUST be independently runnable\n4. Independent tests SHOULD use `t.Parallel()` when possible\n5. NEVER test implementation details -- test observable behavior and public API contracts\n6. Packages with goroutines SHOULD use `goleak.VerifyTestMain` in `TestMain` to detect goroutine leaks\n7. Use testify as helpers, not a replacement for standard library\n8. Mock interfaces, not concrete types\n9. Keep unit tests fast (\u003C 1ms), use build tags for integration tests\n10. Run tests with race detection in CI\n11. Include examples as executable documentation\n12. Test files MUST be named after the source file under test, not after the function or method being tested\n13. Test functions SHOULD appear in the same order as the functions\u002Fmethods they test in the source file\n\n## Test Structure and Organization\n\n### File Conventions\n\n```go\n\u002F\u002F package_test.go - tests in same package (white-box, access unexported)\npackage mypackage\n\n\u002F\u002F mypackage_test.go - tests in test package (black-box, public API only)\npackage mypackage_test\n```\n\nName the test file after the source file it tests, not after the function or method under test. Go's convention is one test file per source file (`foo.go` -> `foo_test.go`), because tools (`go test`, coverage reports, IDE \"jump to test\" navigation, `gotests`) and reviewers all resolve tests by source file, not by symbol. A source file usually declares several functions\u002Fmethods; splitting its tests by symbol name scatters them across many files and breaks that file-to-file mapping.\n\n```\n\u002F\u002F ✓ Good — one test file per source file\nhelloworld.go       -> helloworld_test.go   \u002F\u002F contains TestHelloWorld, TestAbcd, TestXyz, ...\n\n\u002F\u002F ✗ Bad — test file named after the function\u002Fmethod instead of the source file\nhelloworld.go       -> abcd_test.go         \u002F\u002F wrong: should be helloworld_test.go\n```\n\nException: very large source files MAY be split into multiple `_test.go` files by concern (e.g. `foo_test.go` + `foo_edgecases_test.go`), but each split file's name MUST still be derived from the source file name, never from an individual function name. Prefer keeping a single `_test.go` file per source file even when it grows large — splitting adds navigation overhead and is rarely worth it; reach for the exception only when a single file becomes genuinely unwieldy to browse or review.\n\nWithin a test file, order test functions to match the order their tested functions\u002Fmethods appear in the source file. A reader (human or agent) scrolling `foo.go` alongside `foo_test.go` can then find the matching test by position instead of searching; drift between the two orderings compounds every time either file grows.\n\n### Naming Conventions\n\n```go\nfunc TestAdd(t *testing.T) { ... }               \u002F\u002F function test\nfunc TestMyStruct_MyMethod(t *testing.T) { ... } \u002F\u002F method test\nfunc BenchmarkAdd(b *testing.B) { ... }          \u002F\u002F benchmark\nfunc ExampleAdd() { ... }                        \u002F\u002F example\nfunc FuzzAdd(f *testing.F) { ... }               \u002F\u002F fuzz test\n```\n\n## Table-Driven Tests\n\nTable-driven tests are the idiomatic Go way to test multiple scenarios. Always name each test case.\n\n```go\nfunc TestCalculatePrice(t *testing.T) {\n    tests := []struct {\n        name     string\n        quantity int\n        unitPrice float64\n        expected  float64\n    }{\n        {\n            name:      \"single item\",\n            quantity:  1,\n            unitPrice: 10.0,\n            expected:  10.0,\n        },\n        {\n            name:      \"bulk discount - 100 items\",\n            quantity:  100,\n            unitPrice: 10.0,\n            expected:  900.0, \u002F\u002F 10% discount\n        },\n        {\n            name:      \"zero quantity\",\n            quantity:  0,\n            unitPrice: 10.0,\n            expected:  0.0,\n        },\n    }\n\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            got := CalculatePrice(tt.quantity, tt.unitPrice)\n            if got != tt.expected {\n                t.Errorf(\"CalculatePrice(%d, %.2f) = %.2f, want %.2f\",\n                    tt.quantity, tt.unitPrice, got, tt.expected)\n            }\n        })\n    }\n}\n```\n\n## Common Pitfall: Assert Scope Leaking into Subtests\n\nNever create a testify `assert`\u002F`require` instance in the parent test function and reuse it inside `t.Run` closures. `assert.New(t)` captures the exact `*testing.T` it was built with, so if that `t` belongs to the parent, every failure raised inside the subtest gets attributed to the _parent_ test in `go test` output — the failing subtest itself still reports `--- PASS`, silently hiding which case broke. This happens whether or not the subtest calls `t.Parallel()`.\n\n```go\n\u002F\u002F WRONG -- `is` is bound to the parent's t\nfunc TestCalculatePrice(t *testing.T) {\n    is := assert.New(t)\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            is.Equal(tt.expected, CalculatePrice(tt.quantity, tt.unitPrice)) \u002F\u002F misattributed on failure\n        })\n    }\n}\n\n\u002F\u002F RIGHT -- each subtest builds its own instance from its own t\nfunc TestCalculatePrice(t *testing.T) {\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            is := assert.New(t)\n            is.Equal(tt.expected, CalculatePrice(tt.quantity, tt.unitPrice))\n        })\n    }\n}\n```\n\nVerify with a deliberately-broken case: if `go test -v -run TestName` shows `--- FAIL: TestName` but every `--- PASS: TestName\u002Fsubtest_name` line still says PASS, the assert scope is leaking.\n\n## Unit Tests\n\nUnit tests should be fast (\u003C 1ms), isolated (no external dependencies), and deterministic.\n\n## Testing HTTP Handlers\n\nUse `httptest` for handler tests with table-driven patterns. See [HTTP Testing](.\u002Freferences\u002Fhttp-testing.md) for examples with request\u002Fresponse bodies, query parameters, headers, and status code assertions.\n\n## Goroutine Leak Detection with goleak\n\nUse `go.uber.org\u002Fgoleak` to detect leaking goroutines, especially for concurrent code:\n\n```go\nimport (\n    \"testing\"\n    \"go.uber.org\u002Fgoleak\"\n)\n\nfunc TestMain(m *testing.M) {\n    goleak.VerifyTestMain(m)\n}\n```\n\nTo exclude specific goroutine stacks (for known leaks or library goroutines):\n\n```go\nfunc TestMain(m *testing.M) {\n    goleak.VerifyTestMain(m,\n        goleak.IgnoreCurrent(),\n    )\n}\n```\n\nOr per-test:\n\n```go\nfunc TestWorkerPool(t *testing.T) {\n    defer goleak.VerifyNone(t)\n    \u002F\u002F ... test code ...\n}\n```\n\n## testing\u002Fsynctest for Deterministic Goroutine Testing\n\n`testing\u002Fsynctest` (Go 1.25+) provides deterministic tests for goroutines, timers, deadlines, and context cancellation. Time advances only when all goroutines are blocked, making ordering predictable.\n\nWhen to use `synctest` instead of real time:\n\n- Testing concurrent code with time-based operations (time.Sleep, time.After, time.Ticker)\n- When race conditions need to be reproducible\n- When tests are flaky due to timing issues\n\n```go\nimport (\n    \"context\"\n    \"testing\"\n    \"testing\u002Fsynctest\"\n    \"time\"\n)\n\nfunc TestContextTimeout(t *testing.T) {\n    synctest.Test(t, func(t *testing.T) {\n        const timeout = 5 * time.Second\n\n        ctx, cancel := context.WithTimeout(t.Context(), timeout)\n        defer cancel()\n\n        time.Sleep(timeout - time.Nanosecond)\n        synctest.Wait()\n        if err := ctx.Err(); err != nil {\n            t.Fatalf(\"before timeout: %v\", err)\n        }\n\n        time.Sleep(time.Nanosecond)\n        synctest.Wait()\n        if err := ctx.Err(); err != context.DeadlineExceeded {\n            t.Fatalf(\"after timeout: got %v, want DeadlineExceeded\", err)\n        }\n    })\n}\n```\n\nUse `synctest.Test` in Go 1.25+ and Go 1.26+. Do not use the old Go 1.24 experimental `synctest.Run` API in Go 1.25+ or Go 1.26+ code. If a module explicitly targets Go 1.24 and opts into `GOEXPERIMENT=synctest`, use the old API only as a compatibility fallback.\n\nKey differences in `synctest`:\n\n- `time.Sleep` advances synthetic time instantly when the goroutine blocks\n- `time.After` fires when synthetic time reaches the duration\n- All goroutines run to blocking points before time advances\n- Test execution is deterministic and repeatable\n\n## Test Timeouts\n\nFor tests that may hang, use a timeout helper that panics with caller location. See [Helpers](.\u002Freferences\u002Fhelpers.md).\n\n## Benchmarks\n\n→ See `golang-benchmark` skill for advanced benchmarking: `b.Loop()` (Go 1.24+), `benchstat`, profiling from benchmarks, and CI regression detection.\n\nWrite benchmarks to measure performance and detect regressions:\n\n```go\nfunc BenchmarkStringConcatenation(b *testing.B) {\n    b.Run(\"plus-operator\", func(b *testing.B) {\n        for b.Loop() {\n            result := \"a\" + \"b\" + \"c\"\n            _ = result\n        }\n    })\n\n    b.Run(\"strings.Builder\", func(b *testing.B) {\n        for b.Loop() {\n            var builder strings.Builder\n            builder.WriteString(\"a\")\n            builder.WriteString(\"b\")\n            builder.WriteString(\"c\")\n            _ = builder.String()\n        }\n    })\n}\n```\n\nBenchmarks with different input sizes:\n\n```go\nfunc BenchmarkFibonacci(b *testing.B) {\n    sizes := []int{10, 20, 30}\n    for _, size := range sizes {\n        b.Run(fmt.Sprintf(\"n=%d\", size), func(b *testing.B) {\n            b.ReportAllocs()\n            for b.Loop() {\n                Fibonacci(size)\n            }\n        })\n    }\n}\n```\n\nFor Go 1.24+, new benchmarks should use `b.Loop()`. Use legacy `b.N` loops only when the module targets Go \u003C1.24 or when preserving old benchmark code intentionally.\n\n### Go 1.26+: test artifacts\n\nWhen a test, benchmark, or fuzz target needs to persist files for inspection, use `ArtifactDir()` instead of ad-hoc paths or repo-local output.\n\n```go\nfunc TestRenderGoldenArtifact(t *testing.T) {\n    dir := t.ArtifactDir()\n\n    out := filepath.Join(dir, \"rendered.json\")\n    if err := os.WriteFile(out, renderedBytes, 0o644); err != nil {\n        t.Fatal(err)\n    }\n\n    t.Logf(\"artifact written: %s\", out)\n}\n```\n\nAvailable on `*testing.T`, `*testing.B`, and `*testing.F` in Go 1.26+.\n\n## Parallel Tests\n\nUse `t.Parallel()` to run tests concurrently:\n\n```go\nfunc TestParallelOperations(t *testing.T) {\n    tests := []struct {\n        name string\n        data []byte\n    }{\n        {\"small data\", make([]byte, 1024)},\n        {\"medium data\", make([]byte, 1024*1024)},\n    }\n\n    for _, tt := range tests {\n        t.Run(tt.name, func(t *testing.T) {\n            t.Parallel()\n            is := assert.New(t)\n\n            result := Process(tt.data)\n            is.NotNil(result)\n        })\n    }\n}\n```\n\n## Fuzzing\n\nUse fuzzing to find edge cases and bugs:\n\n```go\nfunc FuzzReverse(f *testing.F) {\n    f.Add(\"hello\")\n    f.Add(\"\")\n    f.Add(\"a\")\n\n    f.Fuzz(func(t *testing.T, input string) {\n        reversed := Reverse(input)\n        doubleReversed := Reverse(reversed)\n        if input != doubleReversed {\n            t.Errorf(\"Reverse(Reverse(%q)) = %q, want %q\", input, doubleReversed, input)\n        }\n    })\n}\n```\n\n## Examples as Documentation\n\nExamples are executable documentation verified by `go test`:\n\n```go\nfunc ExampleCalculatePrice() {\n    price := CalculatePrice(100, 10.0)\n    fmt.Printf(\"Price: %.2f\\n\", price)\n    \u002F\u002F Output: Price: 900.00\n}\n\nfunc ExampleCalculatePrice_singleItem() {\n    price := CalculatePrice(1, 25.50)\n    fmt.Printf(\"Price: %.2f\\n\", price)\n    \u002F\u002F Output: Price: 25.50\n}\n```\n\n## Code Coverage\n\n```bash\n# Generate coverage file\ngo test -coverprofile=coverage.out .\u002F...\n\n# View coverage in HTML\ngo tool cover -html=coverage.out\n\n# Coverage by function\ngo tool cover -func=coverage.out\n\n# Total coverage percentage\ngo tool cover -func=coverage.out | grep total\n```\n\n## Integration Tests\n\nUse build tags to separate integration tests from unit tests:\n\n```go\n\u002F\u002Fgo:build integration\n\npackage mypackage\n\nfunc TestDatabaseIntegration(t *testing.T) {\n    db, err := sql.Open(\"postgres\", os.Getenv(\"DATABASE_URL\"))\n    if err != nil {\n        t.Fatal(err)\n    }\n    defer db.Close()\n\n    \u002F\u002F Test real database operations\n}\n```\n\nRun integration tests separately:\n\n```bash\ngo test -tags=integration .\u002F...\n```\n\nFor Docker Compose fixtures, SQL schemas, and integration test suites, see [Integration Testing](.\u002Freferences\u002Fintegration-testing.md).\n\n## Mocking\n\nMock interfaces, not concrete types. Define interfaces where consumed, then create mock implementations.\n\nFor mock patterns, test fixtures, and time mocking, see [Mocking](.\u002Freferences\u002Fmocking.md).\n\n## Enforce with Linters\n\nMany test best practices are enforced automatically by linters: `thelper`, `paralleltest`, `testifylint`. See the `golang-lint` skill for configuration and usage.\n\n## Cross-References\n\n- -> See `golang-stretchr-testify` skill for detailed testify API (assert, require, mock, suite)\n- -> See `golang-database` skill (testing.md) for database integration test patterns\n- -> See `golang-concurrency` skill for goroutine leak detection with goleak\n- -> See `golang-continuous-integration` skill for CI test configuration and GitHub Actions workflows\n- -> See `golang-lint` skill for testifylint and paralleltest configuration\n- -> See `golang-continuous-integration` skill for automated AI-driven code review in CI using these guidelines\n\n## Quick Reference\n\n```bash\ngo test .\u002F...                          # all tests\ngo test -run TestName .\u002F...            # specific test by exact name\ngo test -run TestName\u002Fsubtest .\u002F...    # subtests within a test\ngo test -run 'Test(Add|Sub)' .\u002F...     # multiple tests (regexp OR)\ngo test -run 'Test[A-Z]' .\u002F...         # tests starting with capital letter\ngo test -run 'TestUser.*' .\u002F...        # tests matching prefix\ngo test -run '.*Validation.*' .\u002F...    # tests containing substring\ngo test -run TestName\u002F. .\u002F...          # all subtests of TestName\ngo test -run '\u002F(unit|integration)' .\u002F... # filter by subtest name\ngo test -race .\u002F...                    # race detection\ngo test -cover .\u002F...                   # coverage summary\ngo test -bench=. -benchmem .\u002F...       # benchmarks\ngo test -fuzz=FuzzName .\u002F...           # fuzzing\ngo test -tags=integration .\u002F...        # integration tests\n```\n",{"name":5,"paths":44,"license":15,"metadata":46,"description":7,"allowed-tools":59,"compatibility":60,"user-invocable":61},[45],"**\u002F*.go",{"author":47,"version":48,"openclaw":49},"samber","1.3.0",{"emoji":50,"install":51,"homepage":56,"requires":57},"?",[52],{"bins":53,"kind":37,"package":55},[54],"gotests","github.com\u002Fcweill\u002Fgotests\u002Fgotests@latest","https:\u002F\u002Fgithub.com\u002Fsamber\u002Fcc-skills-golang",{"bins":58},[37,54],"Read Edit Write Glob Grep Bash(go:*) Bash(golangci-lint:*) Bash(git:*) Agent Bash(gotests:*) AskUserQuestion","Designed for Claude Code, Codex or similar harness, and for projects using Golang.",true,"main","c349be0704bffe54a7191d1412faf564b08983ca","skills\u002Fsamber-golang\u002Fgolang-testing",0,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills","https:\u002F\u002Fgithub.com\u002Frockcookies","2026-11-12 14:42:52",{"source":8,"skillName":5,"commands":70,"prompt":80,"zipAvailable":61},[71,74,77],{"tool":72,"command":73},"npx","npx skills add rockcookies\u002Fskills --skill golang-testing",{"tool":75,"command":76},"bunx","bunx skills add rockcookies\u002Fskills --skill golang-testing",{"tool":78,"command":79},"pnpm","pnpm dlx skills add rockcookies\u002Fskills --skill golang-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002FSKILL.md",[82,88,92,96,100,104],{"path":83,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":86,"sourceHtmlUrl":87},"agents\u002Fopenai.yaml","REFERENCE","参考文档",141,"https:\u002F\u002Fgithub.com\u002Fcompozy\u002Fcompozy\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fhandoff\u002Fagents\u002Fopenai.yaml",{"path":89,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":90,"sourceHtmlUrl":91},"evals\u002Fevals.json",21978,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002Fevals\u002Fevals.json",{"path":93,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":94,"sourceHtmlUrl":95},"references\u002Fhelpers.md",1054,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002Freferences\u002Fhelpers.md",{"path":97,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":98,"sourceHtmlUrl":99},"references\u002Fhttp-testing.md",2268,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002Freferences\u002Fhttp-testing.md",{"path":101,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":102,"sourceHtmlUrl":103},"references\u002Fintegration-testing.md",4166,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002Freferences\u002Fintegration-testing.md",{"path":105,"resourceType":84,"resourceTypeDesc":85,"sizeBytes":106,"sourceHtmlUrl":107},"references\u002Fmocking.md",4549,"https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fsamber-golang\u002Fgolang-testing\u002Freferences\u002Fmocking.md",[109,141,164,187,212,227],{"skillNo":110,"name":111,"nameZh":112,"description":113,"descriptionZh":114,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":115,"sourceHtmlUrl":116,"categories":117,"keywords":128,"publishedAt":140},"01M6CFPKHRH0GD3W2GTGWE9WGP","kami","Kami 专业文档排版","Typeset professional documents with Kami templates: resumes, one-pagers, white papers, letters, portfolios, and slide decks. Use when asked to 做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides, or to create a Kami landing page. Not for auditing or restyling an existing product site.","使用 Kami 模板排版专业文档：简历、一页纸、白皮书、信件、作品集和幻灯片。当用户要求做 PDF \u002F 排版 \u002F 简历 \u002F 一页纸 \u002F PPT \u002F slides，或创建 Kami 落地页时使用。不适用于审查或重新设计现有产品网站。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FLICENSE","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Ftw93-kami\u002Fkami\u002FSKILL.md",[118,123],{"categoryNo":119,"categoryName":120,"taxonomyType":121,"taxonomyTypeDesc":122},"01M8BQ6TK1MPB82068236GSXDE","文档处理","SCENARIO","使用场景",{"categoryNo":124,"categoryName":125,"taxonomyType":126,"taxonomyTypeDesc":127},"01M8C55A3R2M9C8CAKG3W16HTA","内容创作者","PROFESSION","适用职业",[111,129,130,131,132,133,134,135,136,137,138,139],"create","PDF","pptx","slides","product","page","landing","templates","site","use","documents","2026-11-12 13:55:43",{"skillNo":142,"name":143,"nameZh":6,"description":144,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":145,"categories":146,"keywords":147,"publishedAt":39},"01M6WMNKD3Y4H9FGM8Q901F507","hierarchical-agents-md","层级 AGENTS.md \u002F README.md：init、update、audit、reorganize、trim。 初始化 Agent 指令、代码改动后同步文档、检查文档漂移、重组仓库文档层级、精简规则与 Skills。 Not for 写业务代码或生成文档站点。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fcustom\u002Fhierarchical-agents-md\u002FSKILL.md",[],[148,149,150,151,152,153,154,155,156,157,158,159,33,160,161,162,163],"hierarchical agents md","agents md","packages","change","maintenance","初始化","audit","for","README","update","python","init","true","party","third-party","文档",{"skillNo":165,"name":166,"nameZh":167,"description":168,"descriptionZh":169,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":170,"categories":171,"keywords":178,"publishedAt":39},"01M6CFS6BRTQPFZCDHQP97HYXR","vueuse-functions","VueUse 组合式函数应用","Apply VueUse composables where appropriate to build concise, maintainable Vue.js \u002F Nuxt features.","在合适的地方应用 VueUse 组合式函数（composables），以构建简洁、可维护的 Vue.js \u002F Nuxt 功能。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvueuse\u002Fvueuse-functions\u002FSKILL.md",[172,175],{"categoryNo":173,"categoryName":174,"taxonomyType":126,"taxonomyTypeDesc":127},"01M8BQ6TQZN6R52WBJ9H8NRMQM","软件开发工程师",{"categoryNo":176,"categoryName":177,"taxonomyType":121,"taxonomyTypeDesc":122},"01M8BRASNPVNJVQQJ4KZX8XM5D","前端开发与界面实现",[179,180,181,182,183,184,185,186],"vueuse functions","functions","nuxt","https","vue","build","github","js",{"skillNo":188,"name":189,"nameZh":190,"description":191,"descriptionZh":192,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":193,"categories":194,"keywords":201,"publishedAt":39},"01M6CFS34MDQXZPAWQFE5D7VGT","vue-testing-best-practices","Vue.js 测试最佳实践","Use for Vue.js testing. Covers Vitest, Vue Test Utils, component testing, mocking, testing patterns, and Playwright for E2E testing.","用于 Vue.js 测试。涵盖 Vitest、Vue Test Utils、组件测试、模拟（mocking）、测试模式，以及用于 E2E 测试的 Playwright。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-testing-best-practices\u002FSKILL.md",[195,198],{"categoryNo":196,"categoryName":197,"taxonomyType":126,"taxonomyTypeDesc":127},"01M8BQGD5WG86P4AQ5GPSSKBFR","测试工程师",{"categoryNo":199,"categoryName":200,"taxonomyType":121,"taxonomyTypeDesc":122},"01M8BQJH394GT47X57A9Q8G7HX","测试与质量保障",[202,19,203,183,204,186,205,206,138,207,208,209,185,210,211],"vue testing best practices","testing best practices","best practices","e2e testing","playwright","test","testing patterns","component","vitest","e2e",{"skillNo":213,"name":214,"nameZh":215,"description":216,"descriptionZh":217,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":218,"categories":219,"keywords":222,"publishedAt":39},"01M6CFS0N19MSJNTVM9AEQ7Z73","vue-router-best-practices","Vue Router 路由最佳实践","Vue Router 4 patterns, navigation guards, route params, and route-component lifecycle interactions.","Vue Router 4 模式、导航守卫、路由参数以及路由与组件生命周期的交互。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-router-best-practices\u002FSKILL.md",[220,221],{"categoryNo":173,"categoryName":174,"taxonomyType":126,"taxonomyTypeDesc":127},{"categoryNo":176,"categoryName":177,"taxonomyType":121,"taxonomyTypeDesc":122},[204,223,183,224,209,185,225,226],"vue router best practices","router","navigation","lifecycle",{"skillNo":228,"name":229,"nameZh":230,"description":231,"descriptionZh":232,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":233,"categories":234,"keywords":237,"publishedAt":39},"01M6CFRYN31RFQFTE41Z6DCGKE","vue-pinia-best-practices","Pinia 状态管理最佳实践","Pinia stores, state management patterns, store setup, and reactivity with stores.","Pinia store、状态管理模式、store 配置以及 store 的响应式处理。","https:\u002F\u002Fgithub.com\u002Frockcookies\u002Fskills\u002Fblob\u002Fmain\u002Fskills\u002Fvuejs-ai\u002Fvue-pinia-best-practices\u002FSKILL.md",[235,236],{"categoryNo":173,"categoryName":174,"taxonomyType":126,"taxonomyTypeDesc":127},{"categoryNo":176,"categoryName":177,"taxonomyType":121,"taxonomyTypeDesc":122},[238,204,183,239,185,240,241,242,243],"vue pinia best practices","pinia","state","state management","management","setup"]