mthds-edit

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Edit MTHDS bundles

编辑MTHDS包

Modify existing MTHDS method bundles.
修改现有的MTHDS方法包。

Mode Selection

模式选择

How mode is determined

模式判定规则

  1. Explicit override: If the user states a preference, always honor it:
    • Automatic signals: "just do it", "go ahead", "automatic", "quick", "don't ask"
    • Interactive signals: "walk me through", "help me", "guide me", "step by step", "let me decide"
  2. Skill default: Each skill defines its own default based on the nature of the task.
  3. Request analysis: If no explicit signal and no strong skill default, assess the request:
    • Detailed, specific requirements → automatic
    • Brief, ambiguous, or subjective → interactive
  1. 显式指定优先:如果用户明确表达了偏好,始终优先遵循:
    • 自动模式信号:“直接做”、“继续”、“自动”、“快速处理”、“不要询问”
    • 交互模式信号:“带我一步步操作”、“帮我处理”、“引导我”、“逐步操作”、“让我做决定”
  2. 技能默认规则:每个技能会根据任务性质定义自身的默认模式。
  3. 请求分析规则:如果没有显式信号,也没有明确的技能默认规则,就对请求进行评估:
    • 详细、明确的需求 → 自动模式
    • 简短、模糊或主观的需求 → 交互模式

Mode behavior

模式行为

Automatic mode:
  • State assumptions briefly before proceeding
  • Make reasonable decisions at each step
  • Present the result when done
  • Pause only if a critical ambiguity could lead to wasted work
Interactive mode:
  • Ask clarifying questions at the start
  • Present options at decision points
  • Confirm before proceeding at checkpoints
  • Allow the user to steer direction
自动模式:
  • 操作前简要说明假设条件
  • 每一步都做出合理决策
  • 完成后展示结果
  • 仅当存在严重歧义可能导致无效工作时才暂停
交互模式:
  • 开始时询问澄清问题
  • 决策节点提供可选方案
  • 检查点确认后再继续操作
  • 允许用户掌控操作方向

Mode switching

模式切换

  • If in automatic mode and the user asks a question or gives feedback → switch to interactive for the current phase
  • If in interactive mode and the user says "looks good, go ahead" or similar → switch to automatic for remaining phases
Default: Automatic for clear, specific changes. Interactive for ambiguous or multi-step modifications.
Detection heuristics:
  • "Rename X to Y" → automatic
  • "Update the prompt in pipe Z" with new text provided → automatic
  • "Add a step to do X" (open-ended) → interactive
  • "Refactor this pipeline" (subjective) → interactive
  • Multiple changes requested at once → interactive (confirm the plan)

  • 如果处于自动模式时用户提出问题或给出反馈 → 当前阶段切换为交互模式
  • 如果处于交互模式时用户说“没问题,继续”或类似表述 → 剩余阶段切换为自动模式
默认规则:明确具体的修改使用自动模式,模糊或多步骤的修改使用交互模式。
判定启发规则
  • “将X重命名为Y” → 自动模式
  • “更新Z pipe中的prompt”且提供了新文本 → 自动模式
  • “添加一个实现X功能的步骤”(开放式需求) → 交互模式
  • “重构这个pipeline”(主观需求) → 交互模式
  • 一次请求多个修改 → 交互模式(先确认方案)

Process

操作流程

Step 0 — CLI Check (mandatory, do this FIRST)

步骤0 — CLI检查(强制要求,必须最先执行)

Run
mthds-agent --version
. The minimum required version is 0.1.0 (declared in this skill's front matter as
min_mthds_version
).
  • If the command is not found: STOP. Do not proceed. Tell the user:
The
mthds-agent
CLI is required but not installed. Install it with:
npm install -g mthds
Then re-run this skill.
  • If the version is below 0.1.0: STOP. Do not proceed. Tell the user:
This skill requires
mthds-agent
version 0.1.0 or higher (found X.Y.Z). Upgrade with:
npm install -g mthds@latest
Then re-run this skill.
  • If the version is 0.1.0 or higher: proceed to the next step.
Do not write
.mthds
files manually, do not scan for existing methods, do not do any other work. The CLI is required for validation, formatting, and execution — without it the output will be broken.
No backend setup needed: This skill works without configuring inference backends or API keys. You can start building/validating methods right away. Backend configuration is only needed to run methods with live inference — use
/pipelex-setup
when you're ready.
  1. Read the existing .mthds file — Understand current structure before making changes
  2. Understand requested changes:
    • What pipes need to be added, removed, or modified?
    • What concepts need to change?
    • Does the method structure need refactoring?
    Interactive checkpoint: Present a summary of planned changes. Ask "Does this plan look right?" before proceeding to step 3.
    Automatic: Proceed directly to step 3. State planned changes in one line.
  3. Apply changes:
    • Maintain proper pipe ordering (controllers before sub-pipes)
    • Keep TOML formatting consistent
    • Preserve cross-references between pipes
    • Keep inputs on a single line
    • Maintain POSIX standard (empty line at end, no trailing whitespace)
  4. Validate after editing:
    bash
    mthds-agent pipelex validate pipe <file>.mthds -L <bundle-dir>/
    If errors, see Error Handling Reference for recovery strategies by error domain. Use /mthds-fix skill for automatic error resolution.
  5. Regenerate inputs if needed:
    • If inputs changed, run
      mthds-agent pipelex inputs pipe <file>.mthds -L <bundle-dir>/
    • Update existing inputs.json if present
  6. Present completion:
    • If inputs were regenerated (step 5 triggered), show the path to the updated file.
    • Provide a concrete CLI example. If
      inputs.json
      contains placeholder values, suggest the safe dry-run command first:
      To try the updated method now, use /mthds-run or from the terminal:
      mthds run pipe <bundle-dir>/ --dry-run --mock-inputs
      To run with real data, use /mthds-inputs to prepare your inputs (provide your own files, or generate synthetic test data), then:
      mthds run pipe <bundle-dir>/
