{"id":"ea10e704-7c1d-4a63-977d-a28b7dc310ed","shortId":"yHBRZy","kind":"skill","title":"concurrency-safe-tool-batching","tagline":"Group tool calls into concurrency-safe batches to run read-only calls in parallel while serializing non-read-only work.","description":"# SKILL: Concurrency-Safe Tool Batching\n**Domain:** tool-orchestration  \n**Trigger:** Use when one turn contains multiple tool calls and some are safe to run together while others mutate state or require exclusive execution.  \n**Source Pattern:** Distilled from reviewed tool execution, streaming, persistence, and output-budget implementations.\n\n## Core Method\nPartition the requested tool calls into successive batches where each batch is either a set of read-only calls that may run together or a single exclusive call that must run alone. Decide concurrency safety from each tool’s declared behavior and validated inputs, not from naming conventions. Execute safe batches in parallel, then apply any shared-context updates only after the whole batch completes. Run mutating or stateful tools one at a time so ordering and side effects remain deterministic.\n\n## Key Rules\n- Treat a tool as concurrency-safe only after validating its input and checking its declared safety rules; if anything is ambiguous, fall back to serial execution.\n- Append queued context modifiers from concurrent batches after they finish so the shared tool use context stays consistent before the next batch.\n- Always reorder only read-only batches; non-read-only batches must run on their own and update context inline so ordering and side effects remain deterministic.\n\n## Example Application\nWhen building a CLI tool runner, first group together safe read-only lookups like file reads or searches, run that group in parallel, then execute any edit, write, or stateful shell step on its own. This gives you parallelism where it is safe without letting mutating tools race each other.\n\n## Anti-Patterns (What NOT to do)\n- Assume all tools are concurrency-safe and run them in parallel, which can break stateful tools like shell edits.\n- Drop queued context modifiers from concurrent batches and let subsequent batches run on stale context, leading to permission and session problems.\n- Merge tool use results out of order when non-read-only tools follow concurrent batches, which breaks user expectations about sequential effects.","tags":["concurrency","safe","tool","batching","cskill","agents","ychampion","agent-skills","ai-agents","cli","coding-agents","context-engineering"],"capabilities":["skill","source-ychampion","skill-concurrency-safe-tool-batching","topic-agent-skills","topic-ai-agents","topic-cli","topic-coding-agents","topic-context-engineering","topic-developer-tools","topic-mcp","topic-multi-agent","topic-terminal-ui"],"categories":["cskill-agents"],"synonyms":[],"warnings":[],"endpointUrl":"https://skills.sh/ychampion/cskill-agents/concurrency-safe-tool-batching","protocol":"skill","transport":"skills-sh","auth":{"type":"none","details":{"cli":"npx skills add ychampion/cskill-agents","source_repo":"https://github.com/ychampion/cskill-agents","install_from":"skills.sh"}},"qualityScore":"0.467","qualityRationale":"deterministic score 0.47 from registry signals: · indexed on github topic:agent-skills · 34 github stars · SKILL.md body (2,108 chars)","verified":false,"liveness":"unknown","lastLivenessCheck":null,"agentReviews":{"count":0,"score_avg":null,"cost_usd_avg":null,"success_rate":null,"latency_p50_ms":null,"narrative_summary":null,"summary_updated_at":null},"enrichmentModel":"deterministic:skill-github:v1","enrichmentVersion":1,"enrichedAt":"2026-04-22T06:56:47.406Z","embedding":null,"createdAt":"2026-04-18T22:20:08.656Z","updatedAt":"2026-04-22T06:56:47.406Z","lastSeenAt":"2026-04-22T06:56:47.406Z","tsv":"'alon':111 'alway':213 'ambigu':185 'anti':295 'anti-pattern':294 'anyth':183 'append':191 'appli':134 'applic':242 'assum':301 'back':187 'batch':5,13,34,86,89,130,144,197,212,219,224,327,331,357 'behavior':120 'break':315,359 'budget':75 'build':244 'call':8,19,47,83,98,107 'check':177 'cli':246 'complet':145 'concurr':2,11,31,113,169,196,306,326,356 'concurrency-saf':10,30,168,305 'concurrency-safe-tool-batch':1 'consist':208 'contain':44 'context':138,193,206,232,323,335 'convent':127 'core':77 'decid':112 'declar':119,179 'determinist':161,240 'distil':65 'domain':35 'drop':321 'edit':270,320 'effect':159,238,364 'either':91 'exampl':241 'exclus':61,106 'execut':62,69,128,190,268 'expect':361 'fall':186 'file':258 'finish':200 'first':249 'follow':355 'give':280 'group':6,250,264 'implement':76 'inlin':233 'input':123,175 'key':162 'lead':336 'let':288,329 'like':257,318 'lookup':256 'may':100 'merg':342 'method':78 'modifi':194,324 'multipl':45 'must':109,225 'mutat':57,147,289 'name':126 'next':211 'non':25,221,351 'non-read-on':24,220,350 'one':42,151 'orchestr':38 'order':156,235,348 'other':56 'output':74 'output-budget':73 'parallel':21,132,266,282,312 'partit':79 'pattern':64,296 'permiss':338 'persist':71 'problem':341 'queu':192,322 'race':291 'read':17,26,96,217,222,254,259,352 'read-on':16,95,216,253 'remain':160,239 'reorder':214 'request':81 'requir':60 'result':345 'review':67 'rule':163,181 'run':15,53,101,110,146,226,262,309,332 'runner':248 'safe':3,12,32,51,129,170,252,286,307 'safeti':114,180 'search':261 'sequenti':363 'serial':23,189 'session':340 'set':93 'share':137,203 'shared-context':136 'shell':274,319 'side':158,237 'singl':105 'skill':29 'skill-concurrency-safe-tool-batching' 'sourc':63 'source-ychampion' 'stale':334 'state':58,149,273,316 'stay':207 'step':275 'stream':70 'subsequ':330 'success':85 'time':154 'togeth':54,102,251 'tool':4,7,33,37,46,68,82,117,150,166,204,247,290,303,317,343,354 'tool-orchestr':36 'topic-agent-skills' 'topic-ai-agents' 'topic-cli' 'topic-coding-agents' 'topic-context-engineering' 'topic-developer-tools' 'topic-mcp' 'topic-multi-agent' 'topic-terminal-ui' 'treat':164 'trigger':39 'turn':43 'updat':139,231 'use':40,205,344 'user':360 'valid':122,173 'whole':143 'without':287 'work':28 'write':271","prices":[{"id":"207b8b0b-ec5e-459d-99e9-5fdcccd67fa6","listingId":"ea10e704-7c1d-4a63-977d-a28b7dc310ed","amountUsd":"0","unit":"free","nativeCurrency":null,"nativeAmount":null,"chain":null,"payTo":null,"paymentMethod":"skill-free","isPrimary":true,"details":{"org":"ychampion","category":"cskill-agents","install_from":"skills.sh"},"createdAt":"2026-04-18T22:20:08.656Z"}],"sources":[{"listingId":"ea10e704-7c1d-4a63-977d-a28b7dc310ed","source":"github","sourceId":"ychampion/cskill-agents/concurrency-safe-tool-batching","sourceUrl":"https://github.com/ychampion/cskill-agents/tree/main/skills/concurrency-safe-tool-batching","isPrimary":false,"firstSeenAt":"2026-04-18T22:20:08.656Z","lastSeenAt":"2026-04-22T06:56:47.406Z"}],"details":{"listingId":"ea10e704-7c1d-4a63-977d-a28b7dc310ed","quickStartSnippet":null,"exampleRequest":null,"exampleResponse":null,"schema":null,"openapiUrl":null,"agentsTxtUrl":null,"citations":[],"useCases":[],"bestFor":[],"notFor":[],"kindDetails":{"org":"ychampion","slug":"concurrency-safe-tool-batching","github":{"repo":"ychampion/cskill-agents","stars":34,"topics":["agent-skills","ai-agents","cli","coding-agents","context-engineering","developer-tools","mcp","multi-agent","terminal-ui"],"license":"mit","html_url":"https://github.com/ychampion/cskill-agents","pushed_at":"2026-04-04T14:13:23Z","description":"Agent skills for coding CLIs, multi-agent runtimes, context engines, MCP extensions, and terminal tooling. Instead of using claude code's source code, give your agent skills to create your own!","skill_md_sha":"a649bcca23296f37e33e74ce21714d625b1bad59","skill_md_path":"skills/concurrency-safe-tool-batching/SKILL.md","default_branch":"main","skill_tree_url":"https://github.com/ychampion/cskill-agents/tree/main/skills/concurrency-safe-tool-batching"},"layout":"multi","source":"github","category":"cskill-agents","frontmatter":{"name":"concurrency-safe-tool-batching","description":"Group tool calls into concurrency-safe batches to run read-only calls in parallel while serializing non-read-only work."},"skills_sh_url":"https://skills.sh/ychampion/cskill-agents/concurrency-safe-tool-batching"},"updatedAt":"2026-04-22T06:56:47.406Z"}}