[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M71H7S1NB9F2SWR83DCKXBA7":3,"skill-same:01M71H7S1NB9F2SWR83DCKXBA7":77},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":22,"publishedAt":35,"linkOnly":36,"markdownContent":37,"markdownBody":38,"frontMatter":39,"refName":40,"commitSha":41,"skillDirectory":42,"forksCount":43,"repositoryHtmlUrl":44,"repositoryHomepageUrl":6,"ownerHtmlUrl":45,"ownerBlogUrl":6,"ownerDescription":6,"updatedAt":46,"install":47,"resources":60},"01M71H7S1NB9F2SWR83DCKXBA7","barrier-concurrency-testing",null,"Deterministic race condition testing using barriers and deferred promises. Replaces flaky setTimeout-based timing tests with reproducible interleaving control.","JSGforever\u002Fskillguard","JSGforever","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F85541948?v=4","01M71FQD3E132VMR5F4TAYX3YS","01M71FQD4DYW0XJ4XQ4YQH75Y9",2,"GPL-3.0","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing\u002FSKILL.md",[17],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000008","测试与质量","SCENARIO","使用场景",[23,24,25,26,27,28,29,30,31,32,33,34],"barrier concurrency testing","concurrency","testing","concurrency testing","with","deterministic","condition","promises","control","Reproducible","timing","tests","2026-11-10 10:12:30",false,"---\nname: barrier-concurrency-testing\ndescription: Deterministic race condition testing using barriers and deferred promises. Replaces flaky setTimeout-based timing tests with reproducible interleaving control.\n---\n\n# Barrier Concurrency Testing\n\nDeterministic race condition testing -- no flaky timing-based tests.\n\nInstead of `setTimeout` (flaky) or `sleep` (slow), use **barriers** to pause execution at exact interleave points. The test controls when each concurrent operation proceeds, making race condition tests deterministic and reproducible on every run.\n\n**When to use**: Testing concurrent operations, flush conflicts, parallel mutations, race windows between read and write, lock contention scenarios, any code where timing affects correctness.\n\n**When not to use**: Sequential-only code, simple unit tests, UI components, read-only operations, code with no concurrency concerns.\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"setTimeout is good enough\" | Timing-based tests are inherently flaky -- they pass 99 times, fail on CI | Use barriers for deterministic control |\n| \"It passed 10 times, it's fine\" | Heisenbugs hide in timing windows that haven't been hit yet | Barrier at every interleave point |\n| \"We don't have race conditions\" | Any concurrent code has race windows | Write a barrier test to prove it |\n| \"Barriers are too complex\" | 15 lines of setup prevents hours of debugging flaky failures | Copy the pattern from references |\n\n---\n\n## What To Protect (Start Here)\n\nBefore generating barrier tests, identify which concurrency decisions apply to your code:\n\n| Decision | Question to Answer | If Yes → Use |\n|----------|--------------------|--------------|\n| Concurrent writes must not lose data | Can two writes to the same resource happen simultaneously? | `assertPreservesConcurrentItems` |\n| Failed operations must not corrupt state | Can a failure leave behind partial or inconsistent state? | `assertPreservesOnFailure` |\n| Event\u002Fmessage ordering must be preserved | Does processing order affect correctness? | `assertSequenceContinuity` |\n| Retry state must reset on new input | Can stale retry counts or error flags affect new operations? | `assertRetryCountReset` |\n\n**Do not generate tests for decisions the human hasn't confirmed.** A barrier test without a named invariant is coverage theater — it proves the barrier works, not that the system is correct.\n\n---\n\n## Included Utilities\n\n```typescript\n\u002F\u002F Barrier infrastructure + invariant assertions + test data generators\nimport {\n  createBarrier,\n  createTrackedBarrier,\n  releaseAllBarriers,\n  assertPreservesConcurrentItems,\n  assertPreservesOnFailure,\n  assertSequenceContinuity,\n  assertLastSequenceCorrect,\n  assertRetryCountReset,\n  createTestItems,\n} from '.\u002Ftest-fixtures.ts';\n```\n\n## Violation Rules\n\n### inadequate_barrier_coverage\nRace conditions MUST have barrier tests at each interleave point. If there are N interleave points in the code, there must be N barrier test cases.\n**Severity**: must-fail\n\n### flaky_timing_test\nNEVER use `setTimeout`, `sleep`, or arbitrary delays for concurrency testing. Use barriers for deterministic control.\n**Severity**: must-fail\n\n---\n\n## Companion Skills\n\nThis skill provides **deterministic timing control** for concurrency tests, not concurrency architecture guidance. For broader methodology:\n\n- Search `concurrency` on [skills.sh](https:\u002F\u002Fskills.sh) for lock-free patterns, actor models, and thread safety analysis\n- Concurrent state machines need transition coverage — use [model-based-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fmodel-based-testing) for N*N transition matrices and guard truth tables\n- Concurrent failure recovery needs resilience testing — use [fault-injection-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Ffault-injection-testing) for circuit breaker, retry policy, and queue preservation under concurrent load\n\n---\n\n## Quick Reference\n\n| Scenario | Pattern | Example |\n|----------|---------|---------|\n| Block before transaction | `barrier.wait()` in transaction start | Verify concurrent writes preserved |\n| Block during I\u002FO | `deferred.promise` as mock return | Verify queue depth during processing |\n| Multiple interleave points | Multiple barriers, release in sequence | Test all orderings of concurrent ops |\n| Cleanup | `afterEach(() => releaseAllBarriers())` | Prevent test hangs |\n\nSee [patterns.md](.\u002Freferences\u002Fpatterns.md) for full code examples, deferred promise alternative, and framework adaptation guide.\n","# Barrier Concurrency Testing\n\nDeterministic race condition testing -- no flaky timing-based tests.\n\nInstead of `setTimeout` (flaky) or `sleep` (slow), use **barriers** to pause execution at exact interleave points. The test controls when each concurrent operation proceeds, making race condition tests deterministic and reproducible on every run.\n\n**When to use**: Testing concurrent operations, flush conflicts, parallel mutations, race windows between read and write, lock contention scenarios, any code where timing affects correctness.\n\n**When not to use**: Sequential-only code, simple unit tests, UI components, read-only operations, code with no concurrency concerns.\n\n## Rationalizations (Do Not Skip)\n\n| Rationalization | Why It's Wrong | Required Action |\n|-----------------|----------------|-----------------|\n| \"setTimeout is good enough\" | Timing-based tests are inherently flaky -- they pass 99 times, fail on CI | Use barriers for deterministic control |\n| \"It passed 10 times, it's fine\" | Heisenbugs hide in timing windows that haven't been hit yet | Barrier at every interleave point |\n| \"We don't have race conditions\" | Any concurrent code has race windows | Write a barrier test to prove it |\n| \"Barriers are too complex\" | 15 lines of setup prevents hours of debugging flaky failures | Copy the pattern from references |\n\n---\n\n## What To Protect (Start Here)\n\nBefore generating barrier tests, identify which concurrency decisions apply to your code:\n\n| Decision | Question to Answer | If Yes → Use |\n|----------|--------------------|--------------|\n| Concurrent writes must not lose data | Can two writes to the same resource happen simultaneously? | `assertPreservesConcurrentItems` |\n| Failed operations must not corrupt state | Can a failure leave behind partial or inconsistent state? | `assertPreservesOnFailure` |\n| Event\u002Fmessage ordering must be preserved | Does processing order affect correctness? | `assertSequenceContinuity` |\n| Retry state must reset on new input | Can stale retry counts or error flags affect new operations? | `assertRetryCountReset` |\n\n**Do not generate tests for decisions the human hasn't confirmed.** A barrier test without a named invariant is coverage theater — it proves the barrier works, not that the system is correct.\n\n---\n\n## Included Utilities\n\n```typescript\n\u002F\u002F Barrier infrastructure + invariant assertions + test data generators\nimport {\n  createBarrier,\n  createTrackedBarrier,\n  releaseAllBarriers,\n  assertPreservesConcurrentItems,\n  assertPreservesOnFailure,\n  assertSequenceContinuity,\n  assertLastSequenceCorrect,\n  assertRetryCountReset,\n  createTestItems,\n} from '.\u002Ftest-fixtures.ts';\n```\n\n## Violation Rules\n\n### inadequate_barrier_coverage\nRace conditions MUST have barrier tests at each interleave point. If there are N interleave points in the code, there must be N barrier test cases.\n**Severity**: must-fail\n\n### flaky_timing_test\nNEVER use `setTimeout`, `sleep`, or arbitrary delays for concurrency testing. Use barriers for deterministic control.\n**Severity**: must-fail\n\n---\n\n## Companion Skills\n\nThis skill provides **deterministic timing control** for concurrency tests, not concurrency architecture guidance. For broader methodology:\n\n- Search `concurrency` on [skills.sh](https:\u002F\u002Fskills.sh) for lock-free patterns, actor models, and thread safety analysis\n- Concurrent state machines need transition coverage — use [model-based-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Fmodel-based-testing) for N*N transition matrices and guard truth tables\n- Concurrent failure recovery needs resilience testing — use [fault-injection-testing](https:\u002F\u002Fgithub.com\u002Fapankov1\u002Fquality-engineering\u002Ftree\u002Fmain\u002Fskills\u002Ffault-injection-testing) for circuit breaker, retry policy, and queue preservation under concurrent load\n\n---\n\n## Quick Reference\n\n| Scenario | Pattern | Example |\n|----------|---------|---------|\n| Block before transaction | `barrier.wait()` in transaction start | Verify concurrent writes preserved |\n| Block during I\u002FO | `deferred.promise` as mock return | Verify queue depth during processing |\n| Multiple interleave points | Multiple barriers, release in sequence | Test all orderings of concurrent ops |\n| Cleanup | `afterEach(() => releaseAllBarriers())` | Prevent test hangs |\n\nSee [patterns.md](.\u002Freferences\u002Fpatterns.md) for full code examples, deferred promise alternative, and framework adaptation guide.\n",{"name":5,"description":7},"main","f2ec4b3b9133d34eeaf9b38e4b0a97e8e5705a7f","benchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing",0,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard","https:\u002F\u002Fgithub.com\u002FJSGforever","2026-08-29 18:27:56",{"source":8,"skillName":5,"commands":48,"prompt":58,"zipAvailable":59},[49,52,55],{"tool":50,"command":51},"npx","npx skills add JSGforever\u002Fskillguard --skill barrier-concurrency-testing",{"tool":53,"command":54},"bunx","bunx skills add JSGforever\u002Fskillguard --skill barrier-concurrency-testing",{"tool":56,"command":57},"pnpm","pnpm dlx skills add JSGforever\u002Fskillguard --skill barrier-concurrency-testing","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing\u002FSKILL.md",true,[61,67,73],{"path":62,"resourceType":63,"resourceTypeDesc":64,"sizeBytes":65,"sourceHtmlUrl":66},"references\u002Fpatterns.md","REFERENCE","参考文档",3664,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing\u002Freferences\u002Fpatterns.md",{"path":68,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":71,"sourceHtmlUrl":72},"test-fixtures.spec.ts","SCRIPT","脚本",3037,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing\u002Ftest-fixtures.spec.ts",{"path":74,"resourceType":69,"resourceTypeDesc":70,"sizeBytes":75,"sourceHtmlUrl":76},"test-fixtures.ts",7387,"https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__apankov1--barrier-concurrency-testing\u002Ftest-fixtures.ts",[78,108,124,151,173,194],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":87,"publishedAt":35},"01M71HY2SNXBA9Q00WZDTZQ31Z","skillguard-codex-scanner","Hybrid deterministic+LLM agent-skill security scanner. Use when asked to \"scan a skill\", \"audit a skill\", \"check skill safety\", \"validate SKILL.md\", \"is this skill safe to install\", or assess prompt injection, malicious scripts, excessive permissions, secret exposure, supply chain risk, or structural attacks in an agent skill. Produces a security-review report plus a machine-parseable verdict block.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fsrc\u002Fskillguard\u002Fstatic_scanner\u002Fskillguard-codex-scanner\u002FSKILL.md",[84],{"categoryNo":85,"categoryName":86,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000023","Skill与智能体开发",[88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107],"scanner","skillguard codex scanner","skillguard","codex","chain","skill security","security-review","review report","structural","secret","prompt injection","security scanner","when","review","malicious","permissions","exposure","audit","scripts","safe",{"skillNo":109,"name":110,"nameZh":6,"description":111,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":112,"licenseFileUrl":6,"sourceHtmlUrl":113,"categories":114,"keywords":120,"publishedAt":35},"01M71HY0SPKTT3S27BC2HPAC5M","data-exfiltrator","Analyzes data files","MIT","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Fsmoke-one-skill\u002Fasset1__cisco-ai-defense--data-exfiltrator\u002FSKILL.md",[115],{"categoryNo":116,"categoryName":117,"taxonomyType":118,"taxonomyTypeDesc":119},"01JBSEEDCAT000000000000033","数据分析师","PROFESSION","适用职业",[121,122,123],"data","data exfiltrator","files",{"skillNo":125,"name":126,"nameZh":6,"description":127,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":128,"categories":129,"keywords":130,"publishedAt":35},"01M71HXVS9EMN44BGDW215FZ72","real-time-collaboration-engine","Build real-time collaborative editing with WebSockets, OT\u002FCRDT conflict resolution, and presence awareness. Implements cursor tracking, optimistic updates, and offline sync. Use for collaborative editors, whiteboards, video editing. Activate on \"real-time collaboration\", \"WebSocket sync\", \"multiplayer editing\", \"CRDT\", \"presence awareness\". NOT for simple chat, request-response APIs, or single-user apps.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--real-time-collaboration-engine\u002FSKILL.md",[],[131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150],"time","real time collaboration engine","real time collaboration","collaboration","engine","real time","Video","reliability","video editing","performance","conflict resolution","presence","access","apps","updates","Bash","activate","optimizer","react","streaming",{"skillNo":152,"name":153,"nameZh":6,"description":154,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":155,"categories":156,"keywords":160,"publishedAt":35},"01M71HXP6CTY4KFN0QVMMN0V7J","react-performance-optimizer","Optimize React apps for 60fps performance. Implements memoization, virtualization, code splitting, bundle optimization. Use for slow renders, large lists, bundle bloat. Activate on \"React performance\", \"slow render\", \"useMemo\", \"bundle size\", \"virtualization\". NOT for backend optimization, non-React frameworks, or premature optimization.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--react-performance-optimizer\u002FSKILL.md",[157],{"categoryNo":158,"categoryName":159,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000009","前端开发",[140,161,148,149,162,163,164,165,166,167,131,168,169,144,146,170,147,150,171,172],"react performance optimizer","react performance","performance optimizer","app","nextjs","expert","re","render","2025","code","router","strategies",{"skillNo":174,"name":175,"nameZh":6,"description":176,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":177,"categories":178,"keywords":180,"publishedAt":35},"01M71HXH7QXSQB4QTDZ7SP7YXQ","llm-streaming-response-handler","Build production LLM streaming UIs with Server-Sent Events, real-time token display, cancellation, error recovery. Handles OpenAI\u002FAnthropic\u002FClaude streaming APIs. Use for chatbots, AI assistants, real-time text generation. Activate on \"LLM streaming\", \"SSE\", \"token stream\", \"chat UI\", \"real-time AI\". NOT for batch processing, non-streaming APIs, or WebSocket bidirectional chat.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--llm-streaming-response-handler\u002FSKILL.md",[179],{"categoryNo":158,"categoryName":159,"taxonomyType":20,"taxonomyTypeDesc":21},[181,150,182,183,184,185,140,131,186,187,188,146,147,148,189,149,190,191,192,193],"llm streaming response handler","handler","error","processing","retry","chat ui","error recovery","critical","batch","display","text","server","read",{"skillNo":195,"name":196,"nameZh":6,"description":197,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":6,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":198,"categories":199,"keywords":205,"publishedAt":35},"01M71HXCB0E1YRKYW1Y8T0Y106","github-actions-pipeline-builder","Build production CI\u002FCD pipelines with GitHub Actions. Implements matrix builds, caching, deployments, testing, security scanning. Use for automated testing, deployments, release workflows. Activate on \"GitHub Actions\", \"CI\u002FCD\", \"workflow\", \"deployment pipeline\", \"automated testing\". NOT for Jenkins\u002FCircleCI, manual deployments, or non-GitHub repositories.","https:\u002F\u002Fgithub.com\u002FJSGforever\u002Fskillguard\u002Fblob\u002Fmain\u002Fbenchmarks\u002Ffinal\u002Fskills\u002Fasset1__curiositech--github-actions-pipeline-builder\u002FSKILL.md",[200,201,204],{"categoryNo":18,"categoryName":19,"taxonomyType":20,"taxonomyTypeDesc":21},{"categoryNo":202,"categoryName":203,"taxonomyType":20,"taxonomyTypeDesc":21},"01JBSEEDCAT000000000000011","运维与部署",{"categoryNo":85,"categoryName":86,"taxonomyType":20,"taxonomyTypeDesc":21},[206,207,208,209,210,211,212,138,166,25,213,214,147,172,215,193,216,217,218,219],"github actions pipeline builder","actions","github actions","pipeline builder","github","builder","pipeline","ci","workflows","run","release","write","edit","git"]