方案确认 skill
一句话说明:把流程选择结果和事务单据整理成可执行方案,作为方案执行前的闸门。
在项目里的位置:项目经理 Agent 在流程选择后调用它,确认目标、范围、输入输出、知识库范围、执行规则、测试规则和失败出口。
什么时候调用
- 流程选择已经完成。
- 需要明确方案执行能不能开始。
- 需要把任务约束整理成执行计划。
不能做什么
- 不生成 DSL。
- 不修改原 DSL。
- 不运行测试。
- 不写回填结果。
输入字段
| 英文字段 | 中文名称 | 说明 |
|---|---|---|
pipeline_decision | 流程选择结果 | pipeline-selector 的输出。 |
task_package | 事务单据 | 任务目标、产物、验收要求等。 |
knowledge_context | 知识库上下文 | 案例、规范、旧 DSL 摘要等。 |
rule_context | 规则库上下文 | 硬性规则、命名规则、测试规则。 |
runtime_context | 运行上下文 | 可用工具、权限、AIHub 环境等。 |
输出字段
| 英文字段 | 中文名称 | 说明 |
|---|---|---|
plan_id | 执行方案 ID | 本次执行方案的唯一标识。 |
pipeline_type | Pipeline 类型 | 继承流程选择结果。 |
goal | 任务目标 | 本次要达成什么。 |
scope | 范围 | 本次做什么、不做什么。 |
input_contract | 输入约定 | 需要哪些输入字段和来源。 |
output_contract | 输出约定 | 要产出哪些文件、字段和格式。 |
knowledge_scope | 知识库范围 | 后续 skill 可读取哪些知识。 |
test_rules | 测试规则 | 成功、失败、修复和证据要求。 |
can_execute | 是否允许执行 | 是否能进入方案执行。 |
执行流程
- 读取流程选择结果。
- 检查事务单据关键字段。
- 定义目标和服务对象。
- 拆分范围:本次要做 / 本次不做。
- 定义输入、输出、知识库、执行和测试规则。
- 给出失败出口和是否允许执行。
成功标准
- 目标清楚。
- 范围清楚。
- 输入输出约定完整。
- 测试规则可执行。
- 失败出口可回填。
失败标准
- 目标缺失。
- 输出约定缺失。
- 测试规则缺失。
- 迭代任务缺旧 DSL 或变更要求。
- 流程选择结果不安全。
查看原始 SKILL.md
---
name: execution-plan-confirmer
description: "Turn a pipeline decision and structured task package into a complete execution plan for the automation-building project. Use when Codex or a project manager Agent needs the 方案确认 skill to define goal, scope, input contract, output contract, knowledge scope, execution rules, test rules, failure exits, and whether方案执行 is allowed."
---
# Execution Plan Confirmer
## Role
Use this skill as the方案确认 skill. It turns `pipeline_decision`(流程选择结果) and `task_package`(事务单据) into a structured `execution_plan`(执行方案).
It is the gate before方案执行. It must not create DSL, modify DSL, test DSL, repair DSL, or write callback results.
```text
pipeline-selector -> execution-plan-confirmer -> 方案执行 skill
```
## Non-Negotiable Rules
1. Only confirm the execution plan. Do not generate, rewrite, repair, import, or test DSL.
2. Use only the provided task package, pipeline decision, knowledge context, and rule context.
3. If the goal, scope, output contract, test rules, or failure exit is missing, set `can_execute`(是否允许执行) to false.
4. Do not guess missing business facts. Expose missing fields in `missing_fields`(缺失字段).
5. Do not change the pipeline selected by `pipeline_decision`(流程选择结果). If it looks wrong, report `plan_risks`(方案风险) and set `can_execute`(是否允许执行) to false when execution would be unsafe.
6. For iteration tasks, original DSL must be read-only. The plan can require copying the original DSL, but cannot allow direct modification, deletion, or movement.
7. For `new_dsl`(新建 DSL) and `iterate_dsl`(迭代 DSL), the execution output must include a DSL file and DSL file description.
8. For `other`(其他), the execution output must not require DSL generation.
9. Output every required field. Missing output fields are a skill failure.
## Inputs
| Field | 中文名称 | Required | Description |
|---|---|---|---|
| `pipeline_decision` | 流程选择结果 | Yes | Output from `pipeline-selector`(流程选择 skill) |
| `task_package` | 事务单据 | Yes | Standard task package from task intake |
| `knowledge_context` | 知识库上下文 | Yes | Relevant old DSL, cases, standards, examples, and known constraints |
| `rule_context` | 规则库上下文 | Yes | Global hard rules, naming rules, read-only rules, test rules, repair rules, callback rules |
| `runtime_context` | 运行上下文 | Optional | Available tools, permissions, AI Hub environment, credentials, and runtime limitations |
## Required Input Checks
| Field | 中文名称 | Required | Failure handling |
|---|---|---|---|
| `pipeline_type` | Pipeline 类型 | Yes | Missing means `can_execute=false`(不允许执行) |
| `task_id` | 事务单据 ID | Yes | Missing means the task cannot be traced |
| `task_title` | 任务标题 | Yes | Missing means the plan cannot be reviewed cleanly |
| `task_description` | 任务描述 | Yes | Missing means the goal may be unclear |
| `expected_artifact` | 期望产物 | Yes | Missing means output contract cannot be confirmed |
| `acceptance_requirements` | 验收要求 | Yes | Missing means test rules cannot be confirmed |
| `callback_fields` | 回填字段 | Yes | Missing means failure exit and result callback cannot be confirmed |
| `existing_dsl_uri` | 原 DSL 地址 | Required for iteration when available | Missing for an iteration request means the plan must explain whether to treat it as new DSL or block |
| `change_request` | 变更要求 | Required for iteration | Missing means iteration scope is unsafe |
## Outputs
| Field | 中文名称 | Required | Description |
|---|---|---|---|
| `plan_id` | 执行方案 ID | Yes | Unique execution plan ID |
| `pipeline_type` | Pipeline 类型 | Yes | Inherit from `pipeline_decision`(流程选择结果) |
| `goal` | 任务目标 | Yes | What this task must achieve |
| `service_target` | 服务对象 | Yes | User, team, workshop, or downstream system served by the output |
| `scope` | 范围 | Yes | What to do and what not to do |
| `input_contract` | 输入约定 | Yes | Required execution inputs, fields, sources, and validation rules |
| `output_contract` | 输出约定 | Yes | Required output files, fields, formats, and naming rules |
| `knowledge_scope` | 知识库范围 | Yes | Which knowledge files or knowledge categories should be used by方案执行 and方案测试 |
| `execution_rules` | 执行规则 | Yes | Hard rules that方案执行 must follow |
| `test_rules` | 测试规则 | Yes | Success criteria, failure criteria, test level, and repair rule |
| `failure_exit` | 失败出口 | Yes | What to return when execution cannot continue or fails |
| `missing_fields` | 缺失字段 | Yes | Missing required inputs or plan elements; empty array when none |
| `plan_risks` | 方案风险 | Yes | Risks that must be visible to the project manager Agent |
| `can_execute` | 是否允许执行 | Yes | True only when方案执行 can start safely |
| `next_step` | 下一步 | Yes | `execute_plan`(进入方案执行) or `callback_missing_requirements`(回填缺失要求) |
## Confirmation Workflow
1. Read `pipeline_decision`(流程选择结果) first.
2. Confirm `pipeline_type`(Pipeline 类型) is one of `new_dsl`(新建 DSL), `iterate_dsl`(迭代 DSL), or `other`(其他).
3. Read `task_package`(事务单据) and extract goal, service target, expected artifact, acceptance requirements, and callback fields.
4. Check whether the selected pipeline can be executed safely.
5. Define `scope`(范围) as two lists: `in_scope`(本次要做) and `out_of_scope`(本次不做).
6. Define `input_contract`(输入约定) with required input fields, allowed sources, and missing-field behavior.
7. Define `output_contract`(输出约定) with stable output fields, file naming, and required explanation files.
8. Define `knowledge_scope`(知识库范围) for the next skills.
9. Define `execution_rules`(执行规则) and `test_rules`(测试规则).
10. Define `failure_exit`(失败出口).
11. Set `can_execute`(是否允许执行).
## Pipeline-Specific Plan Rules
| Pipeline | Confirmation focus | Output contract |
|---|---|---|
| `new_dsl`(新建 DSL) | Confirm new workflow goal, service target, inputs, outputs, DSL purpose, naming, and test expectations | `XXX新建版本.V1.0` DSL, DSL file description, version, test report |
| `iterate_dsl`(迭代 DSL) | Confirm old DSL source, read-only copy rule, current ability, change request, unchanged abilities, impact scope, and version naming | `XXX迭代版本.V1.0` DSL, DSL file description, change summary, impact scope, test report |
| `other`(其他) | Confirm that no DSL is required and define whether to analyze, close, transfer, or return missing information | Analysis result, no-DSL reason, suggested action, callback status |
## Knowledge Scope Rules
| Pipeline | Required knowledge scope |
|---|---|
| `new_dsl`(新建 DSL) | Similar DSL cases, AI Hub workflow standards, DSL naming rules, output schema examples, test sample rules |
| `iterate_dsl`(迭代 DSL) | Original DSL as read-only source, old version description, change request, regression rules, affected node checklist |
| `other`(其他) | Task policy, classification reason, relevant business documents, callback and closure rules |
## Execution Rules
Always include these rules in `execution_rules`(执行规则) when relevant:
| Rule | 中文名称 | Applies to |
|---|---|---|
| `no_original_dsl_mutation` | 原 DSL 不可变更 | All DSL iteration tasks |
| `copy_before_iteration` | 迭代前先复制 | Iteration |
| `fixed_version_naming` | 固定版本命名 | New and iteration |
| `no_scope_expansion` | 不扩大范围 | All pipelines |
| `no_fabricated_inputs` | 不编造输入 | All pipelines |
| `dsl_description_required` | 必须输出 DSL 文件说明 | New and iteration |
| `test_before_callback` | 回填前必须测试 | New and iteration |
## Test Rules
`test_rules`(测试规则) must contain:
| Field | 中文名称 | Required |
|---|---|---|
| `success_criteria` | 成功标准 | Yes |
| `failure_criteria` | 失败标准 | Yes |
| `required_test_level` | 必测等级 | Yes |
| `repair_policy` | 修复策略 | Yes |
| `max_repair_attempts` | 最大修复次数 | Yes |
| `evidence_required` | 必需证据 | Yes |
Default repair policy:
```json
{
"repair_policy": "测试失败且可修复时,由项目经理 Agent 带着 repair_context(修复上下文)回到方案执行 skill;最多修复 5 次。",
"max_repair_attempts": 5
}
```
## Failure Exit Rules
Use `failure_exit`(失败出口) to tell the project manager Agent what to回填 when方案执行 cannot start.
| Failure | Required failure exit |
|---|---|
| Missing goal | Ask for business goal and expected artifact |
| Missing output contract | Ask for required output fields and final file type |
| Missing test rules | Ask for acceptance requirements or test standard |
| Missing old DSL for real iteration | Ask for original DSL URI or approve new DSL path |
| Unsafe pipeline decision | Return plan risk and stop execution |
## Success Criteria
The skill succeeds only when:
| Item | Standard |
|---|---|
| Goal | `goal`(任务目标) is clear |
| Scope | `scope`(范围) has both in-scope and out-of-scope content |
| Input | `input_contract`(输入约定) lists required fields and missing-field behavior |
| Output | `output_contract`(输出约定) lists stable output fields and naming rules |
| Knowledge | `knowledge_scope`(知识库范围) tells later skills what to read |
| Execution | `execution_rules`(执行规则) makes hard constraints explicit |
| Testing | `test_rules`(测试规则) includes success, failure, repair, and evidence |
| Exit | `failure_exit`(失败出口) is actionable |
## Report Shape
Return this structure:
```json
{
"plan_id": "plan_task_001_v1",
"pipeline_type": "new_dsl",
"goal": "为微课设计生产车间新建课程热点编辑生产线。",
"service_target": "微课设计生产车间",
"scope": {
"in_scope": ["生成 AIHub DSL", "输出 DSL 文件说明", "定义结构化热点素材输出"],
"out_of_scope": ["直接写入知识库", "替代人工最终验收"]
},
"input_contract": {
"required_fields": ["task_id", "task_description", "expected_artifact", "acceptance_requirements"],
"missing_field_behavior": "缺必填字段时停止,不进入方案执行。"
},
"output_contract": {
"artifact_name_rule": "XXX新建版本.V1.0",
"required_outputs": ["dsl_file", "dsl_file_description", "version", "test_report"]
},
"knowledge_scope": ["AIHub workflow standards", "similar DSL cases", "test sample rules"],
"execution_rules": ["no_scope_expansion", "no_fabricated_inputs", "dsl_description_required"],
"test_rules": {
"success_criteria": ["DSL 静态校验通过", "AI Hub 可导入打开", "输出符合事务单据要求"],
"failure_criteria": ["结构错误", "导入失败", "输出字段缺失", "缺权限或缺测试输入"],
"required_test_level": "import_open_qa",
"repair_policy": "可修复失败回到方案执行,最多 5 次。",
"max_repair_attempts": 5,
"evidence_required": ["validation_log", "import_result", "test_output_or_failure_reason"]
},
"failure_exit": {
"status": "failed",
"callback_reason": "执行方案缺少必要字段时回填缺失项。"
},
"missing_fields": [],
"plan_risks": [],
"can_execute": true,
"next_step": "execute_plan"
}
```
Use Chinese for explanations and values. Keep field names in English with the Chinese meaning defined above.