managing-agents
Manages temporary and defined agents including creation, promotion, cleanup, and namespacing. Use when user creates custom agents, asks about agent lifecycle, temp agents, or agent management.
What this skill does
# Managing Orchestration Agents
I manage the lifecycle of agents in the orchestration system: creation, execution, promotion, and cleanup.
## When I Activate
I automatically activate when you:
- Create or define custom agents
- Ask about agent lifecycle
- Mention temp agents or agent promotion
- Want to understand agent namespacing
- Ask "how do I create an agent?"
## Agent Types
### Built-in Agents
**No namespace prefix**, always available:
- `Explore` - Codebase exploration
- `general-purpose` - General-purpose tasks
- `code-reviewer` - Code review
- `implementation-architect` - Architecture planning
- `expert-code-implementer` - Code implementation
### Plugin Defined Agents
**With `orchestration:` prefix**, permanent agents in this plugin:
- `orchestration:workflow-socratic-designer`
- `orchestration:workflow-syntax-designer`
- Custom agents you promote
Located in: `agents/` directory
Registry: `agents/registry.json`
### Temp Agents
**With `orchestration:` prefix**, workflow-specific ephemeral agents:
- Created during workflow design
- Saved in `temp-agents/` directory
- Auto-cleaned after workflow execution
- Can be promoted to permanent
Reference in workflows: `$agent-name`
## Temp Agent Lifecycle
See [temp-agents.md](temp-agents.md) for complete guide.
### 1. Creation
Created automatically during workflow design:
```markdown
---
name: security-scanner
description: Scans for security vulnerabilities
created: 2025-01-08
---
You are a security expert specializing in vulnerability detection...
```
Saved to: `temp-agents/security-scanner.md`
### 2. Execution
Referenced in workflow with `$` prefix:
```flow
$security-scanner:"Scan codebase":findings ->
general-purpose:"Analyze {findings}"
```
Executed with namespace: `orchestration:security-scanner`
### 3. Promotion
After workflow completion, you can save temp agents:
```
Workflow complete!
Temp agents created:
- security-scanner
- performance-profiler
Save as permanent agents? [Y/n]
```
If saved:
- Moved from `temp-agents/` to `agents/`
- Added to `agents/registry.json`
- Available in all future workflows
- No need to recreate
### 4. Cleanup
Unsaved temp agents are deleted:
```
๐งน Cleaned up 2 temporary file(s):
- temp-agents/security-scanner.md
- examples/workflow-data.json
```
## Creating Defined Agents
See [defined-agents.md](defined-agents.md) for detailed guide.
To create a permanent agent manually:
### 1. Create Agent File
`agents/custom-agent.md`:
```markdown
---
name: custom-agent
namespace: orchestration:custom-agent
description: One-line description of what this agent does
tools: [Read, Grep, Edit]
usage: "Use via Task tool with subagent_type: 'orchestration:custom-agent'"
---
You are a specialized agent for [purpose].
Your responsibilities:
1. Task 1
2. Task 2
Output format:
[Expected output format]
Use these tools:
- Read: [When to use]
- Grep: [When to use]
```
### 2. Register Agent
Add to `agents/registry.json`:
```json
{
"custom-agent": {
"file": "custom-agent.md",
"description": "One-line description",
"namespace": "orchestration:custom-agent",
"created": "2025-01-08",
"usageCount": 0
}
}
```
### 3. Use in Workflows
Reference by name (system adds namespace automatically):
```flow
custom-agent:"Perform specialized task":output
```
## Namespace Conventions
See [namespacing.md](namespacing.md) for complete reference.
### Namespace Rules
| Agent Type | User Writes | System Executes |
|------------|-------------|-----------------|
| Built-in | `Explore:"task"` | `Explore` |
| Defined plugin | `workflow-socratic-designer` | `orchestration:workflow-socratic-designer` |
| Temp | `$security-scanner` | `orchestration:security-scanner` |
### Why Namespacing?
1. **Avoid conflicts** - Plugin agents don't conflict with built-ins
2. **Clear identification** - Know which plugin provides agent
3. **Proper routing** - System knows where to find agent
### Resolution Algorithm
```javascript
function resolveAgent(name) {
// 1. Check if built-in
if (isBuiltIn(name)) return name;
// 2. Check if other plugin (e.g., superpowers:)
if (name.includes(':')) return name;
// 3. Add orchestration namespace
return `orchestration:${name}`;
}
```
## Agent Promotion Process
See [promotion.md](promotion.md) for details.
After workflow execution with temp agents:
### 1. Review Phase
```
Temp agents used in this workflow:
1. security-scanner
Description: Scans for security vulnerabilities
Used: 1 time in workflow
2. performance-profiler
Description: Analyzes code performance
Used: 1 time in workflow
Select agents to save (space-separated numbers, or 'none'):
```
### 2. Selection
```
You selected: security-scanner
Promotion options:
[P]romote as-is - Save with current definition
[E]dit first - Modify before saving
[S]kip - Don't save this agent
```
### 3. Promotion
If promoted:
1. File moved from `temp-agents/` to `agents/`
2. Entry added to `agents/registry.json`
3. Confirmation message shown
### 4. Cleanup
Unselected agents are deleted
## Agent Maintenance
### Updating Agents
To update a defined agent:
1. Edit `agents/agent-name.md`
2. Update description/responsibilities/tools
3. Optionally update `agents/registry.json` metadata
Changes take effect immediately in new workflows.
### Deleting Agents
To remove a defined agent:
1. Delete `agents/agent-name.md`
2. Remove entry from `agents/registry.json`
Agent will no longer be available in workflows.
### Agent Usage Statistics
Track agent usage in `agents/registry.json`:
```json
{
"security-scanner": {
"usageCount": 15,
"lastUsed": "2025-01-08T14:30:00Z"
}
}
```
## Best Practices
### Creating Agents
โ
**DO**:
- Make prompts comprehensive and specific
- Include clear output format requirements
- Recommend appropriate tools
- Handle edge cases
- Define success criteria
โ **DON'T**:
- Create for simple one-line tasks
- Make too generic ("do analysis")
- Forget error handling
- Skip tool recommendations
### Promoting Agents
โ
**Promote when**:
- Agent is reusable across workflows
- Well-tested and reliable
- Provides domain-specific expertise
- Saves time in future workflows
โ **Don't promote when**:
- One-time use only
- Too specific to single workflow
- Untested or unreliable
- Duplicates existing agent
### Naming Agents
โ
**Good names**:
- `security-scanner` (clear purpose)
- `api-doc-generator` (descriptive)
- `performance-profiler` (specific)
โ **Bad names**:
- `helper` (too generic)
- `agent1` (meaningless)
- `do-stuff` (vague)
## Common Issues
**"Agent not found" error**:
- Check spelling of agent name
- Verify temp agent file exists in `temp-agents/`
- Ensure defined agent in `agents/` and registry
- Check if agent was already cleaned up
**Namespace conflict**:
- Built-in agents don't need prefix
- Plugin agents automatically prefixed
- Don't manually add `orchestration:` in workflows
**Temp agent disappeared**:
- Temp agents auto-deleted after workflow
- Save important agents during promotion phase
- Check cleanup logs for what was deleted
## Registry Structure
`agents/registry.json`:
```json
{
"$schema": {
"description": "Registry of defined agents",
"namespace": "orchestration:",
"usage": "All agents accessed via 'orchestration:{agent-name}'"
},
"agent-name": {
"file": "agent-name.md",
"description": "One-line description",
"namespace": "orchestration:agent-name",
"created": "2025-01-08",
"usageCount": 0,
"lastUsed": null
}
}
```
## Examples
See examples in:
- [temp-agents.md](temp-agents.md) - Temp agent examples
- [defined-agents.md](defined-agents.md) - Permanent agent examples
- [promotion.md](promotion.md) - Promotion workflow examples
## Related Skills
- **creating-workflows**: Create workflows that use agents
- **executing-workflows**: Execute workflows with agents
- **designing-syntax**: Design custom syntax for agents
---
**Need to create Related in AI Agents
skill-development
IncludedComprehensive meta-skill for creating, managing, validating, auditing, and distributing Claude Code skills and slash commands (unified in v2.1.3+). Provides skill templates, creation workflows, validation patterns, audit checklists, naming conventions, YAML frontmatter guidance, progressive disclosure examples, and best practices lookup. Use when creating new skills, validating existing skills, auditing skill quality, understanding skill architecture, needing skill templates, learning about YAML frontmatter requirements, progressive disclosure patterns, tool restrictions (allowed-tools), skill composition, skill naming conventions, troubleshooting skill activation issues, creating custom slash commands, configuring command frontmatter, using command arguments ($ARGUMENTS, $1, $2), bash execution in commands, file references in commands, command namespacing, plugin commands, MCP slash commands, Skill tool configuration, or deciding between skills vs slash commands. Delegates to docs-management skill for official documentation.
reprompter
IncludedTransform messy prompts into well-structured, effective prompts โ single or multi-agent. Use when: "reprompt", "reprompt this", "clean up this prompt", "structure my prompt", rough text needing XML tags and best practices, "reprompter teams", "repromptception", "run with quality", "smart run", "smart agents", multi-agent tasks, audits, parallel work, anything going to agent teams. Don't use when: simple Q&A, pure chat, immediate execution-only tasks. See "Don't Use When" section for details. Outputs: Structured XML/Markdown prompt, quality score (before/after), optional team brief + per-agent sub-prompts, agent team output files. Success criteria: Single mode quality score โฅ 7/10; Repromptception per-agent prompt quality score 8+/10; all required sections present, actionable and specific.
adaptive-compaction
IncludedAdaptive add-on policy and recovery layer that decides WHEN to compact, prune, snapshot, or fork -- replacing fixed-percent auto-compaction across Claude Code, Codex, and MCP-capable hosts. Trigger on auto-compact timing or damage: "when should I compact", "is it safe to compact now or start a fresh session", "auto-compact fires too early/mid-task", "switching to an unrelated task but the window still has space", "context rot", "answers get worse the longer the session runs", "the agent forgot the plan or my decisions after it summarized", "add a layer on top that manages context without changing the agent", raising autoCompactWindow to give the policy room, or installing/tuning a cross-tool compaction policy or PreCompact hook -- even when "compaction" is never said but the problem is context-window pressure or post-summarization memory loss. Do NOT use to summarize a conversation, build RAG, write a summarization prompt (decides WHEN not HOW), or answer max-context-length trivia.
agent-skill-creator
IncludedCreate cross-platform agent skills from workflow descriptions. Activates when users ask to create an agent, automate a repetitive workflow, create a custom skill, or need advanced agent creation. Triggers on phrases like create agent for, automate workflow, create skill for, every day I have to, daily I need to, turn process into agent, need to automate, create a cross-platform skill, validate this skill, export this skill, migrate this skill. Supports single skills, multi-agent suites, transcript processing, template-based creation, interactive configuration, cross-platform export, and spec validation.
llm-wiki
IncludedUse when building or maintaining a persistent personal knowledge base (second brain) in Obsidian where an LLM incrementally ingests sources, updates entity/concept pages, maintains cross-references, and keeps a synthesis current. Triggers include "second brain", "Obsidian wiki", "personal knowledge management", "ingest this paper/article/book", "build a research wiki", "compound knowledge", "Memex", or whenever the user wants knowledge to accumulate across sessions instead of being re-derived by RAG on every query.
skill-master
IncludedAgent Skills authoring, evaluation, and optimization. Create, edit, validate, benchmark, and improve skills following the agentskills.io specification. Use when designing SKILL.md files, structuring skill folders (references, scripts, assets), ingesting external documentation into skills, running trigger evals, benchmarking skill quality, optimizing descriptions, or performing blind A/B comparisons. Keywords: agentskills.io, SKILL.md, skill authoring, eval, benchmark, trigger optimization.