一键导入
go-subprocess-lifecycle
Use when Go code starts external processes, detaches process groups, or needs cancellation and interrupt handling with os/exec.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when Go code starts external processes, detaches process groups, or needs cancellation and interrupt handling with os/exec.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | go-subprocess-lifecycle |
| description | Use when Go code starts external processes, detaches process groups, or needs cancellation and interrupt handling with os/exec. |
Prevent orphaned subprocesses, lost cancellation errors, and signal-after-exit races when Go code uses os/exec.
os/execCommandContext, Start/Wait, detached process groups, or custom interrupt handlingexec.CommandContext may be sufficient.context.Canceled at the API boundary, prefer explicit exec.Command, Start, Wait, and your own cancellation path.context.Canceled, do not rely on CommandContext defaults that can replace it with an *exec.ExitError.context.Canceled visible to errors.Is at the top-level CLI or API boundary.Setpgid: true or otherwise detach subprocesses, add an explicit cleanup path.SIGTERM, check whether the process already exited.SIGKILL, check again whether graceful shutdown already completed.CommandContext preserves the cancellation error you want to exposeexec.CommandContextexec.Command + Start/Waitcontext.Canceled visible through wrappingInteractive idea refinement using Socratic method to develop fully-formed designs. When your human partner says "I've got an idea", "Let's make/build/create", "I want to implement/add", "What if we". When starting design for complex feature. Before writing implementation plans. When idea needs refinement and exploration. ACTIVATE THIS AUTOMATICALLY when your human partner describes a feature or project idea - don't wait for /brainstorm command.
Use when debugging a web UI bug or validating a multi-step browser flow. Start or reuse background servers through run-long-running-processes-in-tmux using the deterministic current-directory-plus-purpose session name, not generic tmux names or kill-before-create setup. Prevent repo-root Playwright artifact leaks by resolving the retrospective screenshots directory once and prefixing every saved filename with it.
Go code review checklist based on official Go style guides. When reviewing Go code for style, idioms, and best practices
Use when writing or changing tests, adding mocks, tempted to add test-only methods to production code, or considering absence tests for deleted helpers, deleted client members, exported API shape, or removed routes. Prevents testing mock behavior, production pollution with test-only methods, mocking without understanding dependencies, and memorial tests whose sole purpose is to prove deleted internal/client surface stays gone while preserving tests for current observable behavior and current public/server contracts such as 404 removed-route checks.
Automatically scans GOAL.md for unchecked items, provides completion status summary, and enables coordinator to mark items as complete. When coordinator needs to verify project completion status or before marking work as complete. When coordinator needs to mark completed items in GOAL.md. Symptoms - manually going through GOAL.md line by line to check task completion, needing quick summary of pending vs completed tasks by category, and verifying all requirements are met before finalizing work.
Use when you need a detached tmux process. Derive one deterministic session name from the absolute current working directory plus a purpose suffix, reuse the matching owned session before creating it, and only kill that session during explicit cleanup or when you verified it is broken.