[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7B3BKP8Q9FM4EES8DGXFYYM":3,"skill-same:01M7B3BKP8Q9FM4EES8DGXFYYM":51},{"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":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":24,"commitSha":25,"skillDirectory":26,"forksCount":14,"repositoryHtmlUrl":27,"repositoryHomepageUrl":27,"ownerHtmlUrl":28,"ownerBlogUrl":6,"ownerDescription":29,"updatedAt":30,"install":31,"resources":44},"01M7B3BKP8Q9FM4EES8DGXFYYM","vvkit-swift-swift-testing",null,"Use when writing or reviewing tests in Swift with the Swift Testing framework, including tests for concurrent or thread-shared state.","vadimvitvickiy\u002Fvv-agent-kit","vadimvitvickiy","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F5019512?v=4","01M7B3ABRYF7KHBCDW6GB2XH0C","Vadim Vitvitskii","01M7B3ABSZYG9MXP1CC7BQYM25",0,"MIT","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fcodex\u002Fplugins\u002Fvvkit-swift\u002Fskills\u002Fvvkit-swift-swift-testing\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: vvkit-swift-swift-testing\ndescription: \"Use when writing or reviewing tests in Swift with the Swift Testing framework, including tests for concurrent or thread-shared state.\"\n---\n\n# Swift Testing\n\n**REQUIRED BACKGROUND:** `$vvkit-writing-tests` — when a test is owed, unit vs component, and the\nacceptance filter. This covers only the framework: `@Test`, `@Suite`, `#expect`, `#require`,\n`confirmation`.\n\n## Codex runtime\n\nLoad referenced skills by reading their SKILL.md. Surveyor, reviewer and runner\nskills are role instructions, not registered agent types or enforced tool allowlists.\nUse a generic subagent only when delegation is available and permitted; otherwise\nperform the role inline. Follow the active session's model, context and permission\nrules. User authorization takes precedence over imported workflow approval gates.\nClaude hooks and plugin commands are not active in this package. Existing\n`.claude\u002Fcontext\u002F` paths refer to project documents, not Codex configuration.\n\nNot XCTest. UI automation (XCUITest) is XCTest, and a suite already in XCTest stays there — two\nframeworks in one suite split setup, assertions and failure output.\n\n## `#expect` can silently assert nothing\n\n```swift\n#expect((model?.ads ?? []).isEmpty)      \u002F\u002F asserts NOTHING\n```\n\n- This compiles, passes and checks nothing: the macro rewrites it to a closure over a non-optional\n  receiver and discards the result. The only signal is a warning (`expression of type 'Bool?' is\n  unused`); related expressions are hard errors, so the compiler is no guard.\n- **Never feed `#expect` optional chaining mixed with a trailing closure or `??`.** Hoist it:\n\n  ```swift\n  let ads = model?.ads ?? []\n  #expect(ads.isEmpty)\n  ```\n\n- **Treat any macro-expansion warning as a correctness failure.** A test asserting nothing reports as\n  coverage — worse than a missing test.\n\n## Shape of a test\n\n```swift\nimport Testing\n@testable import ExampleFramework\n\n@Suite(\"Mapper\")\nstruct MapperTests {\n\n    @Test(\"maps a paused item to the 2:1 shape\")\n    func mapsPausedShape() throws {\n        let mapped = try #require(Mapper.map(.fixture()))\n        #expect(mapped.shape == .twoToOne)\n    }\n\n    @Test(\"rejects every unsupported shape\", arguments: [Shape.bar, .full])\n    func rejectsUnsupported(shape: Shape) {\n        #expect(Mapper.map(.fixture(shape: shape)) == nil)\n    }\n}\n```\n\n- **`@Suite` on a `struct`** — a fresh instance per test. `final class` with `deinit` only for real\n  teardown — temp files, database pools.\n- **Setup in `init()`.** There is no `setUp` \u002F `tearDown`.\n- **`== true` \u002F `== false` over a bare boolean** — `#expect(!x)` prints nothing useful on failure.\n- **`try #require(x)`**, not a non-nil assertion then a force-unwrap.\n- **`Equatable` state and result types**, so one `#expect(state == expected)` checks every field.\n- **`@Test(arguments:)` only for table-driven cases** — same body, different data.\n- **Input\u002Fexpected pairs as one collection of case structs.** `arguments: inputs, expected` runs the\n  cartesian product; `zip` silently drops an unpaired input. Cases run in parallel — `.serialized` if\n  they share state.\n- **Human-sentence display names** in `@Test(\"…\")`.\n\n## Making an async assertion land\n\nIn this order; move down only when the tool above cannot express it.\n\n1. **Virtual time.** Inject a scheduler or clock the test controls. No seam: **propose one** — a\n   design finding. For async\u002Fawait — task groups, timeouts, cancellation — the seam is a spy the test\n   releases: `$vvkit-swift-swift-testing-async`.\n2. **`confirmation`** for \"fires exactly N times\" and \"stays silent\" (`expectedCount: 0`). It fails\n   with \"confirmed 0 times, but expected 1\", not a bare timeout.\n3. **Polling**, last resort, for wall-clock work. Poll to *synchronise*, then assert in a separate\n   `#expect` so the value prints. For non-nil, poll the predicate then `try #require`. Scale deadlines\n   by an environment knob, not edited timeouts.\n\n## Running a subset: the logged name is not the identifier\n\n`@Suite(\"…\")` \u002F `@Test(\"…\")` set a **display name** — what the log prints. `-only-testing` takes the\nSwift identifier: the type for a suite, the function with parentheses for a test.\n\n```swift\n@Suite(\"Currency\")            \u002F\u002F display name — appears in the log\nstruct CurrencyTests {        \u002F\u002F ← this is what -only-testing needs\n    @Test(\"currency codes compare case-insensitively\")\n    func codeComparisonIgnoresCase() { ... }   \u002F\u002F ← and this\n}\n```\n\n| Scope | Identifier |\n|-|-|\n| Whole bundle | `AppTests` |\n| One suite | `AppTests\u002FCurrencyTests` |\n| One test | `AppTests\u002FCurrencyTests\u002FcodeComparisonIgnoresCase()` |\n\n- A display name copied from the log matches nothing, and **`xcodebuild` runs zero tests and exits\n  0.** Read the count; a test script that does not fail on zero reports success for an empty filter.\n- Nested suites follow the type path, not display names. When in doubt, take the identifier from\n  source.\n\n## Coverage\n\n`xcodebuild test -enableCodeCoverage YES …`, then `xcrun xccov view --report --json \u003Cbundle>.xcresult`\nfor per-function numbers. Without the flag the report is empty and nothing warns.\n\n## Watchdogs\n\n- **`.timeLimit` cannot catch a cooperative-pool deadlock.** It is minutes-only, a task group racing a\n  sleep: a task blocked on a lock never cancels, and the timeout task needs the same wedged pool.\n- A working watchdog needs a dedicated non-cooperative thread. Use the project's; testing lock-based\n  code without one, add it once.\n\n## Concurrency\n\nCode crossing a thread, queue or isolation boundary — locks, dispatch queues, timers, KVO, delegate\ncallbacks, actors — is a different problem from landing an async assertion. Shapes, the weakest-tool\nladder and the first-access trap: `references\u002Fconcurrency.md`.\n","# Swift Testing\n\n**REQUIRED BACKGROUND:** `$vvkit-writing-tests` — when a test is owed, unit vs component, and the\nacceptance filter. This covers only the framework: `@Test`, `@Suite`, `#expect`, `#require`,\n`confirmation`.\n\n## Codex runtime\n\nLoad referenced skills by reading their SKILL.md. Surveyor, reviewer and runner\nskills are role instructions, not registered agent types or enforced tool allowlists.\nUse a generic subagent only when delegation is available and permitted; otherwise\nperform the role inline. Follow the active session's model, context and permission\nrules. User authorization takes precedence over imported workflow approval gates.\nClaude hooks and plugin commands are not active in this package. Existing\n`.claude\u002Fcontext\u002F` paths refer to project documents, not Codex configuration.\n\nNot XCTest. UI automation (XCUITest) is XCTest, and a suite already in XCTest stays there — two\nframeworks in one suite split setup, assertions and failure output.\n\n## `#expect` can silently assert nothing\n\n```swift\n#expect((model?.ads ?? []).isEmpty)      \u002F\u002F asserts NOTHING\n```\n\n- This compiles, passes and checks nothing: the macro rewrites it to a closure over a non-optional\n  receiver and discards the result. The only signal is a warning (`expression of type 'Bool?' is\n  unused`); related expressions are hard errors, so the compiler is no guard.\n- **Never feed `#expect` optional chaining mixed with a trailing closure or `??`.** Hoist it:\n\n  ```swift\n  let ads = model?.ads ?? []\n  #expect(ads.isEmpty)\n  ```\n\n- **Treat any macro-expansion warning as a correctness failure.** A test asserting nothing reports as\n  coverage — worse than a missing test.\n\n## Shape of a test\n\n```swift\nimport Testing\n@testable import ExampleFramework\n\n@Suite(\"Mapper\")\nstruct MapperTests {\n\n    @Test(\"maps a paused item to the 2:1 shape\")\n    func mapsPausedShape() throws {\n        let mapped = try #require(Mapper.map(.fixture()))\n        #expect(mapped.shape == .twoToOne)\n    }\n\n    @Test(\"rejects every unsupported shape\", arguments: [Shape.bar, .full])\n    func rejectsUnsupported(shape: Shape) {\n        #expect(Mapper.map(.fixture(shape: shape)) == nil)\n    }\n}\n```\n\n- **`@Suite` on a `struct`** — a fresh instance per test. `final class` with `deinit` only for real\n  teardown — temp files, database pools.\n- **Setup in `init()`.** There is no `setUp` \u002F `tearDown`.\n- **`== true` \u002F `== false` over a bare boolean** — `#expect(!x)` prints nothing useful on failure.\n- **`try #require(x)`**, not a non-nil assertion then a force-unwrap.\n- **`Equatable` state and result types**, so one `#expect(state == expected)` checks every field.\n- **`@Test(arguments:)` only for table-driven cases** — same body, different data.\n- **Input\u002Fexpected pairs as one collection of case structs.** `arguments: inputs, expected` runs the\n  cartesian product; `zip` silently drops an unpaired input. Cases run in parallel — `.serialized` if\n  they share state.\n- **Human-sentence display names** in `@Test(\"…\")`.\n\n## Making an async assertion land\n\nIn this order; move down only when the tool above cannot express it.\n\n1. **Virtual time.** Inject a scheduler or clock the test controls. No seam: **propose one** — a\n   design finding. For async\u002Fawait — task groups, timeouts, cancellation — the seam is a spy the test\n   releases: `$vvkit-swift-swift-testing-async`.\n2. **`confirmation`** for \"fires exactly N times\" and \"stays silent\" (`expectedCount: 0`). It fails\n   with \"confirmed 0 times, but expected 1\", not a bare timeout.\n3. **Polling**, last resort, for wall-clock work. Poll to *synchronise*, then assert in a separate\n   `#expect` so the value prints. For non-nil, poll the predicate then `try #require`. Scale deadlines\n   by an environment knob, not edited timeouts.\n\n## Running a subset: the logged name is not the identifier\n\n`@Suite(\"…\")` \u002F `@Test(\"…\")` set a **display name** — what the log prints. `-only-testing` takes the\nSwift identifier: the type for a suite, the function with parentheses for a test.\n\n```swift\n@Suite(\"Currency\")            \u002F\u002F display name — appears in the log\nstruct CurrencyTests {        \u002F\u002F ← this is what -only-testing needs\n    @Test(\"currency codes compare case-insensitively\")\n    func codeComparisonIgnoresCase() { ... }   \u002F\u002F ← and this\n}\n```\n\n| Scope | Identifier |\n|-|-|\n| Whole bundle | `AppTests` |\n| One suite | `AppTests\u002FCurrencyTests` |\n| One test | `AppTests\u002FCurrencyTests\u002FcodeComparisonIgnoresCase()` |\n\n- A display name copied from the log matches nothing, and **`xcodebuild` runs zero tests and exits\n  0.** Read the count; a test script that does not fail on zero reports success for an empty filter.\n- Nested suites follow the type path, not display names. When in doubt, take the identifier from\n  source.\n\n## Coverage\n\n`xcodebuild test -enableCodeCoverage YES …`, then `xcrun xccov view --report --json \u003Cbundle>.xcresult`\nfor per-function numbers. Without the flag the report is empty and nothing warns.\n\n## Watchdogs\n\n- **`.timeLimit` cannot catch a cooperative-pool deadlock.** It is minutes-only, a task group racing a\n  sleep: a task blocked on a lock never cancels, and the timeout task needs the same wedged pool.\n- A working watchdog needs a dedicated non-cooperative thread. Use the project's; testing lock-based\n  code without one, add it once.\n\n## Concurrency\n\nCode crossing a thread, queue or isolation boundary — locks, dispatch queues, timers, KVO, delegate\ncallbacks, actors — is a different problem from landing an async assertion. Shapes, the weakest-tool\nladder and the first-access trap: `references\u002Fconcurrency.md`.\n",{"name":5,"description":7},"main","cc22a222a76add5759a2df5fadf231a758691db5","codex\u002Fplugins\u002Fvvkit-swift\u002Fskills\u002Fvvkit-swift-swift-testing","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy","Senior iOS engineer. Architecture, SDKs and apps for iOS, tvOS and watchOS.","2026-11-13 19:10:29",{"source":8,"skillName":5,"commands":32,"prompt":42,"zipAvailable":43},[33,36,39],{"tool":34,"command":35},"npx","npx skills add vadimvitvickiy\u002Fvv-agent-kit --skill vvkit-swift-swift-testing",{"tool":37,"command":38},"bunx","bunx skills add vadimvitvickiy\u002Fvv-agent-kit --skill vvkit-swift-swift-testing",{"tool":40,"command":41},"pnpm","pnpm dlx skills add vadimvitvickiy\u002Fvv-agent-kit --skill vvkit-swift-swift-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fcodex\u002Fplugins\u002Fvvkit-swift\u002Fskills\u002Fvvkit-swift-swift-testing\u002FSKILL.md",true,[45],{"path":46,"resourceType":47,"resourceTypeDesc":48,"sizeBytes":49,"sourceHtmlUrl":50},"references\u002Fconcurrency.md","REFERENCE","参考文档",9190,"https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fcodex\u002Fplugins\u002Fvvkit-swift\u002Fskills\u002Fvvkit-swift-swift-testing\u002Freferences\u002Fconcurrency.md",[52,59,66,73,80,87],{"skillNo":53,"name":54,"nameZh":6,"description":55,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":56,"categories":57,"keywords":58,"publishedAt":19},"01M7B3JN7VG0YJ4JB8RP6HYZSJ","no-heading","Use when proving that the validator rejects a body with no H1 and a force-loading @-link.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fno-heading\u002FSKILL.md",[],[],{"skillNo":60,"name":61,"nameZh":6,"description":62,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":63,"categories":64,"keywords":65,"publishedAt":19},"01M7B3JJMEW4E710ZG6HYJ7BWV","wrong-name-does-not-match-dir","Dispatches a subagent per task and reviews between each one.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fbroken-skill\u002FSKILL.md",[],[],{"skillNo":67,"name":68,"nameZh":6,"description":69,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":70,"categories":71,"keywords":72,"publishedAt":19},"01M7B3JGE9MFT1HRP41YRVKN97","writing-tests","Use when adding or changing behavior, fixing a bug, or judging whether an existing or generated test earns its place.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-tests\u002FSKILL.md",[],[],{"skillNo":74,"name":75,"nameZh":6,"description":76,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":77,"categories":78,"keywords":79,"publishedAt":19},"01M7B3JD5X32VEBDBN7HB8E17Z","writing-skills","Use when authoring or editing a skill, agent, command or hook for this kit, or when deciding whether a piece of guidance belongs in a skill at all.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-skills\u002FSKILL.md",[],[],{"skillNo":81,"name":82,"nameZh":6,"description":83,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":84,"categories":85,"keywords":86,"publishedAt":19},"01M7B3J992MZH2QVZRED0DRPD9","writing-project-instructions","Use when creating or editing a CLAUDE.md or AGENTS.md, when it has grown long, or when a rule in it also exists in an installed skill.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-project-instructions\u002FSKILL.md",[],[],{"skillNo":88,"name":89,"nameZh":6,"description":90,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":91,"categories":92,"keywords":93,"publishedAt":19},"01M7B3J55C5WPWN20QXP9ET848","writing-logs","Use when adding or reviewing log statements, or when deciding what level a message belongs at.","https:\u002F\u002Fgithub.com\u002Fvadimvitvickiy\u002Fvv-agent-kit\u002Fblob\u002Fmain\u002Fskills\u002Fwriting-logs\u002FSKILL.md",[],[]]