[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M7EKCGGKJQQ6QX71R22HTZ7C":3,"skill-same:01M7EKCGGKJQQ6QX71R22HTZ7C":76},{"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":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":20,"frontMatter":21,"refName":22,"commitSha":23,"skillDirectory":24,"forksCount":13,"repositoryHtmlUrl":25,"repositoryHomepageUrl":6,"ownerHtmlUrl":26,"ownerBlogUrl":27,"ownerDescription":28,"updatedAt":29,"install":30,"resources":43},"01M7EKCGGKJQQ6QX71R22HTZ7C","concurrency-quality",null,"raillen\u002Fdaisy-code-editor","raillen","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F50306048?v=4","01M7EKBDVVBSPF21PBPVJYMNYR","Raillen Santos","01M7EKBDWD12A1K9N9Y638FGX9",0,"MIT","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"# Concurrency Quality & Parallel Execution Invariants\n\n## Purpose\nEnforce provable correctness, data race freedom, deadlock prevention, bounded resource allocation, and predictable throughput across multi-threaded, asynchronous, and distributed concurrent systems. Guarantee deterministic cancellation trees, backpressure propagation, and zero thread\u002Fgoroutine leakage across system lifecycles.\n\n## Use when\n- Designing, implementing, or auditing concurrent subsystems, worker pools, async pipelines, and event loops.\n- Synchronizing access to shared mutable state via mutexes, read-write locks, lock-free atomics, or channels.\n- Mitigating concurrency hazards: data races, deadlocks, livelocks, thread starvation, priority inversion, and false sharing.\n- Establishing cooperative task cancellation, graceful termination sequences, and backpressure mechanisms.\n- Validating concurrent code under automated race detectors (`go test -race`, ThreadSanitizer `tsan`, Loom, Tokio console).\n\n## Do not use when\n- Implementing purely sequential, single-threaded algorithms with no async boundaries or background tasks.\n- Designing high-level relational database schema migrations without connection pooling or transactional isolation analysis (use `database-review`).\n- Measuring static web asset loading waterfalls without concurrent runtime workers (use `performance-web`).\n\n## Required context\n- Target runtime concurrency model: Go CSP (goroutines\u002Fchannels), Rust (ownership\u002FSend\u002FSync\u002FTokio), C++20 (`std::jthread`\u002Fatomics), or Python (asyncio\u002Fmultiprocessing).\n- Memory consistency model: Acquire-Release semantics, Sequential Consistency, or runtime happens-before rules.\n- Hardware concurrency constraints: CPU core count, NUMA architecture, cache line size (typically 64 bytes).\n- System throughput, latency SLAs, and queue backpressure boundaries.\n\n## Procedure\n1. **Model Shared State & Enforce Bernstein Conditions**:\n   - For all concurrent operations $T_j$ and $T_k$ ($j \\neq k$), mathematically verify Bernstein's Conditions:\n     $$I_j \\cap O_k = \\emptyset, \\quad O_j \\cap I_k = \\emptyset, \\quad O_j \\cap O_k = \\emptyset$$\n   - Where shared mutable state is unavoidable, encapsulate state within a protective synchronization boundary (mutex, actor, or atomic register).\n2. **Establish Strict Global Lock Hierarchy**:\n   - Construct a directed acyclic graph (DAG) of all lock acquisitions.\n   - Enforce a strict total order: if lock $L_A$ precedes $L_B$ in the hierarchy, any thread acquiring both must acquire $L_A$ before $L_B$.\n   - Never invoke dynamic callbacks, trait methods, or external blocking I\u002FO while holding a mutex lock.\n3. **Enforce Bounded Buffers & Backpressure**:\n   - Forbid unbounded queues, unbounded channels, and unbounded goroutine\u002Fthread spawning.\n   - Size queues using Little's Law ($L = \\lambda W$) where buffer capacity accommodates peak burst without exhausting system memory.\n   - Implement explicit rejection, shedding, or upstream throttling when buffer thresholds are saturated.\n4. **Structure Cooperative Cancellation & Task Lifecycles**:\n   - Establish parent-child cancellation trees using structured concurrency (e.g., `context.Context`, `CancellationToken`, or nursery scopes).\n   - Require all blocking primitives (channel reads, socket polls, condition variables) to listen for cancellation signals.\n   - Bind all spawned tasks to a lifecycle tracker (`sync.WaitGroup`, task nursery, or join handle) guaranteeing deterministic joining before shutdown.\n5. **Optimize Hardware & Cache Synchronization**:\n   - Align atomic variables and contended counters to distinct 64-byte cache line boundaries (`alignas(64)` or padding fields) to eliminate false sharing.\n   - Minimize lock hold times: compute results outside the critical section, acquire the lock only to swap pointers\u002Fstate, and release immediately.\n6. **Verify Under Dynamic & Static Race Analyzers**:\n   - Execute test suites under dynamic race detection (`-race` \u002F `-fsanitize=thread`).\n   - Subject concurrent loops to high-iteration stress tests ($N \\ge 10{,}000$) with aggressive context switching to reveal edge interleavings.\n\n## Decision rules\n- **Zero Data Races**: Any data race reported by ThreadSanitizer or Go `-race` is a critical severity defect that blocks release.\n- **Bounded Resources**: Every channel, queue, and worker pool must have an explicit capacity limit. Unbounded growth is an anti-pattern.\n- **Minimal Critical Sections**: Critical sections must contain only memory operations; no network calls, disk I\u002FO, or foreign library calls may execute under a lock.\n- **Hierarchical Locking**: Acquiring locks out of hierarchy order is strictly prohibited. If two locks cannot be statically ordered, use `TryLock` with backoff and retry.\n- **Graceful Draining**: Applications must drain pending in-flight tasks within a configurable timeout before forcing SIGKILL or aborting.\n\n## Evidence required\n- Concurrency architecture specification documenting the lock hierarchy DAG and cancellation propagation.\n- Test logs with race detection enabled (`go test -race` or `tsan`) demonstrating 0 race warnings.\n- Stress benchmark results demonstrating throughput scaling without lock convoying or thread starvation.\n- Verification script execution log from `scripts\u002Fverify.sh` exiting with code 0.\n\n## Output contract\n- Concurrency design document adhering to `templates\u002Fconcurrency-architecture-spec.md`.\n- Concurrency checklist verification in `checks\u002Fconcurrency-checklist.md`.\n- Reproducible, automated race-detection test harness.\n\n## Stop conditions\n- Complete concurrency verification passed with zero data races and zero deadlocks.\n- All tasks bounded, structured, and guaranteed to terminate cleanly upon cancellation.\n- Token budget exhausted or irreconcilable deadlocks in third-party runtime dependencies.\n\n## Escalation rules\n- Escalate to Architecture Lead if third-party libraries require holding locks across asynchronous boundaries.\n- Escalate to Infrastructure Lead if memory consumption under peak backpressure exceeds host container cgroup limits.\n",{},"main","2e465213b972294984c8c9515a47f811e4b358da",".agents\u002Fskills\u002Fconcurrency-quality","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor","https:\u002F\u002Fgithub.com\u002Fraillen","https:\u002F\u002Fraillen.com","\u003C\u003CMarketing & IT>>\r\n\r\n@poppy-team\r\n@wasd-lat ","2026-10-16 09:17:52",{"source":7,"skillName":5,"commands":31,"prompt":41,"zipAvailable":42},[32,35,38],{"tool":33,"command":34},"npx","npx skills add raillen\u002Fdaisy-code-editor --skill concurrency-quality",{"tool":36,"command":37},"bunx","bunx skills add raillen\u002Fdaisy-code-editor --skill concurrency-quality",{"tool":39,"command":40},"pnpm","pnpm dlx skills add raillen\u002Fdaisy-code-editor --skill concurrency-quality","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002FSKILL.md",true,[44,50,56,60,64,68,72],{"path":45,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":48,"sourceHtmlUrl":49},"checks\u002Fconcurrency-checklist.md","REFERENCE","参考文档",3445,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Fchecks\u002Fconcurrency-checklist.md",{"path":51,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":54,"sourceHtmlUrl":55},"examples\u002Fbounded_worker_pool_test.go","SCRIPT","脚本",2252,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Fexamples\u002Fbounded_worker_pool_test.go",{"path":57,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":58,"sourceHtmlUrl":59},"examples\u002Fbounded_worker_pool.go",3557,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Fexamples\u002Fbounded_worker_pool.go",{"path":61,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":62,"sourceHtmlUrl":63},"manifest.json",1760,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Fmanifest.json",{"path":65,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":66,"sourceHtmlUrl":67},"references\u002Fconcurrency-engineering-guide.md",6960,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Freferences\u002Fconcurrency-engineering-guide.md",{"path":69,"resourceType":52,"resourceTypeDesc":53,"sizeBytes":70,"sourceHtmlUrl":71},"scripts\u002Fverify.sh",1434,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Fscripts\u002Fverify.sh",{"path":73,"resourceType":46,"resourceTypeDesc":47,"sizeBytes":74,"sourceHtmlUrl":75},"templates\u002Fconcurrency-architecture-spec.md",3489,"https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.agents\u002Fskills\u002Fconcurrency-quality\u002Ftemplates\u002Fconcurrency-architecture-spec.md",[77,83,89,96,103,110],{"skillNo":78,"name":79,"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":80,"categories":81,"keywords":82,"publishedAt":18},"01M7EKQYSDAX3SGSCRF873Z8E2","zoom-reflow","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fzoom-reflow\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"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":86,"categories":87,"keywords":88,"publishedAt":18},"01M7EKQX0MWJNQD482GGZPGES4","wireframe-styleguide","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fwireframe-styleguide\u002FSKILL.md",[],[],{"skillNo":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"publishedAt":18},"01M7EKQS57FS6JYE6KWW6X5ADJ","visual-regression","Pixel-by-pixel snapshot testing, Playwright integration, dynamic content masking, deterministic font rendering, and cross-browser CI gates","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fvisual-regression\u002FSKILL.md",[],[],{"skillNo":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"publishedAt":18},"01M7EKQMFR7651NVH100P5781Z","ui-implementation","Component-driven UI implementation, multi-state matrix (default, hover, focus-visible, active, disabled, loading, empty, error), DTCG design tokens, responsive layout contracts, and accessibility tree mapping.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Fui-implementation\u002FSKILL.md",[],[],{"skillNo":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":7,"ownerLogin":8,"ownerAvatarUrl":9,"ownerAccountNo":10,"ownerDisplayName":11,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"publishedAt":18},"01M7EKQG3NVX6DPCYS6Q4PA71V","tui-editor-engine","Text buffer and editing semantics for a terminal code editor — index conversion, transaction-first editing, multi-cursor invariants, undo grouping, and large-file behaviour.","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftui-editor-engine\u002FSKILL.md",[],[],{"skillNo":111,"name":112,"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":113,"categories":114,"keywords":115,"publishedAt":18},"01M7EKQEJ993JGC72FE2KFY3ZZ","tree-sitter-context-indexing","https:\u002F\u002Fgithub.com\u002Fraillen\u002Fdaisy-code-editor\u002Fblob\u002Fmain\u002F.ai\u002Fskills\u002Ftree-sitter-context-indexing\u002FSKILL.md",[],[]]