用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/tomevault-io/skills-registry --skill golang-patterns命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
| 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.
基于 SOC 职业分类
正在显示 SKILL.md
| name | golang-patterns |
| description | >- Use when this capability is needed. |
Idiomatic Go reference pack — concurrency, interfaces, generics, testing, project structure, plus the anti-patterns agents most commonly get wrong. Two-thesis stack:
Load detailed guidance based on context:
| Topic | Reference | Load When |
|---|---|---|
| Concurrency | references/concurrency.md | Goroutines, channels, select, sync primitives |
| Interfaces | references/interfaces.md | Interface design, io.Reader/Writer, composition |
| Generics | references/generics.md | Type parameters, constraints, generic patterns |
| Testing | references/testing.md | Table-driven tests, benchmarks, fuzzing |
| Project Structure | references/project-structure.md | Module layout, internal packages, go.mod |
| Idiomatic Go (anti-patterns) | references/idiomatic-go.md | Quick anti-pattern → idiomatic-fix tables, decision rules, agent-specific rationalization counters |
go vet ./... before proceedinggolangci-lint run and fix all reported issues before proceeding-race, fuzzing, 80%+ coverage; race detector must pass before committingGoroutine with context cancellation and error propagation:
// worker runs until ctx is cancelled or an error occurs.
// Errors are returned via errCh; the caller must drain it.
func worker(ctx context.Context, jobs <-chan Job, errCh chan<- error) {
for {
select {
case <-ctx.Done():
errCh <- fmt.Errorf("worker cancelled: %w", ctx.Err())
return
case job, ok := <-jobs:
if !ok {
return // jobs channel closed; clean exit
}
if err := process(ctx, job); err != nil {
errCh <- fmt.Errorf("process job %v: %w", job.ID, err)
return
}
}
}
}
func runPipeline(ctx context.Context, jobs []Job) error {
ctx, cancel := context.WithTimeout(ctx, 30*time.Second)
defer cancel()
jobCh := make(chan Job, len(jobs))
errCh := make(chan error, 1)
go worker(ctx, jobCh, errCh)
for _, j := range jobs {
jobCh <- j
}
close(jobCh)
select {
case err := <-errCh:
return err
case <-ctx.Done():
return fmt.Errorf(, ctx.Err())
}
}
Key properties: bounded goroutine lifetime via ctx, error propagation with
%w, no goroutine leak on cancellation.
context.Context as first param on all blocking operations_ discards without justification)X | Y union constraints for generics (Go 1.18+)fmt.Errorf("...: %w", err)-race flag)_ = thatMightFail() without a comment)panic for normal error handlingWhen implementing Go features, provide:
golang-pro agent — broader architectural / DevOps coverage; delegates
pattern detail here. Load both when active Go development is in scope.Initial content adapted from
jeffallan/claude-skills (MIT,
skills/golang-pro) and the prior wardrobe idiomatic-go skill (Bodner-derived
anti-pattern tables, now at references/idiomatic-go.md). See LICENSES.md.
Source: danmestas/wardrobe — distributed by TomeVault.