agent-instructions
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector.
$ npx -y skills add nimadorostkar/Claude-Skills-collection --skill go --agent claude-codeHow it fires
How this skill gets triggered: by you, by Claude, or both.
/goContext preview
The summary Claude sees to decide when to auto-load this skill.
Use when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector.
name: go description: Use when writing Go services, CLIs, or libraries. Covers idiomatic error wrapping, goroutine and context discipline, interface design, table-driven tests, and the race detector. metadata: category: languages version: 1.0.0 tags: [go, golang, concurrency, context, testing]
Write Go that is boring in the best sense: explicit errors, bounded concurrency, small interfaces, and tests that read like a specification.
1. **Define the contract** — Types and function signatures first. Errors are part of the signature. 2. **Implement the happy path** — Then handle every error explicitly. No `_ = err`. 3. **Bound concurrency** — Every goroutine has an owner, a cancellation path, and a place its error is read. 4. **Test the table** — Cases as data, including the error cases. 5. **Gate** — `go vet ./...`, `staticcheck ./...`, `go test -race ./...`.
**Bounded fan-out with error propagation:**
func FetchAll(ctx context.Context, ids []string, limit int) ([]User, error) {
g, ctx := errgroup.WithContext(ctx)
g.SetLimit(limit)
users := make([]User, len(ids))
for i, id := range ids {
i, id := i, id
g.Go(func() error {
u, err := fetch(ctx, id)
if err != nil {
return fmt.Errorf("fetch user %s: %w", id, err)
}
users[i] = u
return nil
})
}
if err := g.Wait(); err != nil {
return nil, err
}
return users, nil
}**Table-driven test including failures:**
func TestParseDuration(t *testing.T) {
tests := map[string]struct {
in string
want time.Duration
wantErr error
}{
"seconds": {in: "30s", want: 30 * time.Second},
"empty": {in: "", wantErr: ErrEmptyInput},
"bad unit": {in: "5 fortnights", wantErr: ErrUnknownUnit},
}
for name, tc := range tests {
t.Run(name, func(t *testing.T) {
got, err := ParseDuration(tc.in)
if !errors.Is(err, tc.wantErr) {
t.Fatalf("err = %v, want %v", err, tc.wantErr)
}
if got != tc.want {
t.Errorf("got %v, want %v", got, tc.want)
}
})
}
}A curated library of 137 production-grade skills for Claude and other AI coding agents. Every skill follows one structure, speaks with one voice, and earns its place by changing what the agent does.
Repo: nimadorostkar/Claude-Skills-collection
Use when writing project instructions for a coding agent (CLAUDE.md, AGENTS.md, or equivalent). Covers what belongs in them, what does not, structure, and…
Use when an agent needs state that survives a session or a context compaction. Covers what to persist, file-based memory, structuring notes for retrieval, and…
Use when automating agent behavior with lifecycle hooks. Covers hook events, deterministic enforcement of rules the model should not be trusted to remember,…
Use when packaging skills, commands, hooks, and MCP servers into a distributable plugin. Covers manifest structure, bundling, versioning, testing, and…
Use when writing a new skill for an AI agent. Covers scoping, description writing for reliable triggering, progressive disclosure, and the difference between a…
Use when reviewing or improving an existing agent skill. Covers triggering accuracy, content quality, redundancy with the base model, and measuring whether the…