---
name: agent-builder
description: Generates official OpenCodeKit agent configurations from natural language prompts.
version: 1.0.0
author: OpenCodeKit
license: MIT
inputs:
  prompt:
    type: string
    description: Natural language description of the desired agent (role, purpose, tools).
outputs:
  path:
    type: string
    description: Absolute path to the created agent configuration file.
  usage:
    type: string
    description: Instructions on how to use the new agent.
tools:
  - prompt-improver
  - write
  - read
---

# Agent Builder Skill

This skill analyzes a user's request to create a new subagent, extracts the necessary metadata (name, description, system prompt, toolset), and generates a compliant OpenCodeKit agent configuration file in `~/.config/opencode/agent/`.

## Usage

```python
from skills.specialized.agent_builder.scripts.builder import build_agent

result = build_agent("I need a python expert to review my code")
print(result)
```

## Security

- **Input Sanitization**: Agent names are strictly validated (`^[a-z0-9-]+$`).
- **Path Validation**: Writes are restricted to `~/.config/opencode/agent/`.
- **Tool Safety**: Default toolset is restricted to safe read-only tools unless overrides are explicitly requested.
