AI生产线自动化搭建资料库
资料页面

流程选择 skill

来源:/Users/ljn/.codex/skills/pipeline-selector/SKILL.md

流程选择 skill

一句话说明:只负责判断事务单据应该进入哪条 pipeline:新建 DSL、迭代 DSL、其他或阻塞。

在项目里的位置:项目经理 Agent 在拿到事务单据后,先调用这个 skill 做流程选择。它不补需求、不生成方案、不写 DSL,也不做测试。

什么时候调用

  • 收到结构化事务单据后,需要判断任务类型。
  • 需要说明为什么进入某条 pipeline。
  • 需要列出缺失字段或冲突字段。

不能做什么

  • 不生成执行方案。
  • 不创建、修改、修复或测试 DSL。
  • 不替业务方补齐缺失字段。

输入字段

英文字段中文名称说明
task_package事务单据结构化任务来源。
classification_rules流程选择规则新建、迭代、其他、阻塞的判断规则。
project_context项目背景业务边界、服务对象等可选上下文。
known_dsl_refs已知 DSL 引用旧 DSL、旧版本或已有生产线线索。
rule_context规则上下文只读、命名、回填等全局规则。

输出字段

英文字段中文名称说明
pipeline_typePipeline 类型new_dsl、iterate_dsl、other、blocked。
decision_reason判断原因用人能看懂的话说明为什么这样分。
matched_rules命中规则本次分类依据。
missing_fields缺失字段缺什么字段;没有就为空数组。
conflict_fields冲突字段哪些信息互相冲突;没有就为空数组。
can_continue是否继续能否进入方案确认。
next_step下一步confirm_plan 或 callback_blocked_reason。

执行流程

  • 先看目标、期望产物、验收要求是否可理解。
  • 再判断是否从 0 新建 DSL。
  • 再判断是否基于旧 DSL 做迭代。
  • 如果只是分析、整理、咨询、关闭或转交,进入其他。
  • 如果关键字段缺失,进入阻塞。

成功标准

  • 分类值合法。
  • 判断原因清楚。
  • 缺失字段和冲突字段都明确输出。
  • 是否继续与分类结果一致。

失败标准

  • 目标不可读。
  • 期望产物缺失。
  • 验收要求缺失。
  • 回填字段缺失。
  • 迭代任务缺少变更要求。
查看原始 SKILL.md
---
name: pipeline-selector
description: "Classify structured automation task packages into the correct project pipeline: new_dsl, iterate_dsl, other, or blocked. Use when Codex or a project manager Agent needs the 流程选择 skill to inspect a task package, explain the classification reason, list missing or conflicting fields, and decide whether the task can continue to方案确认."
---

# Pipeline Selector

## Role

Use this skill as the流程选择 skill. It only decides which pipeline a structured task package should enter.

It must not confirm a plan, generate DSL, edit DSL, test DSL, repair DSL, or write callback results.

```text
任务获取 -> 项目经理 Agent -> pipeline-selector -> 方案确认
```

## Pipeline Options

| Pipeline | 中文名称 | Meaning |
|---|---|---|
| `new_dsl` | 新建 DSL | Create a new workflow, bot, DSL, production line, or production workshop from zero |
| `iterate_dsl` | 迭代 DSL | Create a new version based on an existing DSL, existing production line, or old version |
| `other` | 其他 | Analyze, judge, organize, transfer, close, or handle a non-DSL-building task |
| `blocked` | 阻塞 | Critical fields are missing, so the task cannot safely continue |

## Non-Negotiable Rules

1. Only classify. Do not补需求, do not generate an execution plan, and do not create or modify DSL.
2. Treat the structured task package as the only task source.
3. If the task lacks a readable goal, expected artifact, or acceptance requirement, return `blocked`(阻塞).
4. If the task has complete fields but cannot be confidently classified, return `other`(其他) and explain why.
5. If the task says optimization or adjustment but lacks an old DSL, classify as `new_dsl`(新建 DSL) and let方案确认 explain that this is a new version.
6. If the task includes an old DSL or old version plus clear change requirements, prefer `iterate_dsl`(迭代 DSL).
7. Never classify a task as successful without `decision_reason`(判断原因) and `matched_rules`(命中规则).
8. Output every required field. Missing output fields are a skill failure.

## Inputs

| Field | 中文名称 | Required | Description |
|---|---|---|---|
| `task_package` | 事务单据 | Yes | Structured task package from the task intake node |
| `project_context` | 项目背景 | Optional | Project background, service object, business boundary, or project source |
| `known_dsl_refs` | 已知 DSL 引用 | Optional | Existing DSL URI, old version, app ID, production line name, or old artifact notes |
| `classification_rules` | 流程选择规则 | Yes | Current project rules for new DSL, iterate DSL, other, and blocked |
| `rule_context` | 规则上下文 | Optional | Global constraints such as original DSL read-only, version naming, and callback status |

## Required Task Fields

| Field | 中文名称 | Required | Used for |
|---|---|---|---|
| `task_id` | 事务单据 ID | Yes | Trace and callback |
| `task_title` | 任务标题 | Yes | Intent signal |
| `task_description` | 任务描述 | Yes | Main classification evidence |
| `expected_artifact` | 期望产物 | Yes | Decide whether DSL is expected |
| `acceptance_requirements` | 验收要求 | Yes | Decide whether the task can continue |
| `service_target` | 服务对象 | Optional | Helps distinguish real DSL work from vague discussion |
| `existing_dsl_uri` | 原 DSL 地址 | Required for iteration | Strong evidence for iteration |
| `current_version` | 当前版本 | Required for iteration | Old version evidence |
| `change_request` | 变更要求 | Required for iteration | Iteration intent |
| `callback_fields` | 回填字段 | Yes | Required for closed-loop execution |

