[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M758SF8A4HPY1EMGZBQWPWH4":3,"skill-same:01M758SF8A4HPY1EMGZBQWPWH4":68},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":28,"ownerDescription":30,"updatedAt":31,"install":32,"resources":45},"01M758SF8A4HPY1EMGZBQWPWH4","tdd-unit-testing",null,"Write unit tests in Go following Red-Green-Refactor TDD principles.","CliqRelay\u002Fcliqrelay","CliqRelay","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F290753656?v=4","01M758RPDEB11FEYA2XK17DSHA","01M758RPEKP0NKH6P43GD2FBDG",41,"Apache-2.0","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002FSKILL.md",[],[],"2026-11-12 13:55:43",false,"---\nname: tdd-unit-testing\ndescription: Write unit tests in Go following Red-Green-Refactor TDD principles.\n---\n\n# TDD & Unit Testing\n\n## When to use this skill\n\n- Implement new features (write test first)\n- Add test coverage for code changes\n- Test business logic such as handlers, services, and repositories.\n- Ensure error paths and edge cases are covered\n\n## Key principles\n\n1. **Red-Green-Refactor**: Write failing test → implement → refactor\n2. **Mock dependencies**: Use testify\u002Fmock to isolate units and put all mocks in a separate `mocks.go` file under a `tests` folder within the package being tested\n3. **Table-driven tests**: Use `tt` patterns for multiple cases, keep tests focused and small with one behavior per test case and test success and error paths.\n4. **Descriptive names**: `TestTodoService_CreateTodo` and all the scenarios and logic should be tested as individual test cases using the table driven approach\n5. **Temporary variables**: Utilise the `new()` function in Go 1.26+ to initialise reference type values instead of creating pointer functions that return a reference type. For example, use `new(\"user-1\")` instead of a function such as `ptrString(\"user-1\")` that returns `*string` to create a pointer to a string value. This also includes all other reference types such as `new(10)` for `*int`, `new(true)` for `*bool`, etc.\n6. **Assert mock expectations**: Always call `AssertExpectations(t)` at the end of tests that use mocks to ensure all expected calls were made.\n7. **Helpers and test harnesses**: Always utilise any test helpers and utils from the `internals` folder as it contains helpers and utils for tests. If a helper function or util is needed then see whether it is something that is global and can be used across the codebase but if it is specific to a plugin, then keep it local to the plugin by putting the helpers and utils within the plugin's `tests` folder. Never write test code differently in each handler, service, or repository test file. Always follow the same patterns and principles to ensure consistency and maintainability across all tests.\n\n## Testing strategy\n\n**Handlers**: Create handler struct with UseCase\u002FService field; return `http.HandlerFunc` from `Handler()` method; test via httptest\n**Services**: Mock repositories; test business logic and error handling\n**Repositories**: Test against real SQLite database (Bun ORM); use test fixtures to set up schema\n**Integration tests**: Use fixtures; test plugin routes end-to-end\n\n## Pattern\n\nEvery test follows Arrange-Act-Assert (AAA):\n\n1. **Arrange**: Create mocks, set expectations, prepare test data\n2. **Act**: Call the function under test\n3. **Assert**: Verify results and confirm all mock expectations were met\n\n## Example files\n\nSee [examples\u002F](examples\u002F) for Todos testing patterns:\n\n- `test_helpers.go` - MockTodoUseCase and MockTodoService interfaces\n- `handler_test.go` - Handler struct with UseCase, Handler() method, httptest patterns\n- `repository_test.go` - Real SQLite database tests with test fixtures, CRUD operations\n- `todo_service_test.go` - Service tests with mocked repositories and table-driven tests\n- `plugin_integration_test.go` - End-to-end route testing with fixtures\n\n## Common mistakes\n\n1. Not writing test first (Red-Green-Refactor discipline)\n2. Testing multiple behaviors in one test\n3. Using real database instead of mocks\n4. Skipping error cases and edge cases\n5. Not asserting mock expectations with `AssertExpectations(t)`\n6. Tests that break on harmless refactoring\n\n## Quick commands\n\n```bash\nmake test                  # Run all tests\nmake coverage              # With coverage\ngo test -run TestFunc ...  # Specific test\ngo test -race .\u002F...        # Detect race conditions\n```\n","# TDD & Unit Testing\n\n## When to use this skill\n\n- Implement new features (write test first)\n- Add test coverage for code changes\n- Test business logic such as handlers, services, and repositories.\n- Ensure error paths and edge cases are covered\n\n## Key principles\n\n1. **Red-Green-Refactor**: Write failing test → implement → refactor\n2. **Mock dependencies**: Use testify\u002Fmock to isolate units and put all mocks in a separate `mocks.go` file under a `tests` folder within the package being tested\n3. **Table-driven tests**: Use `tt` patterns for multiple cases, keep tests focused and small with one behavior per test case and test success and error paths.\n4. **Descriptive names**: `TestTodoService_CreateTodo` and all the scenarios and logic should be tested as individual test cases using the table driven approach\n5. **Temporary variables**: Utilise the `new()` function in Go 1.26+ to initialise reference type values instead of creating pointer functions that return a reference type. For example, use `new(\"user-1\")` instead of a function such as `ptrString(\"user-1\")` that returns `*string` to create a pointer to a string value. This also includes all other reference types such as `new(10)` for `*int`, `new(true)` for `*bool`, etc.\n6. **Assert mock expectations**: Always call `AssertExpectations(t)` at the end of tests that use mocks to ensure all expected calls were made.\n7. **Helpers and test harnesses**: Always utilise any test helpers and utils from the `internals` folder as it contains helpers and utils for tests. If a helper function or util is needed then see whether it is something that is global and can be used across the codebase but if it is specific to a plugin, then keep it local to the plugin by putting the helpers and utils within the plugin's `tests` folder. Never write test code differently in each handler, service, or repository test file. Always follow the same patterns and principles to ensure consistency and maintainability across all tests.\n\n## Testing strategy\n\n**Handlers**: Create handler struct with UseCase\u002FService field; return `http.HandlerFunc` from `Handler()` method; test via httptest\n**Services**: Mock repositories; test business logic and error handling\n**Repositories**: Test against real SQLite database (Bun ORM); use test fixtures to set up schema\n**Integration tests**: Use fixtures; test plugin routes end-to-end\n\n## Pattern\n\nEvery test follows Arrange-Act-Assert (AAA):\n\n1. **Arrange**: Create mocks, set expectations, prepare test data\n2. **Act**: Call the function under test\n3. **Assert**: Verify results and confirm all mock expectations were met\n\n## Example files\n\nSee [examples\u002F](examples\u002F) for Todos testing patterns:\n\n- `test_helpers.go` - MockTodoUseCase and MockTodoService interfaces\n- `handler_test.go` - Handler struct with UseCase, Handler() method, httptest patterns\n- `repository_test.go` - Real SQLite database tests with test fixtures, CRUD operations\n- `todo_service_test.go` - Service tests with mocked repositories and table-driven tests\n- `plugin_integration_test.go` - End-to-end route testing with fixtures\n\n## Common mistakes\n\n1. Not writing test first (Red-Green-Refactor discipline)\n2. Testing multiple behaviors in one test\n3. Using real database instead of mocks\n4. Skipping error cases and edge cases\n5. Not asserting mock expectations with `AssertExpectations(t)`\n6. Tests that break on harmless refactoring\n\n## Quick commands\n\n```bash\nmake test                  # Run all tests\nmake coverage              # With coverage\ngo test -run TestFunc ...  # Specific test\ngo test -race .\u002F...        # Detect race conditions\n```\n",{"name":5,"description":7},"main","f06510bcaf955afc66bbbc1606871e1a1576492e",".agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing",0,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay","https:\u002F\u002Fcliqrelay.com","https:\u002F\u002Fgithub.com\u002FCliqRelay","Capture and refine workflows instantly to help your teams and AI agents perform at their best.","2026-11-04 22:56:05",{"source":8,"skillName":5,"commands":33,"prompt":43,"zipAvailable":44},[34,37,40],{"tool":35,"command":36},"npx","npx skills add CliqRelay\u002Fcliqrelay --skill tdd-unit-testing",{"tool":38,"command":39},"bunx","bunx skills add CliqRelay\u002Fcliqrelay --skill tdd-unit-testing",{"tool":41,"command":42},"pnpm","pnpm dlx skills add CliqRelay\u002Fcliqrelay --skill tdd-unit-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002FSKILL.md",true,[46,52,56,60,64],{"path":47,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":50,"sourceHtmlUrl":51},"examples\u002Fhandler_test.go","SCRIPT","脚本",3271,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002Fexamples\u002Fhandler_test.go",{"path":53,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fplugin_integration_test.go",6512,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002Fexamples\u002Fplugin_integration_test.go",{"path":57,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Frepository_test.go",5061,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002Fexamples\u002Frepository_test.go",{"path":61,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":62,"sourceHtmlUrl":63},"examples\u002Ftest_helpers.go",1815,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002Fexamples\u002Ftest_helpers.go",{"path":65,"resourceType":48,"resourceTypeDesc":49,"sizeBytes":66,"sourceHtmlUrl":67},"examples\u002Ftodo_service_test.go",2515,"https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fbackend\u002Ftdd-unit-testing\u002Fexamples\u002Ftodo_service_test.go",[69,76,83,90,97,104],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M758WG0JG18W5MZD6ZPM6PGG","typst","Typst document creation and package development. Use when: (1) Working with .typ files, (2) User mentions typst, typst.toml, or typst-cli, (3) Creating or using Typst packages, (4) Developing document templates, (5) Converting Markdown\u002FLaTeX to Typst","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Ftypst\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M758WACKQMHG2BFF7T758J12","shadcn","Manages shadcn components and projects — adding, searching, fixing, debugging, styling, and composing UI. Provides project context, component docs, and usage examples. Applies when working with shadcn\u002Fui, component registries, presets, --preset codes, or any project with a components.json file. Also triggers for \"shadcn init\", \"create an app with --preset\", or \"switch to --preset\".","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fshadcn\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M758W82G2QQ5Q14FKYNHRXQW","handoff","Compact the current conversation into a handoff document for another agent to pick up.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fhandoff\u002FSKILL.md",[],[],{"skillNo":91,"name":92,"nameZh":6,"description":93,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":94,"categories":95,"keywords":96,"publishedAt":18},"01M758W63H60EK55A93199B6NR","grilling","Grill the user relentlessly about a plan, decision, or idea. Use when the user wants to stress-test their thinking, or uses any 'grill' trigger phrases.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fgrilling\u002FSKILL.md",[],[],{"skillNo":98,"name":99,"nameZh":6,"description":100,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":101,"categories":102,"keywords":103,"publishedAt":18},"01M758W4HD4PF66929V7MDGKW8","grill-me","A relentless interview to sharpen a plan or design.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fgrill-me\u002FSKILL.md",[],[],{"skillNo":105,"name":106,"nameZh":6,"description":107,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":108,"categories":109,"keywords":110,"publishedAt":18},"01M758VYC5CCTP7EA5VKE7YWM5","dont-waffle","Use this skill when answering questions, explaining concepts, writing technical responses, reviewing code, or helping with development tasks. Communicate in clear, simple, standard English. Keep answers concise and focused, remove unnecessary filler and repetition, explain technical ideas in plain language, and structure information so it is easy to read and understand. When showing code, present it clearly with enough context for the developer to understand what it does and where it belongs.","https:\u002F\u002Fgithub.com\u002FCliqRelay\u002Fcliqrelay\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fproductivity\u002Fdont-waffle\u002FSKILL.md",[],[]]