Help us improve
Share bugs, ideas, or general feedback.
From brewcode
Creates or improves Claude Code agents interactively. For new agents, prompts for project/global/plugin placement, model selection (sonnet/opus/haiku/inherit), and CLAUDE.md table updates; improves existing via analysis.
npx claudepluginhub kochetkov-ma/claude-brewcode --plugin brewcodeHow this skill is triggered — by the user, by Claude, or both
Slash command
/brewcode:agentsopusThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
> **Agent Management:** Create and improve Claude Code agents interactively.
Create custom agents for Claude Code including YAML frontmatter, system prompts, tool restrictions, and discovery optimization. Use when creating, building, or designing agents, or when asked about agent creation, subagent configuration, Task tool delegation, or agent best practices.
Develops Claude Code agents with color conventions for types like Explore and Debug, permission denial resilience for subagents, and hot-reloading without restarts.
Guides creation of autonomous agents for Claude Code plugins, covering Markdown file structure, YAML frontmatter (name, description, model, color, tools), system prompts, triggering examples, and best practices.
Share bugs, ideas, or general feedback.
Agent Management: Create and improve Claude Code agents interactively.
Extract mode and target from $ARGUMENTS:
| Pattern | Mode | Target |
|---|---|---|
| empty | help | -- |
create <desc> | create | description text |
up <name|path> | up | agent name or path |
<name|path> (not keyword) | up (shorthand) | name or path |
Examples:
/brewcode:agents --> help/brewcode:agents create backend validator --> create, target=backend validator/brewcode:agents up reviewer --> up, target=reviewer/brewcode:agents .claude/agents/reviewer.md --> up, target=path (shorthand)Print usage and stop:
# brewcode:agents
Agent management - create and improve Claude Code agents.
## Usage
- `/brewcode:agents create <description>` -- create new agent
- `/brewcode:agents up <name|path>` -- improve existing agent
- `/brewcode:agents <name|path>` -- improve (shorthand)
## Examples
- `/brewcode:agents create backend validator`
- `/brewcode:agents up reviewer`
- `/brewcode:agents .claude/agents/reviewer.md`
Ask all 3 questions in a single AskUserQuestion:
Q1 -- Placement:
header: "Agent scope"
question: "Where to place the agent?"
options:
- label: "Project (.claude/agents/)"
description: "Team-shared, scoped to this project"
- label: "Global (~/.claude/agents/)"
description: "Available in all projects"
- label: "Plugin (brewcode/agents/)"
description: "Distributed with plugin"
Q2 -- Model:
header: "Model"
question: "Preferred model?"
options:
- label: "sonnet -- balanced (Recommended)"
description: "Best balance of quality and speed for most agents"
- label: "opus -- complex analysis"
description: "For tasks requiring deep reasoning"
- label: "haiku -- fast/simple"
description: "For quick lookup or simple transformations"
- label: "inherit -- from session"
description: "No model field — agent inherits model from calling session"
Model mapping: sonnet → sonnet, opus → opus, haiku → haiku, inherit → omit model: field entirely.
Q3 -- CLAUDE.md update:
header: "CLAUDE.md"
question: "Update CLAUDE.md agents table after creation?"
options:
- label: "Yes -- add row to agents table"
description: "Adds agent to the agents table in CLAUDE.md"
- label: "No -- skip"
description: "Skip CLAUDE.md update"
Save answers as: SCOPE, SCOPE_PATH, MODEL, UPDATE_CLAUDE_MD.
Path mapping:
.claude/agents/~/.claude/agents/brewcode/agents/Task tool:
subagent_type: "brewcode:agent-creator"
prompt: |
Create an agent for: {DESCRIPTION}
Placement: {SCOPE} ({SCOPE_PATH})
Model: {MODEL}
Follow the agent-creator creation process:
1. Parallel codebase analysis (Explore agents)
2. Ask clarifying questions (role, tools, triggers)
3. Write frontmatter + system prompt
4. Validate against checklist
Output: full agent file path after creation.
model: opus
Capture result as AGENT_PATH.
Skill(skill="brewtools:text-optimize", args="{AGENT_PATH}")
Note: requires brewtools plugin. If unavailable -- skip or apply text-optimize-fallback manually.
| Agent | or | Name | header row with | Scope | or | Purpose | columns)| agent-name | scope | model | triggers |## Agents
| Agent | Scope | Model | Triggers |
|-------|-------|-------|----------|
| {agent-name} | {scope} | {model} | {triggers} |
EXECUTE using Bash tool:
TARGET="UP_TARGET_HERE"
# Trim whitespace
TARGET="$(echo "$TARGET" | xargs)"
if [[ -z "$TARGET" ]]; then
echo "NO_TARGET"
exit 1
fi
# Check if direct file
if [[ -f "$TARGET" ]]; then
echo "FOUND: $TARGET"
elif [[ -f "$TARGET.md" ]]; then
echo "FOUND: $TARGET.md"
elif [[ -d "$TARGET" ]] && [[ -f "$TARGET/$(basename "$TARGET").md" ]]; then
echo "FOUND: $TARGET/$(basename "$TARGET").md"
else
# Search by name in known locations
FOUND=""
for loc in ".claude/agents" "$HOME/.claude/agents" "brewcode/agents"; do
if [[ -f "$loc/$TARGET.md" ]]; then
FOUND="$loc/$TARGET.md"
break
elif [[ -f "$loc/$TARGET" ]]; then
FOUND="$loc/$TARGET"
break
fi
done
if [[ -n "$FOUND" ]]; then
echo "FOUND: $FOUND"
else
echo "NOT_FOUND: $TARGET"
fi
fi
Replace UP_TARGET_HERE with the actual target extracted from $ARGUMENTS (strip up prefix if present).
STOP if NOT_FOUND -- report error and list available agents.
Read the resolved agent file to extract name, purpose, current content.
Q1 -- Focus:
header: "Improvement focus"
question: "What to improve?"
options:
- label: "Triggers/activation"
description: "Improve description and trigger examples for better auto-detection"
- label: "System prompt quality"
description: "Enhance instructions, checklist, output format"
- label: "Both (Recommended)"
description: "Triggers + system prompt quality"
- label: "Full review + project context"
description: "Complete review including project-specific knowledge update"
Q2 -- CLAUDE.md update:
header: "CLAUDE.md"
question: "Update CLAUDE.md agents table after?"
options:
- label: "Yes"
description: "Update agents table row in CLAUDE.md"
- label: "No"
description: "Skip CLAUDE.md update"
Save answers as: IMPROVEMENT_FOCUS, UPDATE_CLAUDE_MD.
Task tool:
subagent_type: "brewcode:agent-creator"
prompt: |
Improve existing agent. Focus: {IMPROVEMENT_FOCUS}
Agent path: {AGENT_PATH}
Current content:
{AGENT_CONTENT}
Tasks:
1. Analyze current strengths/weaknesses
2. Improve description trigger examples
3. Enhance system prompt clarity
4. Apply agent-creator best practices
5. Save updated file
Output: full agent file path after update.
model: opus
Skill(skill="brewtools:text-optimize", args="{AGENT_PATH}")
Note: requires brewtools plugin. If unavailable -- skip or apply text-optimize-fallback manually.
Same logic as create Step 4. If row already exists for this agent, update it instead of adding a new one.
# agents [{MODE}]
## Detection
| Field | Value |
|-------|-------|
| Arguments | `$ARGUMENTS` |
| Mode | `[create|up|help]` |
| Target | `[description or path]` |
## Result
| Field | Value |
|-------|-------|
| Agent | `[path]` |
| Model | `[model]` |
| Scope | `[project|global|plugin]` |
| CLAUDE.md | `[updated|skipped]` |
## Next Steps
- [recommendations]