Performance optimization strategies. Use ONLY after profiling identifies bottlenecks.
/plugin marketplace add IvanTorresEdge/molcajete.ai/plugin install ivantorresedge-go-tech-stacks-go@IvanTorresEdge/molcajete.aiThis skill inherits all available tools. When active, it can use any tool Claude has access to.
Performance optimization strategies for Go. ONLY use after profiling!
Use ONLY after profiling identifies actual bottlenecks. NEVER optimize prematurely (KISS principle).
// Good - pre-allocate when size known
items := make([]Item, 0, expectedSize)
// Bad - repeated allocations
var items []Item
// Good
var b strings.Builder
for _, s := range strings {
b.WriteString(s)
}
result := b.String()
// Bad - repeated allocations
result := ""
for _, s := range strings {
result += s
}
var bufferPool = sync.Pool{
New: func() interface{} {
return new(bytes.Buffer)
},
}
buf := bufferPool.Get().(*bytes.Buffer)
defer bufferPool.Put(buf)
buf.Reset()
// use buf
// Good - reuse buffer
buf := make([]byte, 1024)
for {
n, _ := r.Read(buf)
process(buf[:n])
}
// Bad - allocate each time
for {
buf := make([]byte, 1024)
n, _ := r.Read(buf)
process(buf[:n])
}
This skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
This skill should be used when the user asks to "create a slash command", "add a command", "write a custom command", "define command arguments", "use command frontmatter", "organize commands", "create command with file references", "interactive command", "use AskUserQuestion in command", or needs guidance on slash command structure, YAML frontmatter fields, dynamic arguments, bash execution in commands, user interaction patterns, or command development best practices for Claude Code.
This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.