> golang-concurrency
Standards for safe concurrent programming using Goroutines, Channels, and Context. Use when implementing concurrency with Goroutines, Channels, or Context in Go. (triggers: **/*.go, goroutine, go keyword, channel, mutex, waitgroup, context)
curl "https://skillshub.wtf/HoangNguyen0403/agent-skills-standard/golang-concurrency?format=md"Golang Concurrency Standards
Priority: P0 (CRITICAL)
Principles
- Share Memory by Communicating: Don't communicate by sharing memory. Use channels.
- Context is King: Always pass
ctxto efficient manage cancellation/timeouts. - Prevent Leaks: Never start a goroutine without knowing how it will stop.
- Race Detection: Always run tests with
go test -race.
Primitives
- Goroutines: Lightweight threads.
go func() { ... }() - Channels: For data passing + synchronization.
- WaitGroup: Wait for a group of goroutines to finish.
- ErrGroup: WaitGroup + Error propagation (Preferred).
- Mutex: Protect shared state (simpler than channels for just state).
Guidelines
- Buffered vs Unbuffered: Use unbuffered channels for strict synchronization. Use buffered only if you specifically need async decoupling/burst handling.
- Closed Channels: Panic if writing to closed. Reading from closed returns zero-value immediately.
- Select: Use
selectto handle multiple channels or timeouts.
References
🚫 Anti-Patterns
- Do NOT use standard patterns if specific project rules exist.
- Do NOT ignore error handling or edge cases.
> related_skills --same-repo
> typescript-tooling
Development tools, linting, and build config for TypeScript. Use when configuring ESLint, Prettier, Jest, Vitest, tsconfig, or any TS build tooling. (triggers: tsconfig.json, .eslintrc.*, jest.config.*, package.json, eslint, prettier, jest, vitest, build, compile, lint)
> typescript-security
Secure coding practices for TypeScript. Use when validating input, handling auth tokens, sanitizing data, or managing secrets and sensitive configuration. (triggers: **/*.ts, **/*.tsx, validate, sanitize, xss, injection, auth, password, secret, token)
> typescript-language
Modern TypeScript standards for type safety and maintainability. Use when working with types, interfaces, generics, enums, unions, or tsconfig settings. (triggers: **/*.ts, **/*.tsx, tsconfig.json, type, interface, generic, enum, union, intersection, readonly, const, namespace)
> typescript-best-practices
Idiomatic TypeScript patterns for clean, maintainable code. Use when writing or refactoring TypeScript classes, functions, modules, or async logic. (triggers: **/*.ts, **/*.tsx, class, function, module, import, export, async, promise)