一键导入
create-executor
全自动接入 CLI Agent 执行器。用户只需说出执行器名称和用途,Claude 自动完成:读取代码 → 生成执行器 → 注册 → 自测 → 完成。触发词:'创建执行器', '接入执行器', 'create executor', '新增执行器', '/create-executor'。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
全自动接入 CLI Agent 执行器。用户只需说出执行器名称和用途,Claude 自动完成:读取代码 → 生成执行器 → 注册 → 自测 → 完成。触发词:'创建执行器', '接入执行器', 'create executor', '新增执行器', '/create-executor'。
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
识别每日验收、PR 验收、commit 验收、未发布分支验收、缺陷复测、视觉回归和发布前验收等场景,并为 create-visual-test-to-kb 生成测试范围、指差法步骤、预期结果、证据链、截图回读和报告结构。Use when the user asks to optimize or run visual acceptance across different scenarios, asks whether yesterday's changes, a PR, a commit range, or an unpublished branch were really accepted, or needs PR/commit results to map to screenshots and MAP knowledge base reports.
Convert PRs, commits, yesterday's changes, or release scope into a test-minded acceptance design before visual execution. Use when the user asks for daily acceptance, visual acceptance, PR/commit acceptance, proof that code changes really affected product behavior, coverage planning, fusion testing, evidence strength, or when screenshots/reports looked related but failed to prove the assigned task.
工业级功能验收/视觉测试全流水线(MAP 验收标准 v2)——模拟人类的浏览器取证 + 标准化验收报告 + 归档进 CDS 验收中心并出直达深链。职责分离:验收报告永远按项目归 CDS(平台自带、证据链内置),MAP 等系统通过知识库开放协议从 CDS 拉取展示,技能不再分流到 MAP 知识库。一个技能内含三段:标准/模板、模拟人类浏览器取证(点击导航进入、禁地址栏直达、双主题截图、ZZ 照做风画框标序号 stepClick/stepShot)、报告归档(命名结构固定,**每次归档强制输出可达地址**:CDS 直达深链 /reports,匿名对外用 /r/token)。默认报告走 **ZZ 照做风**(全大标题 + 一句话一步 + 逐步配图 `{{IMG:}}` + 文字在上图在下 + 变化处画框 + 分支顺序讲,同岗位照做必复现)。归档前有**强制准入校验**:目标/档位/Verdict/截图数/证据完整性/报告结构不达标直接拒收(入口准则,杜绝"什么都能进")。项目无关,改 acceptance.config.json 即可跨仓库复用;无 CDS/离线退化为本地 md+截图。触发词:"视觉验收"、"验收"、"视觉测试"、"验收归档"、"归档验收报告"、"create visual test"、"/视觉验收"、"/验收"。
CDS (Cloud Dev Space) core skill — hosts the canonical cdscli Python CLI, handles authentication (static AI_ACCESS_KEY / dynamic pairing / project key), manages env vars and project keys, owns CDS service self-update, defines the preview-URL slug formula, and acts as dispatcher when the user's intent is ambiguous between cold-path scanning and hot-path debugging. Activates when the user mentions CDS generically without specifying scan-or-deploy, configures CDS credentials, manages env / keys, updates the CDS service code itself, or asks about preview URL conventions. Does NOT directly perform project scanning (delegates to cds-project-scan, the cold path) or deployment debugging (delegates to cds-deploy-pipeline, the hot path). Trigger phrases include "cds 认证", "AI_ACCESS_KEY", "项目 key", "cds 自更新", "cds self-update", "预览地址公式", "配 cds 环境变量", "/cds", "/cds-auth", and the bare word "cds" when the user has not yet picked a direction.
Generates weekly project reports from git history. Collects commits, PRs, and contributor data, analyzes and categorizes changes, then produces a structured Chinese-language weekly report (overview, completed items, next-week priorities) saved to doc/report.YYYY-WXX.md. Trigger words: "生成周报", "写周报", "weekly report", "本周总结".
从 git 历史生成「今日大事早知道」开发日报,并发布到知识库(文档空间)。按「新增功能多讲 → 优化/修复次之 → 计划/遗留垫底」的固定权重分层叙事。自动 find-or-create「日报知识库」并出分享链。触发词:"生成日报"、"写日报"、"今日大事"、"日报"、"daily report"、"/daily"、"今天干了啥"。
| name | create-executor |
| description | 全自动接入 CLI Agent 执行器。用户只需说出执行器名称和用途,Claude 自动完成:读取代码 → 生成执行器 → 注册 → 自测 → 完成。触发词:'创建执行器', '接入执行器', 'create executor', '新增执行器', '/create-executor'。 |
版本:v1.0.0 | 状态:已落地 | 触发:
/create-executor、"创建执行器"、"接入执行器"、"新增执行器"
你是一个执行器接入 Agent。用户只需告诉你执行器名称和用途,你自主完成全部接入工作。
收到请求后,不要问问题,直接按以下步骤自主执行。只在需要用户提供密钥/凭据时才暂停询问。
prd-api/src/PrdAgent.Api/Services/CapsuleExecutor.cs,找到 ExecuteCliAgentAsync 入口方法和已有执行器(搜索 ExecuteCliAgent_)prd-api/src/PrdAgent.Core/Models/CapsuleTypeRegistry.cs,找到 CliAgentExecutor 的 ConfigSchema根据用户描述,生成执行器实现。必须遵循接入范式:
方法签名(固定):
private static async Task<CapsuleResult> ExecuteCliAgent_{PascalName}Async(
IServiceProvider sp, WorkflowNode node, Dictionary<string, string> variables,
CliAgentContext ctx, StringBuilder sb, ILogger logger, EmitEventDelegate? emitEvent)
输入:CliAgentContext(已有,不要修改)
ctx.Spec / ctx.Framework / ctx.Style / ctx.Prompt — 通用配置ctx.SpecInput — 上游产品规格ctx.PreviousOutput — 上轮 HTML(多轮迭代)ctx.UserFeedback — 用户修改意见(多轮迭代)ctx.IsIteration — 是否迭代轮ctx.TimeoutSeconds / ctx.EnvVars — 资源限制输出(固定):必须返回 cli-html-out 槽位
return new CapsuleResult(new List<ExecutionArtifact>
{
MakeTextArtifact(node, "cli-html-out", "生成页面", html, "text/html"),
MakeTextArtifact(node, "cli-log-out", "日志", sb.ToString()),
}, sb.ToString());
多轮迭代(必须支持):
if (ctx.IsIteration)
{
// 把 ctx.PreviousOutput + ctx.UserFeedback 传给执行逻辑
// 要求在上轮基础上增量修改,不要全部重写
}
进度事件(必须发射):
if (emitEvent != null)
await emitEvent("cli-agent-phase", new { phase = "running", message = "描述当前步骤…" });
文件 1: CapsuleTypeRegistry.cs
在 CliAgentExecutor 的 ConfigSchema 中找到 executorType 的 Options 列表,追加:
new() { Value = "{kebab-name}", Label = "{显示名称}" },
如果执行器有专有配置,在 ConfigSchema 末尾(timeoutSeconds 之前)追加字段:
// ── {Name} 执行器配置 ──
new() { Key = "{kebabName}Config", Label = "xxx", FieldType = "text", Required = false, HelpTip = "{Name} 执行器专用:..." },
文件 2: CapsuleExecutor.cs
在 ExecuteCliAgentAsync 方法的 switch 中追加分支:
"{kebab-name}" => await ExecuteCliAgent_{PascalName}Async(sp, node, variables, ctx, sb, logger, emitEvent),
然后在 // ── CLI Agent 工具方法 ── 注释之前插入执行器方法实现。
执行:
cd prd-api && dotnet build --no-restore 2>&1 | grep -E "error CS|warning CS" | head -30
如果有编译错误,自行修复后重新编译,直到零错误。
构造一个最小测试用例,验证执行器可以运行:
# 自测方法:直接在 C# 中构造 WorkflowNode 调用执行器
# 如果环境有 dotnet,写一个简单的测试脚本
cd prd-api && dotnet build --no-restore
编译通过即为 Phase 5 通过(实际运行时测试需要完整环境)。
对于可以静态验证的部分:
changelogs/YYYY-MM-DD_{name}-executor.md{Name} 执行器接入完成
改动文件:
- CapsuleTypeRegistry.cs:注册 executorType="{kebab-name}" + {N} 个专有配置
- CapsuleExecutor.cs:新增 ExecuteCliAgent_{PascalName}Async ({N} 行)
执行器类型:{类型描述}
多轮迭代:支持
编译检查:通过
用户可在工作流编辑器中添加「CLI Agent 执行器」胶囊,执行器类型选择「{显示名}」即可使用。
| 类型 | 核心逻辑 | 示例 |
|---|---|---|
| LLM 策略型 | 调用 ILlmGateway,不同 system prompt | 专业文档生成器、PPT 页面生成器 |
| Docker 容器型 | Process.Start("docker", args) | OpenHands、Aider、自定义镜像 |
| API 调用型 | HttpClient.PostAsync | Bolt.new、v0、自建微服务 |
| CLI 进程型 | Process.Start(command) | 本地 Node.js 脚本、Python 工具 |
| 混合型 | LLM 生成 prompt → 传给外部工具 | LLM 审题 + CLI 执行 |
调用 ILlmGateway 时必须使用 SendAsync + RequestBody(OpenAI messages 格式),不存在 GenerateAsync/SystemPrompt/UserMessage:
var gateway = sp.GetRequiredService<PrdAgent.Infrastructure.LlmGateway.ILlmGateway>();
var messages = new System.Text.Json.Nodes.JsonArray
{
new System.Text.Json.Nodes.JsonObject { ["role"] = "system", ["content"] = systemPrompt },
new System.Text.Json.Nodes.JsonObject { ["role"] = "user", ["content"] = userPrompt },
};
var request = new PrdAgent.Infrastructure.LlmGateway.GatewayRequest
{
AppCallerCode = "page-agent.generate::chat",
ModelType = "chat",
TimeoutSeconds = ctx.TimeoutSeconds,
RequestBody = new System.Text.Json.Nodes.JsonObject { ["messages"] = messages },
};
var response = await gateway.SendAsync(request, CancellationToken.None);
var content = response?.Content ?? "";
读取代码后以实际为准,截至技能创建时:
| Value | 名称 | 依赖 |
|---|---|---|
builtin-llm | 内置 LLM | ILlmGateway |
docker | Docker 容器 | docker CLI |
api | 外部 API | IHttpClientFactory |
script | Jint 脚本 | 无 |