Agent Creator
Agent Creator 把自然语言需求转换为一个最小、可维护的 agent-compose 项目,并使用真实 CLI 校验配置。用户明确要求导入时,它还可以把生成项目提交给 daemon。
场景与解决的问题
它面向需要频繁创建示例、原型或团队模板的维护者。与直接让通用 Agent 临时编写 YAML 相比,Creator 把仓库的设计规则、公开发布约束、脚手架和校验器打包到运行环境中,使输出结构一致,并明确区分“配置通过校验”和“已经实际运行”。
工作原理
仓库级 create-agent-compose-agents Skill 保存设计原则、Compose 约束、运行时参考和确定性脚本。构建镜像时,该 Skill 与 agent-compose CLI 一起复制到 guest:
用户需求
→ creator 读取 Skill 并设计角色
→ scaffold.mjs 生成基础项目
→ validate-project.mjs + agent-compose config 校验
→ 可选:publish-project.mjs 导入 daemon
生成文件位于 creator sandbox 的 /workspace。默认不引用 creator 内部的本地路径,以免 daemon 无法读取生成项目依赖。
构建与启动
需要本地已经存在控制面 agent-compose:latest 镜像;guest 基础镜像默认使用官方的 chaitin/agent-compose-guest:latest。由于构建上下文包含仓库级 Skill,请从本示例目录直接使用 Compose 构建配置:
agent-compose config --quiet
agent-compose image build
agent-compose up
agent-compose run -it creator --prompt \
"创建一个每天工作日 9 点生成中文待办摘要的 agent-compose 项目,先校验但不要导入"
默认 AGENT_COMPOSE_HOST=http://agent-compose:7410,适用于标准 Docker Compose 网络。如果 daemon 使用其他可从 sandbox 访问的地址,请在 agent-compose.yml 中调整它。sandbox 中的 127.0.0.1 指向 sandbox 自身。
预期效果与清理
Creator 应报告生成目录、文件、验证级别、缺失的 provider 或运行条件,以及后续命令;不能把静态校验描述成运行验证。
agent-compose logs creator
agent-compose down
仓库维护者和其他 AI Agent 也可以不运行该示例,直接使用 .agents/skills/create-agent-compose-agents 开发新项目。