运行
mthds-agent --version
。最低要求版本为0.1.0(在本技能的前置信息中声明为
min_mthds_version
)。
  • 如果找不到该命令:停止操作,不要继续。告知用户:
需要使用
mthds-agent
CLI,但尚未安装。可通过以下命令安装:
npm install -g mthds
安装完成后重新运行本技能。
  • 如果版本低于0.1.0:停止操作,不要继续。告知用户:
本技能要求
mthds-agent
版本为0.1.0或更高(当前版本为X.Y.Z)。可通过以下命令升级:
npm install -g mthds@latest
升级完成后重新运行本技能。
  • 如果版本为0.1.0或更高:继续执行下一步。
不要手动编写
.mthds
文件,不要扫描现有方法,不要进行任何其他操作。需要CLI来完成验证、格式化和执行,没有CLI的话输出内容会出现问题。
无需后端配置:本技能无需配置推理后端或API密钥,你可以立即开始构建/验证方法。只有在需要使用实时推理运行方法时才需要配置后端,准备就绪后使用
/pipelex-setup
即可。
  1. 读取现有.mthds文件 — 做出修改前先理解当前结构
  2. 明确需求的修改内容
    • 哪些pipe需要添加、删除或修改?
    • 哪些概念需要变更?
    • 方法结构是否需要重构?
    交互模式检查点:展示计划修改的摘要,继续执行步骤3前先询问“该方案是否正确?”
    自动模式:直接进入步骤3,用一句话说明计划的修改内容。
  3. 执行修改
    • 保持正确的pipe顺序(控制器优先于子pipe)
    • 保持TOML格式一致
    • 保留pipe之间的交叉引用
    • 输入内容保持单行
    • 符合POSIX标准(末尾空行,无尾随空格)
  4. 编辑后验证
    bash
    mthds-agent pipelex validate pipe <file>.mthds -L <bundle-dir>/
    如果出现错误,查看错误处理参考获取不同错误域的恢复方案,使用
    /mthds-fix
    技能自动解决错误。
  5. 按需重新生成输入
    • 如果输入发生了变更,运行
      mthds-agent pipelex inputs pipe <file>.mthds -L <bundle-dir>/
    • 如果存在现有inputs.json则更新该文件
  6. 展示完成结果
    • 如果重新生成了输入(触发了步骤5),展示更新后文件的路径。
    • 提供具体的CLI示例。如果
      inputs.json
      包含占位符值,建议优先使用安全的试运行命令:
      要立即尝试更新后的方法,可使用
      /mthds-run
      或在终端执行:
      mthds run pipe <bundle-dir>/ --dry-run --mock-inputs
      要使用真实数据运行,可使用
      /mthds-inputs
      准备输入(提供你自己的文件,或生成合成测试数据),然后执行:
      mthds run pipe <bundle-dir>/

Common Edit Operations

常见编辑操作

  • Add a pipe: Define concept if needed, add pipe in correct order
  • Modify a prompt: Update prompt text, check variable references
  • Change inputs/outputs: Update type, regenerate inputs
  • Add batch processing: Add
    batch_over
    (plural list name) and
    batch_as
    (singular item name) to step — they must be different
  • Refactor to sequence: Wrap multiple pipes in PipeSequence
  • 添加pipe:按需定义概念,按正确顺序添加pipe
  • 修改prompt:更新prompt文本,检查变量引用
  • 修改输入/输出:更新类型,重新生成输入
  • 添加批处理:给步骤添加
    batch_over
    (复数列表名称)和
    batch_as
    (单数项目名称)属性,两者取值必须不同
  • 重构为序列:将多个pipe封装到PipeSequence中

Reference

参考文档

  • Error Handling — read when CLI returns an error to determine recovery
  • MTHDS Agent Guide — read for CLI command syntax or output format details
  • MTHDS Language Reference — read when writing or modifying .mthds TOML syntax
  • Native Content Types — read when using
    $var.field
    in prompts or
    from
    in construct blocks, to know which attributes each native concept exposes
  • Talents & Presets — read when setting or changing the
    model
    field in a pipe, to find the correct preset name
  • 错误处理 — CLI返回错误时阅读,确定恢复方案
  • MTHDS Agent指南 — 阅读了解CLI命令语法或输出格式详情
  • MTHDS语言参考 — 编写或修改.mthds TOML语法时阅读
  • 原生内容类型 — 在prompt中使用
    $var.field
    或在构造块中使用
    from
    时阅读,了解每个原生概念暴露的属性
  • 能力与预设 — 设置或修改pipe中的
    model
    字段时阅读,查找正确的预设名称