## Outputs

| Field | 中文名称 | Required | Description |
|---|---|---|---|
| `pipeline_type` | Pipeline 类型 | Yes | One of `new_dsl`(新建 DSL), `iterate_dsl`(迭代 DSL), `other`(其他), `blocked`(阻塞) |
| `decision_reason` | 判断原因 | Yes | Plain-language explanation that a project owner can review |
| `matched_rules` | 命中规则 | Yes | Rule IDs or rule names that led to the decision |
| `missing_fields` | 缺失字段 | Yes | Missing required fields; use an empty array when none |
| `conflict_fields` | 冲突字段 | Yes | Conflicting fields or signals; use an empty array when none |
| `confidence_level` | 置信等级 | Yes | `high`(高), `medium`(中), or `low`(低) |
| `can_continue` | 是否继续 | Yes | True only when the task can enter方案确认 |
| `next_step` | 下一步 | Yes | `confirm_plan`(进入方案确认) or `callback_blocked_reason`(回填阻塞原因) |
| `review_notes` | 复核说明 | Yes | Notes for the project manager Agent and AI project owner |

## Decision Order

Follow this order exactly:

| Step | Check | Result |
|---|---|---|
| 1 | Can the task goal, expected artifact, and acceptance requirement be understood? | If no, return `blocked`(阻塞) |
| 2 | Does the task clearly ask to create a new workflow, bot, DSL, production line, or production workshop from zero? | If yes and no old DSL dependency exists, return `new_dsl`(新建 DSL) |
| 3 | Does the task clearly depend on an existing DSL, old production line, old app, or old version and include a change request? | If yes, return `iterate_dsl`(迭代 DSL) |
| 4 | Does the task only ask for analysis, consultation, documentation, field checking, discussion, transfer, closing, or pure testing? | If yes, return `other`(其他) |
| 5 | Are classification signals complete but mixed or unstable? | Return `other`(其他) with conflict explanation |
| 6 | Are critical fields missing? | Return `blocked`(阻塞) with missing fields |

## Classification Rules

| Target | Required evidence | Must not require |
|---|---|---|
| `new_dsl`(新建 DSL) | New capability goal, expected output, service object or usage scenario, no required old DSL dependency | Old DSL URI |
| `iterate_dsl`(迭代 DSL) | Existing DSL/app/version evidence plus clear change request | Direct modification of original DSL |
| `other`(其他) | Task does not require creating or iterating DSL, or classification signals are complete but mixed | DSL generation |
| `blocked`(阻塞) | Missing goal, expected artifact, acceptance requirements, callback fields, or other critical fields | Guessing or补字段 |

## Conflict Handling

| Situation | Decision |
|---|---|
| Task says "new" but gives old DSL plus change request | Prefer `iterate_dsl`(迭代 DSL) and explain the old DSL evidence |
| Task says "optimize/adjust" but gives no old DSL or old version | Return `new_dsl`(新建 DSL) and note that方案确认 should treat it as a new version |
| Task says "build an AI workflow" but lacks goal and output | Return `blocked`(阻塞) with missing business goal, service object, and output requirement |
| Task asks for analysis, field organization, or scheme discussion | Return `other`(其他) and state no DSL should be generated |
| Task has complete fields but classification remains hard to explain | Return `other`(其他) and record conflict fields |
| Task has old DSL but no change request | Return `blocked`(阻塞) because iteration cannot be scoped |

## Success Criteria

The skill succeeds only when:

| Item | Standard |
|---|---|
| Classification | `pipeline_type`(Pipeline 类型) is one of the four allowed values |
| Explanation | `decision_reason`(判断原因) is understandable to a non-technical owner |
| Evidence | `matched_rules`(命中规则) names the decisive evidence |
| Completeness | `missing_fields`(缺失字段) and `conflict_fields`(冲突字段) are present even when empty |
| Continuation | `can_continue`(是否继续) matches the selected pipeline and field completeness |

## Failure Criteria

Return `blocked`(阻塞) when:

| Failure | Output requirement |
|---|---|
| Goal is unreadable | Add `task_description`(任务描述) or business goal to `missing_fields`(缺失字段) |
| Expected artifact is missing | Add `expected_artifact`(期望产物) to `missing_fields`(缺失字段) |
| Acceptance requirements are missing | Add `acceptance_requirements`(验收要求) to `missing_fields`(缺失字段) |
| Callback fields are missing | Add `callback_fields`(回填字段) to `missing_fields`(缺失字段) |
| Iteration lacks change request | Add `change_request`(变更要求) to `missing_fields`(缺失字段) |

## Report Shape

Return this structure:

```json
{
  "pipeline_type": "new_dsl",
  "decision_reason": "任务要求从 0 新建一个课程热点编辑生产线,并输出 DSL 文件。",
  "matched_rules": ["new_capability_goal", "expected_dsl_artifact", "no_old_dsl_dependency"],
  "missing_fields": [],
  "conflict_fields": [],
  "confidence_level": "high",
  "can_continue": true,
  "next_step": "confirm_plan",
  "review_notes": "进入方案确认,需补齐执行方案、输入输出约定和测试标准。"
}
```

Use Chinese for explanations and notes. Keep field names in English with the Chinese meaning defined above.