[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M6QQ575W28B7QAT9A85NXQ4P":3,"skill-same:01M6QQ575W28B7QAT9A85NXQ4P":51},{"skillNo":4,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":26,"linkOnly":27,"markdownContent":28,"markdownBody":28,"frontMatter":29,"refName":30,"commitSha":31,"skillDirectory":32,"forksCount":13,"repositoryHtmlUrl":33,"repositoryHomepageUrl":6,"ownerHtmlUrl":34,"ownerBlogUrl":6,"ownerDescription":35,"updatedAt":36,"install":37,"resources":50},"01M6QQ575W28B7QAT9A85NXQ4P","testing-conventions",null,"lfr-ai\u002Fcopier-fullstack-template","lfr-ai","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F233346551?v=4","01M6QPWTJWTSJV1TQTTY8ZPBYJ","Laurits Fromberg","01M6QPWTQ47BZGA4TH17H14N80",0,"MIT","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24,25],"testing","conventions","testing conventions","2026-11-10 10:12:30",false,"# Testing Conventions Skill\n\n## Test Structure\n\n```text\ntests\u002F\n└── unit\u002F\n    ├── conftest.py          # Shared fixtures\n    ├── test_services.py     # Service layer tests\n    ├── test_models.py       # Model handler tests\n    └── test_utils.py        # Utility function tests\n```\n\n### Source → Test Mapping\n\n| Source | Test |\n|--------|------|\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fapplication\u002Forchestrator.py` | `tests\u002Funit\u002Ftest_orchestrator.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fai\u002Fhandlers\u002Fgpt.py` | `tests\u002Funit\u002Ftest_gpt_handler.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Futils\u002Fvalidators.py` | `tests\u002Funit\u002Ftest_validators.py` |\n| `backend\u002Fsrc\u002F\u003Cproject_slug>\u002Fcore\u002Fpydantic_models.py` | `tests\u002Funit\u002Ftest_pydantic_models.py` |\n\n## Naming Conventions\n\n| Element | Pattern | Example |\n|---------|---------|---------|\n| Test file | `test_{module}.py` | `test_orchestrator.py` |\n| Test class | `Test{ClassName}` | `TestOrchestrator` |\n| Test method | `test_{method}_{scenario}` | `test_process_claim_empty_input` |\n| Fixture | `{noun}_fixture` or `sample_{noun}` | `sample_claim` |\n\n## Test Template\n\n```python\n\"\"\"Tests for {module_name}.\"\"\"\n\nimport pytest\nfrom hypothesis import given, strategies as st\n\nfrom \u003Cproject_slug>.{path} import {Symbol}\n\n\nclass TestSymbol:\n    \"\"\"Tests for Symbol.\"\"\"\n\n    def test_method_happy_path(self) -> None:\n        \"\"\"Method returns expected result for valid input.\"\"\"\n        # Arrange\n        input_data = ...\n\n        # Act\n        result = Symbol().method(input_data)\n\n        # Assert\n        assert result == expected\n\n    def test_method_empty_input(self) -> None:\n        \"\"\"Method handles empty input gracefully.\"\"\"\n        with pytest.raises(ValueError, match=\"cannot be empty\"):\n            Symbol().method(\"\")\n\n    @pytest.mark.parametrize(\n        \"input_val, expected\",\n        [\n            (1, \"one\"),\n            (2, \"two\"),\n            (3, \"three\"),\n        ],\n    )\n    def test_method_parametrized(\n        self, input_val: int, expected: str\n    ) -> None:\n        \"\"\"Method maps input to correct output.\"\"\"\n        assert Symbol().method(input_val) == expected\n\n    @given(st.integers(min_value=0, max_value=100))\n    def test_method_property(self, value: int) -> None:\n        \"\"\"Method output is always non-negative.\"\"\"\n        result = Symbol().method(value)\n        assert result >= 0\n```\n\n## Fixture Patterns\n\n### Factory Fixtures (preferred)\n\n```python\n@pytest.fixture\ndef claim_factory():\n    \"\"\"Create test claims with sensible defaults.\"\"\"\n    def _factory(**overrides) -> dict[str, object]:\n        defaults = {\n            \"id\": 1,\n            \"diagnosis\": \"Test diagnosis\",\n            \"status\": \"pending\",\n        }\n        return {**defaults, **overrides}\n    return _factory\n```\n\n### Shared Fixtures in conftest.py\n\n```python\n# tests\u002Funit\u002Fconftest.py\n\n@pytest.fixture\ndef sample_claim() -> dict[str, object]:\n    \"\"\"Minimal valid claim for testing.\"\"\"\n    return {\"id\": 1, \"diagnosis\": \"Test\"}\n```\n\n## Rules\n\n- All test functions MUST have `-> None` return type\n- Use `pytest.raises(ExcType, match=\"pattern\")` — always include `match`\n- Use `pytest.mark.parametrize` for data-driven tests\n- Use `monkeypatch` for environment variables (never `os.environ` directly)\n- Use `tmp_path` for filesystem tests\n- Mark slow tests: `@pytest.mark.slow`\n- Never test private methods (underscore-prefixed)\n- Never use `time.sleep()` in tests\n- Never hardcode field names — use registry constants\n- Never use mutable defaults in fixtures\n\n## Anti-Patterns\n\n| Anti-Pattern | Correct Pattern |\n|-------------|----------------|\n| Testing private methods | Test through public API |\n| `time.sleep()` in tests | Use `pytest-timeout` or mocks |\n| Shared mutable state | Factory fixtures |\n| `assert True` \u002F `assert not False` | Assert specific values |\n| Exact float comparison | `pytest.approx()` |\n| Ignoring test warnings | Fix root cause |\n",{},"main","f726ce2f2bb4e3bcc2f56c066598f4acd910c5ee",".claude\u002Fskills\u002Ftesting-conventions","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template","https:\u002F\u002Fgithub.com\u002Flfr-ai","Optimizing for elegance","2026-07-20 12:19:48",{"source":7,"skillName":5,"commands":38,"prompt":48,"zipAvailable":49},[39,42,45],{"tool":40,"command":41},"npx","npx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions",{"tool":43,"command":44},"bunx","bunx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions",{"tool":46,"command":47},"pnpm","pnpm dlx skills add lfr-ai\u002Fcopier-fullstack-template --skill testing-conventions","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002F.claude\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",true,[],[52,83,89,95,112,118],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":66,"publishedAt":26},"01M6QQGVYW8BZ3W165A5YMJ1PF","ui-ux-frontend","Frontend UX, accessibility, responsive layout, and Storybook interaction quality standards.","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fui-ux-frontend\u002FSKILL.md",[58,61],{"categoryNo":59,"categoryName":60,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发",{"categoryNo":62,"categoryName":63,"taxonomyType":64,"taxonomyTypeDesc":65},"01JBSEEDCAT000000000000032","设计师","PROFESSION","适用职业",[67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82],"ui ux","ui ux frontend","ui","ux","frontend","storybook","frontend ux","interaction","layout","responsive","mdx","tsx","standards","quality","accessibility","css",{"skillNo":84,"name":5,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":85,"categories":86,"keywords":88,"publishedAt":26},"01M6QQGS7N3ENQZR2Y5JBRYDHD","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftesting-conventions\u002FSKILL.md",[87],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},[24,25,23],{"skillNo":90,"name":91,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":92,"categories":93,"keywords":94,"publishedAt":26},"01M6QQGQKA9Q6A147WXMS7QPGX","tdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Ftdd\u002FSKILL.md",[],[91],{"skillNo":96,"name":97,"nameZh":6,"description":98,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":99,"categories":100,"keywords":102,"publishedAt":26},"01M6QQG5AZPRWSR6SSCCDDPAM3","shadcn-ui","shadcn\u002Fui component conventions and composition patterns","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fshadcn-ui\u002FSKILL.md",[101],{"categoryNo":62,"categoryName":63,"taxonomyType":64,"taxonomyTypeDesc":65},[103,69,104,105,78,106,107,108,109,24,110,111],"shadcn ui","shadcn","component","Composition","src","composition patterns","presentation","patterns","ui component",{"skillNo":113,"name":114,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":115,"categories":116,"keywords":117,"publishedAt":26},"01M6QQG3WMMB8X8C4T8PR7WBV4","sdd","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fsdd\u002FSKILL.md",[],[114],{"skillNo":119,"name":120,"nameZh":6,"description":6,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":121,"categories":122,"keywords":123,"publishedAt":26},"01M6QQG241NAC5PQFXFD01NR16","quality-gate","https:\u002F\u002Fgithub.com\u002Flfr-ai\u002Fcopier-fullstack-template\u002Fblob\u002Fmain\u002Ftemplate\u002F.github\u002Fskills\u002Fquality-gate\u002FSKILL.md",[],[124,80,125],"quality gate","gate"]