Agents

From Steffen025/pai-opencode · View interactive version

Agents is an AI agent skill from the GitHub repository Steffen025/pai-opencode. Dynamic agent composition. USE WHEN custom agents, agent personalities, traits, voices.

How to use this skill

Skill file

Agents - Custom Agent Composition System

Auto-routes when user mentions custom agents, agent creation, or specialized personalities.

Customization

Before executing, check for user customizations at:

~/.opencode/PAI/USER/SKILLCUSTOMIZATIONS/Agents/

If this directory exists, load and apply:

These define user-specific named agents with persistent identities. If the directory does not exist, use only dynamic agent composition from traits.

Overview

The Agents skill is a complete agent composition and management system. It consolidates all agent-related infrastructure:

Voice Notification

When executing a workflow, do BOTH:

  1. Send voice notification:

```bash

curl -s -X POST http://localhost:8888/notify \

-H "Content-Type: application/json" \

-d '{"message": "Running the WORKFLOWNAME workflow from the Agents skill"}' \

> /dev/null 2>&1 &

```

  1. Output text notification:

```

Running the WorkflowName workflow from the Agents skill...

```

Workflow Routing

Available Workflows:

Examples

Example 1: Create custom agents for analysis

User: "Spin up 5 custom science agents to analyze this data"
→ Invokes CREATECUSTOMAGENT workflow
→ Runs AgentFactory 5 times with DIFFERENT trait combinations
→ Each agent gets unique personality + matched voice
→ Launches agents in parallel with model: "sonnet"

Example 2: List available traits

User: "What agent personalities can you create?"
→ Invokes LISTTRAITS workflow
→ Displays expertise (security, legal, finance, etc.)
→ Shows personality types (skeptical, enthusiastic, analytical, etc.)
→ Lists approach styles (thorough, rapid, systematic, etc.)

Example 3: Spawn parallel researchers

User: "Launch 10 agents to research these companies"
→ Invokes SPAWNPARALLEL workflow
→ Creates 10 Intern agents (generic, same voice)
→ Uses model: "haiku" for speed
→ Launches spotcheck agent after completion

Architecture

Hybrid Agent Model

The system uses two types of agents:

| Type | Definition | Best For |

|------|------------|----------|

| Named Agents | Persistent identities with backstories (Remy, Ava, Marcus) | Recurring work, voice output, relationships |

| Dynamic Agents | Task-specific specialists composed from traits | One-off tasks, novel combinations, parallel work |

The Agent Spectrum

┌─────────────────────────────────────────────────────────────────────┐
│   NAMED AGENTS          HYBRID USE          DYNAMIC AGENTS          │
│   (Relationship)        (Best of Both)      (Task-Specific)         │
├──────────────────────────────────────────────────────────────────────┤
│ Remy, Ava, Marcus   "Security expert      Ephemeral specialist      │
│                      with Johannes's      composed from traits      │
│                      skepticism"                                     │
└─────────────────────────────────────────────────────────────────────┘

Route Triggers

CRITICAL: The word "custom" is the KEY trigger:

| User Says | What to Use | Why |

|-----------|-------------|-----|

| "custom agents", "create custom agents" | AgentFactory | Unique prompts + unique voices |

| "agents", "launch agents", "bunch of agents" | Generic Interns | Same voice, parallel grunt work |

| "use Remy", "get Ava to" | Named agent | Pre-defined personality |

Other triggers:

Components

Data

Traits.yaml (Data/Traits.yaml)

Templates

DynamicAgent.hbs (Templates/DynamicAgent.hbs)

Tools

AgentFactory.ts (Tools/AgentFactory.ts)

# Usage examples
bun run ~/.opencode/skills/Agents/Tools/AgentFactory.ts --task "Review security architecture"
bun run ~/.opencode/skills/Agents/Tools/AgentFactory.ts --traits "legal,skeptical,meticulous"
bun run ~/.opencode/skills/Agents/Tools/AgentFactory.ts --list

Personalities

AgentPersonalities.md (AgentPersonalities.md)

Named Agents:

Integration Points

Voice Server (~/.opencode/VoiceServer/)

PAI Skill (~/.opencode/PAI/)

Usage Patterns

For Users (Natural Language)

Users talk naturally:

Internal Process

When user says "custom agents", the assistant:

  1. Invokes CREATECUSTOMAGENT workflow
  2. Runs AgentFactory for EACH agent with DIFFERENT trait combinations
  3. Gets unique prompt + voice ID for each
  4. Launches agents using Task tool with the composed prompt
  5. Each agent has a distinct personality-matched voice

Example internal execution:

# User: "Create 3 custom research agents"

# Agent 1
bun run AgentFactory.ts --traits "research,enthusiastic,exploratory"
# Output: Prompt with voice "Jeremy" (energetic)

# Agent 2
bun run AgentFactory.ts --traits "research,skeptical,thorough"
# Output: Prompt with voice "George" (intellectual)

# Agent 3
bun run AgentFactory.ts --traits "research,analytical,systematic"
# Output: Prompt with voice "Drew" (professional)

# Launch all 3 with Task tool
Task({ prompt: <agent1_prompt>, subagent_type: "Intern", model: "sonnet" })
Task({ prompt: <agent2_prompt>, subagent_type: "Intern", model: "sonnet" })
Task({ prompt: <agent3_prompt>, subagent_type: "Intern", model: "sonnet" })

Model Selection

Always specify the appropriate model:

| Task Type | Model | Speed Multiplier |

|-----------|-------|------------------|

| Grunt work, simple checks | haiku | 10-20x faster |

| Standard analysis, research | sonnet | Balanced |

| Deep reasoning, architecture | opus | Maximum intelligence |

Rule: Parallel agents especially benefit from haiku for speed.

Related Skills

Version History

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.