4d6f97d01e
Dos skills declarativas para automatizar flujos complejos: - create-agent: pipeline completo de scaffold + build + register + verify para nuevos agentes/robots Matrix, con templates para agent.go, config.yaml y system prompt. - parallel-fix-issues: implementación concurrente de múltiples issues usando git worktrees y agentes paralelos, con análisis de dependencias, verificación por wave e integración ordenada a master. Ambas skills incluyen templates y scripts auxiliares. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2.0 KiB
2.0 KiB
Template: agent.go
Plantilla para agents/<agent-id>/agent.go. Adaptar segun el tipo de agente.
Regla de package name
El nombre del package se deriva del agent-id:
- Eliminar guiones
- Eliminar sufijo
_botsi existe - Ejemplos:
monitor-bot→package monitorasistente-2→package asistente2deploy-agent→package deployagentmy-bot→package my
Agente con LLM (estandar)
Regla basica: DM o mencion → LLM.
package <pkgname>
import "github.com/enmanuel/agents/pkg/decision"
// Rules returns the decision rules for the <agent-id> agent.
func Rules() []decision.Rule {
return []decision.Rule{
{
Name: "llm-all",
Match: func(ctx decision.MessageContext) bool {
return ctx.IsDirectMsg || ctx.IsMention
},
Actions: []decision.Action{{
Kind: decision.ActionKindLLM,
LLM: &decision.LLMAction{},
}},
},
}
}
Robot (solo comandos, sin LLM)
Sin reglas — solo responde a comandos !xxx.
package <pkgname>
import "github.com/enmanuel/agents/pkg/decision"
// Rules returns no rules — this robot only responds to commands.
func Rules() []decision.Rule {
return nil
}
Reglas avanzadas (solo si el usuario lo pide)
Respuesta estatica a DMs
{
Name: "dm-greeting",
Match: func(ctx decision.MessageContext) bool {
return ctx.IsDirectMsg
},
Actions: []decision.Action{{
Kind: decision.ActionKindReply,
Reply: &decision.ReplyAction{Content: "Hola, soy <nombre>. Usa !help para ver mis comandos."},
}},
},
Composicion con And/Or
{
Name: "admin-llm",
Match: decision.And(
func(ctx decision.MessageContext) bool { return ctx.IsDirectMsg },
func(ctx decision.MessageContext) bool { return ctx.PowerLevel >= 50 },
),
Actions: []decision.Action{{Kind: decision.ActionKindLLM, LLM: &decision.LLMAction{}}},
},
Reglas estrictas
- PURO: solo imports de
pkg/decision, cero I/O - No usar reglas para comandos — los comandos se gestionan via
RegisterCommand - ActionKind disponibles:
ActionKindReply,ActionKindLLM