go-process-cli
БесплатноБез исполняемых скриптовНе проверенWrite Go CLIs that manage processes and workloads — daemons, supervisors, job runners, deploy tools, anything that spawns or controls other processes. Use…
от pproenca★ 231 звезда на GitHubОб этом скилле
Go Process-Management CLIs
Make Go command-line tools that spawn, supervise, and shut down processes correctly — the part the stdlib makes easy to get subtly wrong.
When to Apply
Reach for this skill when building or reviewing a Go CLI whose job is to control other processes or concurrent workloads: a daemon, a process supervisor, a job/worker runner, a deploy or migration tool, a test harness that shells out, or any program that must stop cleanly when an orchestrator says so. It targets Go 1.22+ on Unix-like systems (Linux, macOS); a few rules note where Windows differs. It assumes you already know Go — it only corrects the specific defaults that go wrong in this domain.
Categories
| # | Category | Prefix | What it covers |
|---|---|---|---|
| 1 | Signals & Graceful Shutdown | sig |
Binding a context to SIGINT/SIGTERM; second-signal force-quit |
| 2 | Child Processes | exec |
os/exec lifetime, graceful kill, process groups, pipes, exit codes |
| 3 | Concurrency & Workloads | work |
errgroup fan-out, bounded concurrency, goroutine-leak discipline, channel ownership |
| 4 | Context Propagation | ctx |
Explicit context args, defer cancel(), cancellable waits |
| 5 | Errors & Exit Codes | err |
run() error for deferred cleanup, aggregating failures |
| 6 | CLI Framework & Flags | cli |
stdlib flag vs cobra, ExecuteContext, RunE, subcommand patterns |
| 7 | Process State & Supervision | state |
Liveness probes, atomic PID files, zombie reaping, structured logs |
Quick Reference
The defaults this skill exists to correct:
signal.NotifyContext(ctx, SIGINT, SIGTERM)— not a channel that only watches Ctrl-C. Orchestrators send SIGTERM.exec.CommandContext+cmd.Cancel/cmd.WaitDelay— plainCommandContextSIGKILLs children with no cleanup.Setpgid+kill(-pgid)— signalling the direct child orphans grandchildren (sh -c,make,npm).cmd.Output()for capture — reading a pipe afterWait()deadlocks.errgroup.WithContext+SetLimit(n)— a goroutine per task means a process per task: PID/FD exhaustion.ctxas an argument — never a struct field;defer cancel()on every derived context.select { case <-ticker.C: case <-ctx.Done(): }—time.Sleepmakes shutdown wait out the interval.main → run() error → os.Exit(1)—log.Fatal/os.Exitdeep in code skip everydefer.proc.Signal(syscall.Signal(0))—os.FindProcessalways succeeds on Unix; it never proves liveness.os.OpenFile(O_CREATE|O_EXCL)for PID files — check-then-create is a race;cmd.Wait()every child or it zombifies.
How to Use
- Identify which category your task falls under (see table above).
- Read the relevant rule files in
references/— each is a focused, self-contained pattern naming the wrong default it corrects. - Apply the pattern; follow the
Referencelink in each rule for the authoritative source.
Rules cross-link (e.g. graceful shutdown ties signals → context → child-process kill → cleanup), so follow the links when a task spans categories.
When extending this skill, copy assets/templates/_template.md: WHY first, one canonical example with realistic names, a foil only if the wrong way is a genuine trap.
Source Authority
Every rule cites primary sources — the Go standard library reference on pkg.go.dev, the official Go blog (go.dev/blog), and the cobra documentation — chosen because they are maintainer-authored and version-current. No content farms, listicles, or undated tutorials.
Related Skills
radical-simplification— when a supervisor design has accreted accidental complexity.unix-cli/cli-for-agents— broader CLI ergonomics beyond process management.
Установить go-process-cli в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл go-process-cli?
Write Go CLIs that manage processes and workloads — daemons, supervisors, job runners, deploy tools, anything that spawns or controls other processes. Use when writing, reviewing, or refactoring Go that handles OS signals, runs children via os/exec, fans out concurrent work, threads context for cancellation, returns exit codes, or builds a flag/cobra command surface. Covers the footguns the standard library makes easy to hit — SIGTERM vs Ctrl-C, SIGKILL-by-default children, orphaned process groups, pipe deadlocks, goroutine leaks, zombie reaping, and os.FindProcess lying about liveness. Triggers whenever the task touches process lifecycle, graceful shutdown, subprocess control, or concurrent workload supervision in Go — even if not named.
Как установить скилл go-process-cli?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл go-process-cli запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic