9e6d831ea9
- /create-bot: usa create-full.sh --type robot (pipeline de 6 pasos) - /create-agent: documenta --type robot y notificacion a developers - Referencia actualizada: agents/test-bot/ como ejemplo de robot Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5.2 KiB
5.2 KiB
name, description, allowed-tools, argument-hint
| name | description | allowed-tools | argument-hint |
|---|---|---|---|
| create-bot | Crear un nuevo robot Matrix (command-only, sin LLM). Ejecuta el pipeline scaffold + build + register + verify + convert + notify, luego personaliza comandos custom segun los inputs del usuario. | Bash Read Write Edit Grep Glob Agent | <bot-id> [display-name] |
Crear robot Matrix
Skill para crear un robot Matrix ligero (command-only, sin LLM). Un robot solo responde a comandos — no tiene reglas, memoria, tools ni system prompt.
Inputs requeridos
Recoger del usuario (preguntar lo que falte):
| Input | Requerido | Default | Ejemplo |
|---|---|---|---|
bot-id |
si | — | ping-bot |
display-name |
si | bot-id | "Ping Bot" |
description |
si | — | "Bot de monitoreo con ping" |
| Comandos custom | no | ninguno | !status, !deploy <env> |
Si $ARGUMENTS contiene el bot-id, usarlo directamente: $0 = bot-id, $1 = display-name.
Proceso completo
Paso 1: Validar inputs
- Verificar que
bot-ides kebab-case (lowercase, letras, numeros, guiones) - Verificar que no existe
agents/<bot-id>/ - Si faltan inputs, preguntar al usuario
Paso 2: Ejecutar pipeline completo
./dev-scripts/agent/create-full.sh <bot-id> "<display-name>" --type robot
Este script ejecuta 6 etapas automaticamente:
- Scaffold: crea agent.go, config.yaml, prompts/ desde template
- Build: verifica compilacion con
-tags goolm - Register: registra usuario Matrix, genera token + password + pickle key
- Verify E2EE: genera cross-signing keys + recovery key
- Convert: convierte a robot (config minimo, sin prompts, sin LLM,
command_prefix: "") - Notify: envia DM a los developers (DEVELOPER_MATRIX_USERS) presentandose
Si alguna etapa falla, revisar el error y corregir antes de continuar.
Paso 3: Personalizar config
Editar agents/<bot-id>/config.yaml:
agent.description: la descripcion del usuariopersonality.prefix: emoji representativo del bot (opcional)
Paso 4: Crear comandos custom (si el usuario los pidio)
Si el usuario pidio comandos custom, crear agents/<bot-id>/commands.go:
package <pkgname>
import (
"context"
"fmt"
"github.com/enmanuel/agents/pkg/command"
"github.com/enmanuel/agents/pkg/decision"
)
// CommandEntry pairs a spec with its handler.
type CommandEntry struct {
Spec command.Spec
Handler func(ctx context.Context, msgCtx decision.MessageContext) string
}
// Commands returns the command specs and handlers for this bot.
func Commands() []CommandEntry {
return []CommandEntry{
{
Spec: command.Spec{
Name: "<command-name>",
Description: "<descripcion>",
Usage: "!<command-name> [args]",
},
Handler: func(ctx context.Context, msgCtx decision.MessageContext) string {
// Implementar logica del comando
return "respuesta"
},
},
}
}
Luego registrar en cmd/launcher/main.go despues de agents.NewRobot():
if cfg.Agent.ID == "<bot-id>" {
for _, cmd := range <pkg>.Commands() {
robot.RegisterCommand(cmd.Spec, cmd.Handler)
}
}
Paso 5: Verificar compilacion
go build -tags goolm ./...
Si falla, corregir y reintentar.
Paso 6: Checklist final
Verificar y reportar al usuario:
go build -tags goolm ./...compila sin erroresagents/<id>/agent.goexportaRules()que retornanilagents/<id>/config.yamltieneagent.type: robotyagent.idcoincide con directoriocmd/launcher/main.gotiene import del paquete del bot.envcontiene las 4 env vars:MATRIX_TOKEN_<NORM>,MATRIX_PASSWORD_<NORM>,PICKLE_KEY_<NORM>,SSSS_RECOVERY_KEY_<NORM>- No existe
agents/<id>/prompts/(robots no necesitan system prompt) - Si tiene comandos custom, estan registrados en el launcher
Informar al usuario:
Robot <bot-id> creado. Para arrancar:
./dev-scripts/server/start.sh
Comandos built-in: help, ping, status, info, version
Comandos custom: <lista si hay>
(Sin prefijo ! — el robot acepta comandos directamente)
Archivos a revisar:
agents/<bot-id>/config.yaml — configuracion
agents/<bot-id>/commands.go — comandos custom (si aplica)
Diferencias clave con /create-agent
| Aspecto | /create-agent | /create-bot |
|---|---|---|
| Runtime | agents.New() |
agents.NewRobot() |
| Config type | agent (default) |
robot |
| LLM | Si | No |
| System prompt | Obligatorio | No existe |
| Reglas | Si (agent.go con Rules) | nil |
| Tools | Opcionales | No |
| Memoria/Knowledge | Opcionales | No |
| Prefijo comandos | ! (obligatorio) |
"" (sin prefijo por defecto) |
| Comandos built-in | help, ping, tools, tool, status, info, clear, prompts, version | help, ping, status, info, version |
Notas importantes
- Siempre compilar con
-tags goolm - Nunca commitear tokens ni passwords — van en
.env - Homeserver:
https://matrix-af2f3d.organic-machine.com - Server name:
matrix-af2f3d.organic-machine.com - Referencia de robot existente:
agents/test-bot/ - El bot-id DEBE coincidir entre directorio, config.yaml y
agents.Register()