基于 SOC 职业分类
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill golang命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
正在显示 SKILL.md
| Use when this capability is needed.
> Use when this capability is needed.
Review architecture and API design for the vfs-s3 project. Use when the user mentions @architect, asks to review an issue's design, discuss module boundaries, API shape, or architectural decisions for vfs-s3. Also trigger when the user wants to create an ADR (Architecture Decision Record) or evaluate a technical approach for the project. Intended for dispatch from Codex automation or Claude routines; GitHub trigger phrase: @vfs-s3-bot please prepare design doc Use when this capability is needed.
| name | golang |
| description | Use when the project uses Go for systems programming or backend services |
| metadata | {"author":"calcosmic"} |
Check every error. The if err != nil pattern is intentional -- Go makes error handling explicit. Never discard errors with _. Wrap errors with context using fmt.Errorf("doing X: %w", err) so call chains produce readable messages.
Use sentinel errors (var ErrNotFound = errors.New("not found")) for expected conditions that callers check with errors.Is(). Use custom error types for errors that carry structured data.
Follow the standard layout: cmd/ for application entry points, internal/ for private packages, pkg/ for public libraries (if any). Keep main.go minimal -- it wires up dependencies and starts the server.
One package per directory. Package names should be short, lowercase, and descriptive. Avoid util or common packages -- they become dumping grounds.
Do not communicate by sharing memory -- share memory by communicating. Use channels for synchronization between goroutines. Use sync.Mutex only for protecting simple shared state where channels would be overkill.
Always ensure goroutines can be stopped. Pass context.Context and check ctx.Done(). Leaking goroutines is a memory leak that grows over time.
Use sync.WaitGroup when you need to wait for a known number of goroutines to complete. Use errgroup.Group when any goroutine failure should cancel the rest.
Define interfaces where they are used, not where they are implemented. Keep interfaces small -- one or two methods is ideal. The io.Reader and io.Writer interfaces are the gold standard.
Accept interfaces, return structs. This makes code testable -- callers can inject mocks that satisfy the interface.
Use table-driven tests for functions with multiple input/output combinations. Name test cases clearly. Use t.Run() for subtests so failures identify which case broke.
Use testing.T.Helper() in test helper functions so failure messages point to the calling test, not the helper.
Use go mod tidy to keep go.mod clean. Vendor dependencies with go mod vendor for reproducible builds in CI. Avoid unnecessary dependencies -- the standard library is comprehensive. Check if net/http, encoding/json, or os already do what you need.
Profile before optimizing with pprof. Pre-allocate slices with make([]T, 0, expectedCap) when the size is known. Avoid string concatenation in loops -- use strings.Builder. Reduce allocations by reusing buffers with sync.Pool for hot paths.
Source: calcosmic/Aether — distributed by TomeVault.