workflow
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseWorkflow 编排层
Workflow Orchestration Layer
本 skill 不重复实现底层逻辑,只做发现、选择、串联和聚合。
observejlink:rttjlink:swoopenocd:semihostingopenocd:itmprobe-rs:rttThis skill does not reimplement underlying logic, only handles discovery, selection, chaining, and aggregation.
The phase currently provides candidate backends including , , , , .
observejlink:rttjlink:swoopenocd:semihostingopenocd:itmprobe-rs:rtt命令
Commands
bash
python <skill-dir>/scripts/workflow_plan.py --json
python <skill-dir>/scripts/workflow_run.py plan --json
python <skill-dir>/scripts/workflow_run.py build --json
python <skill-dir>/scripts/workflow_run.py build-flash --json
python <skill-dir>/scripts/workflow_run.py build-debug --json
python <skill-dir>/scripts/workflow_run.py observe --json
python <skill-dir>/scripts/workflow_run.py diagnose --jsonbash
python <skill-dir>/scripts/workflow_plan.py --json
python <skill-dir>/scripts/workflow_run.py plan --json
python <skill-dir>/scripts/workflow_run.py build --json
python <skill-dir>/scripts/workflow_run.py build-flash --json
python <skill-dir>/scripts/workflow_run.py build-debug --json
python <skill-dir>/scripts/workflow_run.py observe --json
python <skill-dir>/scripts/workflow_run.py diagnose --json配置说明
Configuration Instructions
workflow 不再维护独立的工程配置结构,所有工程参数统一从 读取。
.embeddedskills/config.jsonWorkflow no longer maintains an independent project configuration structure; all project parameters are read uniformly from .
.embeddedskills/config.json配置结构
Configuration Structure
.embeddedskills/config.jsonworkflowjson
{
"workflow": {
"preferred_build": "auto",
"preferred_flash": "auto",
"preferred_debug": "auto",
"preferred_observe": "auto"
}
}workflow 通过读取 中其他 skill 的配置段来获取工程参数(如 、、 等)。
.embeddedskills/config.jsonkeil.projectjlink.deviceprobe-rs.chipThe section in only contains preferred backend configurations:
workflow.embeddedskills/config.jsonjson
{
"workflow": {
"preferred_build": "auto",
"preferred_flash": "auto",
"preferred_debug": "auto",
"preferred_observe": "auto"
}
}Workflow obtains project parameters (such as , , , etc.) by reading configuration sections of other skills in .
keil.projectjlink.deviceprobe-rs.chip.embeddedskills/config.json参数解析顺序
Parameter Parsing Order
按以下决策树依次判断,命中即停止:
-
CLI 参数(优先级最高)
- 条件:用户在命令行传入 、
--build-backend等参数--flash-backend - 示例:
workflow_run.py build-flash --build-backend=keil --flash-backend=jlink - 行为:直接使用该参数指定的后端,跳过后续步骤
- 条件:用户在命令行传入
-
配置文件(次优先)
- 条件:CLI 未指定,且 的
.embeddedskills/config.json段中对应workflow字段不为preferred_*"auto" - 示例:→ 使用 keil 作为构建后端
"preferred_build": "keil" - 行为:读取配置值并使用,跳过自动发现
- 条件:CLI 未指定,且
-
自动发现(兜底)
- 条件:CLI 未指定,且配置中 为
preferred_*或字段缺失"auto" - 示例:→ 扫描 workspace 自动推断可用 flash 后端
"preferred_flash": "auto" - 行为:枚举候选后端列表;若唯一则直接使用,若多个则返回列表请用户确认
- 条件:CLI 未指定,且配置中
成功执行后,实际使用的后端会自动写回 的 段。
.embeddedskills/config.jsonworkflowJudge in sequence according to the following decision tree, stop once a match is found:
-
CLI Parameters (highest priority)
- Condition: The user passes parameters like ,
--build-backendvia command line--flash-backend - Example:
workflow_run.py build-flash --build-backend=keil --flash-backend=jlink - Behavior: Directly use the backend specified by the parameter, skip subsequent steps
- Condition: The user passes parameters like
-
Configuration File (second priority)
- Condition: Not specified via CLI, and the corresponding field in the
preferred_*section ofworkflowis not.embeddedskills/config.json"auto" - Example: → Use keil as the build backend
"preferred_build": "keil" - Behavior: Read the configuration value and use it, skip automatic discovery
- Condition: Not specified via CLI, and the corresponding
-
Automatic Discovery (fallback)
- Condition: Not specified via CLI, and in the configuration is
preferred_*or the field is missing"auto" - Example: → Scan the workspace to automatically infer available flash backends
"preferred_flash": "auto" - Behavior: Enumerate the list of candidate backends; if there is only one, use it directly; if there are multiple, return the list for user confirmation
- Condition: Not specified via CLI, and
After successful execution, the actually used backend will be automatically written back to the section of .
workflow.embeddedskills/config.json规则
Rules
- 发现多个工程或多个候选后端时,只返回候选列表,不自动猜测
- 构建、烧录、调试、观测之间优先通过 串联
.embeddedskills/state.json - 只生成推荐命令,不在 workflow 内直接长时间占用观测通道
observe - 失败时优先返回哪个阶段失败,以及底层脚本的结构化错误
- workflow 与其他 Skill 的协同只通过 、
.embeddedskills/config.json和子进程调用底层 Skill.embeddedskills/state.json
- When multiple projects or multiple candidate backends are discovered, only return the candidate list without automatic guessing
- Prioritize connecting build, flash, debug, and observe via
.embeddedskills/state.json - only generates recommended commands, and does not directly occupy the observation channel for a long time within the workflow
observe - When a failure occurs, prioritize returning which phase failed and the structured error of the underlying script
- Collaboration between workflow and other Skills only happens via ,
.embeddedskills/config.json, and subprocess calls to underlying Skills.embeddedskills/state.json