mthds-explain

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Explain MTHDS bundles

解释MTHDS包

Analyze and explain existing MTHDS method bundles in plain language.
用通俗易懂的语言分析并解释现有的MTHDS方法包。

Process

流程

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

步骤0 — CLI检查(必填,首先执行此步骤)

Run
mthds-agent --version
.
  • If it succeeds: proceed to the next step.
  • If it fails or the command is not found: STOP. Do not proceed with this skill. Tell the user:
The
mthds-agent
CLI is required but not installed. Install it with:
npm install -g mthds
Then re-run this skill.
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.
运行
mthds-agent --version
命令。
  • 如果执行成功:进入下一步。
  • 如果执行失败或命令未找到:停止操作。不要继续使用此技能。告知用户:
缺少必需的
mthds-agent
CLI工具,请先安装:
npm install -g mthds
然后重新运行此技能。
请勿手动编写
.mthds
文件,请勿扫描现有方法,请勿执行任何其他操作。CLI工具是验证、格式化和执行所必需的——没有它,输出内容会出现问题。

Step 1: Read the .mthds File

步骤1:读取.mthds文件

Read the entire bundle file to understand its structure.
读取整个包文件以了解其结构。

Step 2: Identify Components

步骤2:识别组件

List all components found in the bundle:
  • Domain: the
    [domain]
    declaration
  • Concepts: all
    [concept.*]
    blocks — note which are custom vs references to native concepts
  • Pipes: all
    [pipe.*]
    blocks — identify the main pipe and sub-pipes
  • Main pipe: declared in
    [bundle]
    section
列出包中所有的组件:
  • 领域(Domain)
    [domain]
    声明
  • 概念(Concepts):所有
    [concept.*]
    块——注意哪些是自定义概念,哪些是对原生概念的引用
  • 管道(Pipes):所有
    [pipe.*]
    块——识别主管道和子管道
  • 主管道:在
    [bundle]
    部分中声明的管道

Step 3: Trace Execution Flow

步骤3:追踪执行流程

Starting from the main pipe, trace the execution path:
  1. For PipeSequence: follow the
    steps
    array in order
  2. For PipeBatch: identify
    batch_over
    and
    batch_as
    , then the inner pipe
  3. For PipeParallel: list all branches
  4. For PipeCondition: map condition → pipe for each branch
  5. For PipeLLM / PipeExtract / PipeImgGen / PipeFunc: these are leaf operations
从主管道开始,追踪执行路径:
  1. 对于PipeSequence:按顺序跟随
    steps
    数组
  2. 对于PipeBatch:识别
    batch_over
    batch_as
    ,然后查看内部管道
  3. 对于PipeParallel:列出所有分支
  4. 对于PipeCondition:为每个分支映射条件→管道
  5. 对于PipeLLM / PipeExtract / PipeImgGen / PipeFunc:这些是叶子操作

Step 4: Present Explanation

步骤4:呈现解释内容

Structure the explanation as:
  1. Purpose: one-sentence summary of what the method does
  2. Inputs: list each input with its concept type and expected content
  3. Output: the final output concept and what it contains
  4. Step-by-step flow: walk through execution in order, explaining what each pipe does
  5. Key concepts: explain any custom concepts defined in the bundle
将解释内容按以下结构组织:
  1. 用途:用一句话总结该方法的作用
  2. 输入:列出每个输入及其概念类型和预期内容
  3. 输出:最终输出的概念及其包含的内容
  4. 分步流程:按顺序逐步讲解执行过程,解释每个管道的作用
  5. 核心概念:解释包中定义的所有自定义概念

Step 5: Generate Flow Diagram

步骤5:生成流程图

Create an ASCII diagram showing the execution flow:
[input_a, input_b]
        |
   main_sequence
   ├── step_one (PipeLLM) → intermediate_result
   └── step_two (PipeExtract) → final_output
Adapt the diagram style to the method structure (linear, branching, batched).
创建一个ASCII流程图展示执行流程:
[input_a, input_b]
        |
   main_sequence
   ├── step_one (PipeLLM) → intermediate_result
   └── step_two (PipeExtract) → final_output
根据方法的结构(线性、分支、批量)调整流程图样式。

Step 6: Optional — Validate

步骤6:可选——验证

If the user wants to confirm the method is valid:
bash
mthds-agent pipelex validate pipe <file>.mthds -L <bundle-dir>/
如果用户想要确认方法是否有效:
bash
mthds-agent pipelex validate pipe <file>.mthds -L <bundle-dir>/

Step 7: Optional — Visual Graph

步骤7:可选——可视化图

For an interactive visual graph, suggest running the method with
/mthds-run
using real inputs:
bash
mthds-agent pipelex run pipe <bundle-dir>/
This produces an interactive HTML visualization (
live_run.html
) next to the bundle alongside the execution results (graph is generated by default).
如需交互式可视化图,建议使用真实输入通过
/mthds-run
运行该方法:
bash
mthds-agent pipelex run pipe <bundle-dir>/
这会在包文件旁生成一个交互式HTML可视化文件(
live_run.html
),同时生成执行结果(默认会生成可视化图)。

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 for concept definitions and syntax
  • Native Content Types — read when explaining what data flows through pipes (e.g., what attributes Page or Image content carries)
  • 错误处理 — 当CLI返回错误时阅读,以确定恢复方案
  • MTHDS Agent指南 — 查阅CLI命令语法或输出格式细节
  • MTHDS语言参考 — 查阅概念定义和语法
  • 原生内容类型 — 当解释管道中流转的数据时阅读(例如,Page或Image内容包含哪些属性)