From claude-resources
Concurrency patterns and pitfalls. Use when implementing parallel work, choosing sync primitives, auditing concurrent code, or reviewing for races and leaks. Pair with language-specific skill.
npx claudepluginhub deandum/claude-resources --plugin go-skillsThis skill uses the workspace's default tool permissions.
Don't communicate by sharing memory; share memory by communicating.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Searches prompts.chat for AI prompt templates by keyword or category, retrieves by ID with variable handling, and improves prompts via AI. Use for discovering or enhancing prompts.
Guides agent creation for Claude Code plugins with file templates, frontmatter specs (name, description, model), triggering examples, system prompts, and best practices.
Don't communicate by sharing memory; share memory by communicating. Concurrency is not parallelism.
<lang>/concurrency skill)| Message Passing (channels/queues) | Shared State (locks/atomics) |
|---|---|
| Transferring ownership of data | Protecting internal state |
| Coordinating workers | Simple counter or flag |
| Distributing work | Short critical sections |
| Signaling events | Cache access |
Rule: transferring data → message passing. Protecting data → shared state.
| Pattern | Use When | Key Rule |
|---|---|---|
| Worker Pool | Fixed concurrency over a stream | Bound the worker count |
| Fan-Out/Fan-In | Independent tasks, collect results | Each task writes to unique slot |
| Pipeline | Sequential stages connected by queues | Close/signal completion through the primitive |
| Rate Limiter | Throttle operations (API, DB) | Token bucket or leaky bucket |
| Once Init | Lazy init exactly once | Safe for concurrent callers |
| Deduplication | Suppress duplicate concurrent calls | Cache stampede prevention |
| Object Pool | Reuse temp objects under pressure | Reset before return; profile first |
When reviewing concurrent code, check:
| Shortcut | Reality |
|---|---|
| "It probably won't race" | Races are non-deterministic. "Probably" means "sometimes in production." |
| "One concurrent task won't hurt" | Every unbounded task is a potential leak. Always provide a shutdown path. |
| "Message passing is always better" | Message primitives transfer ownership. Locks protect state. Pick the right tool. |
| "We'll add cancellation later" | Cancellation is architectural. Retrofitting is 10x harder than designing it in. |