mthds-build
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseBuild AI Method using the MTHDS standard (Agentic)
使用MTHDS标准构建AI方法(Agentic模式)
Create new MTHDS bundles through an adaptive, phase-based approach. This skill guides you through drafting (markdown), structuring (CLI/JSON), and assembling complete .mthds bundles.
通过自适应的分阶段方法创建新的MTHDS捆绑包。本技能将引导你完成草稿撰写(markdown)、结构化处理(CLI/JSON)以及完整.mthds捆绑包的组装流程。
Philosophy
设计理念
- Drafting phases: Generate human-readable markdown documents
- Structuring phases: Use agent CLI commands for JSON-to-TOML conversion
- Visualization: Present ASCII graphs at overview and detail levels
- Iterative: Refine at each phase before proceeding
- 起草阶段:生成人类可读的markdown文档
- 结构化阶段:使用Agent CLI命令完成JSON到TOML的转换
- 可视化:在概览和细节层面展示ASCII图表
- 迭代式:在进入下一阶段前,对当前阶段内容进行优化
Mode Selection
模式选择
How mode is determined
模式判定方式
-
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"
-
Skill default: Each skill defines its own default based on the nature of the task.
-
Request analysis: If no explicit signal and no strong skill default, assess the request:
- Detailed, specific requirements → automatic
- Brief, ambiguous, or subjective → interactive
-
显式覆盖:如果用户明确指定偏好,始终遵循用户选择:
- 自动模式信号:“直接做”“继续”“自动”“快速”“别问了”
- 交互模式信号:“带我一步步来”“帮帮我”“引导我”“分步进行”“让我决定”
-
技能默认值:每个技能会根据任务性质定义自己的默认模式。
-
请求分析:如果没有显式信号且无明确技能默认值,则评估用户请求:
- 详细、具体的需求 → 自动模式
- 简短、模糊或主观的需求 → 交互模式
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 simple-to-moderate methods. Interactive for complex multi-step methods or when the user's request is ambiguous.
Detection heuristics:
- User provides a clear one-sentence goal → automatic
- User describes a complex multi-step process → interactive
- User mentions batching, conditions, or parallel execution → interactive
- User says "create a pipeline for X" with no elaboration → automatic
- 如果处于自动模式,且用户提出问题或给出反馈 → 当前阶段切换为交互模式
- 如果处于交互模式,且用户说“看起来不错,继续”或类似话语 → 剩余阶段切换为自动模式
默认设置:简单到中等复杂度的方法使用自动模式。复杂的多步骤方法或用户请求模糊时使用交互模式。
检测规则:
- 用户提供清晰的单句目标 → 自动模式
- 用户描述复杂的多步骤流程 → 交互模式
- 用户提及批量处理、条件判断或并行执行 → 交互模式
- 用户仅说“为X创建流水线”且无其他说明 → 自动模式
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:
TheCLI is required but not installed. Install it with:mthds-agentnpm install -g mthdsThen re-run this skill.
Do not write 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运行 。
mthds-agent --version- 如果执行成功:进入下一步。
- 如果执行失败或未找到该命令:停止操作。不要继续使用本技能。告知用户:
必需的CLI未安装。请使用以下命令安装:mthds-agentnpm install -g mthds然后重新运行本技能。
请勿手动编写.mthds文件,请勿扫描现有方法,请勿进行其他任何操作。CLI是验证、格式化和执行的必需工具 —— 没有它,输出内容将无法正常工作。
Existing Method Detection
现有方法检测
Goal: Before starting a new build, check whether the project already contains methods that overlap with the user's request.
When to check: Always, before entering automatic or interactive mode — with these exceptions:
- Skip entirely if the user's request signals intent to create something new. This includes phrases like "new method", "a new method", "brand new", "from scratch", "create a method", or similar.
- Targeted search if the user references a specific existing method by name or path, search specifically for that method instead of scanning broadly. If the specific method cannot be found, fall back to the general search approach below.
For the general case, scan and any other directories containing files in the project.
mthds-wip/.mthdsHow to check:
- List all files in the project (glob for
.mthds)**/*.mthds - For each file found, read the file header (domain, main pipe code, description) to understand what it does
- Compare with the user's current request — look for overlap in topic, domain, or purpose
If no existing methods overlap: Proceed normally with the build.
If one or more existing methods overlap, present the user with three options:
I found an existing method that seems related to what you're asking for:
— <brief description of what it does><path/to/bundle.mthds>How would you like to proceed?
- Start fresh — Create a wholly new method from scratch (ignoring the existing one)
- Use the existing method — It already does what you need; cancel this build
- Build upon it — Extend the existing method by adding pipes before or after the current flow
Handling each choice:
- Start fresh: Proceed with the build as normal (automatic or interactive path below).
- Use the existing method: End the build. Remind the user they can run it with and point them to its
/mthds-runif available.inputs.json - Build upon it: Switch to the /mthds-edit skill, framing the task as an extension — ask the user what additional processing they want to add (e.g., a preprocessing step before the main pipe, a postprocessing step after, or additional parallel branches). Pass the existing file path to the edit workflow.
.mthds
目标:在开始构建新方法前,检查项目中是否已存在与用户请求重叠的方法。
检查时机:在进入自动或交互模式前,始终执行检查 —— 以下情况除外:
- 完全跳过:如果用户的请求明确表示要创建新内容,包括“新方法”“一个新方法”“全新的”“从零开始”“创建方法”等类似表述。
- 定向搜索:如果用户引用了特定的现有方法名称或路径,则专门搜索该方法,而非广泛扫描。如果未找到该特定方法,则回退到下面的通用搜索方法。
对于通用情况,扫描项目中的目录以及其他包含.mthds文件的目录。
mthds-wip/检查方法:
- 列出项目中所有.mthds文件(使用全局匹配)
**/*.mthds - 对于找到的每个文件,读取文件头(领域、主管道代码、描述)以了解其功能
- 与用户当前请求进行比较 —— 查找主题、领域或用途上的重叠
如果无重叠的现有方法:正常进行构建流程。
如果存在一个或多个重叠的现有方法,向用户提供三个选项:
我发现一个与你的请求相关的现有方法:
—— <该方法功能的简要描述><path/to/bundle.mthds>你希望如何继续?
- 重新开始 —— 从零开始创建一个全新的方法(忽略现有方法)
- 使用现有方法 —— 它已经能满足你的需求;取消本次构建
- 基于现有方法扩展 —— 通过在当前流程前后添加管道来扩展现有方法
各选项处理方式:
- 重新开始:正常进行构建流程(如下方的自动或交互路径)。
- 使用现有方法:结束构建。提醒用户可以使用运行该方法,并指向其可用的
/mthds-run文件。inputs.json - 基于现有方法扩展:切换到/mthds-edit技能,将任务定义为扩展 —— 询问用户想要添加哪些额外处理(例如,主管道之前的预处理步骤、之后的后处理步骤,或额外的并行分支)。将现有.mthds文件路径传递给编辑工作流。
Phase 1: Understand Requirements
阶段1:理解需求
Goal: Gather complete information before planning.
Ask the user:
- What are the method's inputs? (documents, images, text, structured data)
- What outputs should it produce?
- What transformations are needed?
- Are there conditional branches or parallel operations?
- Should items be processed in batches?
Output: Requirements summary (keep in context)
目标:在规划前收集完整信息。
询问用户:
- 方法的输入是什么?(文档、图片、文本、结构化数据)
- 应该生成什么输出?
- 需要进行哪些转换?
- 是否存在条件分支或并行操作?
- 是否需要批量处理项目?
输出:需求摘要(保留在上下文中)
Phase 2: Draft the Plan
阶段2:起草计划
Goal: Create a pseudo-code narrative of the method.
Draft a plan in markdown that describes:
- The overall flow from inputs to outputs
- Each processing step with its purpose
- Variable names (snake_case) for inputs and outputs of each step
- Where structured data or lists are involved
Rules:
- Name variables consistently across steps
- Use plural names for lists (e.g., ), singular for items (e.g.,
documents)document - Don't detail types yet - focus on the flow
Show ASCII Overview — see Manual Build Phases for the diagram template.
Output: Plan draft (markdown)
目标:创建方法的伪代码式叙述文档。
用markdown起草一份计划,描述:
- 从输入到输出的整体流程
- 每个处理步骤及其目的
- 每个步骤输入和输出的变量名(使用snake_case格式)
- 涉及结构化数据或列表的位置
规则:
- 在所有步骤中保持变量命名一致
- 列表使用复数名称(例如),单个项目使用单数名称(例如
documents)document - 暂时不详细说明类型 - 重点关注流程
展示ASCII概览图 —— 参考手动构建阶段中的图表模板。
输出:计划草稿(markdown格式)
Phase 3: Draft Concepts
阶段3:起草概念定义
Goal: Identify all data types needed in the method.
From the plan, identify input, intermediate, and output concepts.
For each concept, draft:
- Name: PascalCase, singular noun (e.g., not
Invoice)Invoices - Description: What it represents
- Type: Either OR
refines: NativeConceptstructure: {...}
Native concepts (built-in, do NOT redefine): , , , , , , , , , , . See MTHDS Language Reference — Native Concepts
TextHtmlImageDocumentNumberPageTextAndImagesImgGenPromptJSONAnythingDynamicNote:is the native concept for any document (PDF, Word, etc.).Documentis for any image format (JPEG, PNG, etc.). File formats like "PDF" or "JPEG" are not concepts.Image
Each native concept has accessible attributes (e.g., has , , , ...; has , , ...; has and ). See Native Content Types for the full attribute reference — essential for prompts and blocks.
Imageurlpublic_urlfilenamecaptionDocumenturlpublic_urlfilenamePagetext_and_imagespage_view$var.fieldconstructConcept naming rules:
- No adjectives: not
ArticleLongArticle - No circumstances: not
ArgumentCounterArgument - Always singular: not
EmployeeEmployees
Output: Concepts draft (markdown)
目标:识别方法中需要的所有数据类型。
从计划中识别输入、中间和输出概念。
为每个概念起草:
- 名称:PascalCase格式,单数名词(例如而非
Invoice)Invoices - 描述:它代表的内容
- 类型:要么是,要么是
refines: NativeConceptstructure: {...}
原生概念(内置,请勿重新定义):, , , , , , , , , , 。参考MTHDS语言参考——原生概念
TextHtmlImageDocumentNumberPageTextAndImagesImgGenPromptJSONAnythingDynamic注意:是所有文档(PDF、Word等)的原生概念。Document适用于所有图像格式(JPEG、PNG等)。像“PDF”或“JPEG”这样的文件格式不属于概念。Image
每个原生概念都有可访问的属性(例如有、、、...;有、、...;有和)。参考原生内容类型获取完整的属性参考 —— 这对提示和块至关重要。
Imageurlpublic_urlfilenamecaptionDocumenturlpublic_urlfilenamePagetext_and_imagespage_view$var.fieldconstruct概念命名规则:
- 不使用形容词:而非
ArticleLongArticle - 不包含场景:而非
ArgumentCounterArgument - 始终使用单数:而非
EmployeeEmployees
输出:概念定义草稿(markdown格式)
Phase 4: Structure Concepts
阶段4:结构化概念定义
Goal: Convert concept drafts to validated TOML using the CLI.
Prepare JSON specs for all concepts, then convert them in parallel by making multiple concurrent tool calls.
Example (3 concepts converted in parallel):
bash
undefined目标:使用CLI将概念定义草稿转换为经过验证的TOML格式。
为所有概念准备JSON规格,然后通过并发调用多个工具并行转换。
示例(并行转换3个概念):
bash
undefinedCall all three in parallel (single response, multiple tool calls):
并行调用这三个命令(单次响应,多个工具调用):
mthds-agent pipelex concept --spec '{"the_concept_code": "Invoice", "description": "A commercial invoice document", "structure": {"invoice_number": "The unique identifier", "vendor_name": {"type": "text", "description": "Vendor name", "required": true}, "total_amount": {"type": "number", "description": "Total amount", "required": true}}}'
mthds-agent pipelex concept --spec '{"the_concept_code": "LineItem", "description": "A single line item on an invoice", "structure": {"description": "Item description", "quantity": {"type": "integer", "required": true}, "unit_price": {"type": "number", "required": true}}}'
mthds-agent pipelex concept --spec '{"the_concept_code": "Summary", "description": "A text summary of content", "refines": "Text"}'
**Field types**: `text`, `integer`, `boolean`, `number`, `date`, `concept`, `list`
**Choices (enum-like constrained values)**:
```toml
status = {choices = ["pending", "processing", "completed"], description = "Order status", required = true}
score = {type = "number", choices = ["0", "0.5", "1", "1.5", "2"], description = "Score on a half-point scale"}When is present, defaults to if omitted. You can also pair choices with or types explicitly.
choicestypetextintegernumberNested concept references in structures:
toml
field = {type = "concept", concept_ref = "my_domain.OtherConcept", description = "...", required = true}
items = {type = "list", item_type = "concept", item_concept_ref = "my_domain.OtherConcept", description = "..."}Output: Validated concept TOML fragments
Partial failures: If some commands fail, fix the failing specs using the error JSON (means the spec is wrong). Re-run only the failed commands.error_domain: "input"
mthds-agent pipelex concept --spec '{"the_concept_code": "Invoice", "description": "A commercial invoice document", "structure": {"invoice_number": "The unique identifier", "vendor_name": {"type": "text", "description": "Vendor name", "required": true}, "total_amount": {"type": "number", "description": "Total amount", "required": true}}}'
mthds-agent pipelex concept --spec '{"the_concept_code": "LineItem", "description": "A single line item on an invoice", "structure": {"description": "Item description", "quantity": {"type": "integer", "required": true}, "unit_price": {"type": "number", "required": true}}}'
mthds-agent pipelex concept --spec '{"the_concept_code": "Summary", "description": "A text summary of content", "refines": "Text"}'
**字段类型**:`text`, `integer`, `boolean`, `number`, `date`, `concept`, `list`
**可选值(类似枚举的约束值)**:
```toml
status = {choices = ["pending", "processing", "completed"], description = "Order status", required = true}
score = {type = "number", choices = ["0", "0.5", "1", "1.5", "2"], description = "Score on a half-point scale"}当存在时,如果省略,则默认值为。你也可以显式地将可选值与或类型配对使用。
choicestypetextintegernumber结构中的嵌套概念引用:
toml
field = {type = "concept", concept_ref = "my_domain.OtherConcept", description = "...", required = true}
items = {type = "list", item_type = "concept", item_concept_ref = "my_domain.OtherConcept", description = "..."}输出:经过验证的概念TOML片段
部分失败处理:如果某些命令失败,使用错误JSON修复失败的规格(表示规格有误)。仅重新运行失败的命令。error_domain: "input"
Phase 5: Draft the Flow
阶段5:起草流程定义
Goal: Design the complete pipeline structure with controller selection.
目标:设计完整的流水线结构并选择控制器。
Controller Selection Guide
控制器选择指南
| Controller | Use When | Key Pattern |
|---|---|---|
| PipeSequence | Steps must execute in order | step1 → step2 → step3 |
| PipeBatch | Same operation on each list item | map(items, transform) |
| PipeParallel | Independent operations run together | fork → join |
| PipeCondition | Route based on data values | if-then-else |
| 控制器 | 使用场景 | 核心模式 |
|---|---|---|
| PipeSequence | 步骤必须按顺序执行 | step1 → step2 → step3 |
| PipeBatch | 对列表中的每个项目执行相同操作 | map(items, transform) |
| PipeParallel | 独立操作同时运行 | fork → join |
| PipeCondition | 根据数据值路由 | if-then-else |
Operator Selection Guide
操作符选择指南
| Operator | Use When |
|---|---|
| PipeLLM | Generate text or structured objects with AI |
| PipeExtract | Extract content from PDF/Image → Page[] |
| PipeCompose | Template text or construct objects |
| PipeImgGen | Generate images from text prompts |
| PipeFunc | Custom Python logic |
Note:outputs from PipeExtract automatically convert to text when inserted into prompts usingPage[].@variable
Show detailed ASCII flow — see Manual Build Phases for all controller flow diagrams.
Output: Flow draft with pipe contracts (markdown)
| 操作符 | 使用场景 |
|---|---|
| PipeLLM | 使用AI生成文本或结构化对象 |
| PipeExtract | 从PDF/Image提取内容 → Page[] |
| PipeCompose | 模板化文本或构造对象 |
| PipeImgGen | 根据文本提示生成图片 |
| PipeFunc | 自定义Python逻辑 |
注意:PipeExtract输出的在使用Page[]插入到提示中时会自动转换为文本。@variable
展示详细ASCII流程图 —— 参考手动构建阶段中的所有控制器流程图。
输出:带有管道契约的流程草稿(markdown格式)
Phase 6: Review & Refine
阶段6:审核与优化
Goal: Validate consistency before structuring.
Check:
- Main pipe is clearly identified and handles method inputs
- Variable names are consistent across all pipes
- Input/output types match between connected pipes
- PipeBatch branches receive singular items, not lists
- PipeBatch: (singular) differs from
input_item_name(plural) and allinput_list_namekeysinputs - PipeSequence batch steps: (singular) differs from
batch_as(plural)batch_over - PipeImgGen inputs are text (add PipeLLM if needed to generate prompt)
- No circular dependencies
Confirm with user before proceeding to structuring.
目标:在结构化前验证一致性。
检查:
- 主管道已明确标识并处理方法输入
- 所有管道的变量名称保持一致
- 相连管道之间的输入/输出类型匹配
- PipeBatch分支接收单个项目,而非列表
- PipeBatch:(单数)与
input_item_name(复数)及所有input_list_name键不同inputs - PipeSequence批量步骤:(单数)与
batch_as(复数)不同batch_over - PipeImgGen的输入是文本(如果需要生成提示,可添加PipeLLM)
- 无循环依赖
在进入结构化阶段前与用户确认。
Phase 7: Structure Pipes
阶段7:结构化管道定义
Goal: Convert pipe drafts to validated TOML using the CLI.
Default to talent names from Talents and Presets. Only look up specific model presets when the user has explicit instructions about model choice. In all cases, verify that referenced presets exist:
bash
mthds-agent pipelex models --type llm # when structuring PipeLLM pipes
mthds-agent pipelex models --type extract # when structuring PipeExtract pipes
mthds-agent pipelex models --type img_gen # when structuring PipeImgGen pipesPrepare JSON specs for all pipes, then convert them in parallel by making multiple concurrent tool calls.
For detailed CLI examples for each pipe type (PipeLLM, PipeSequence, PipeBatch, PipeCondition, PipeCompose, PipeParallel, PipeExtract, PipeImgGen), see Manual Build Phases.
Output: Validated pipe TOML fragments
Partial failures: Fix failing specs using the error JSON. Re-run only the failed commands.
目标:使用CLI将管道草稿转换为经过验证的TOML格式。
默认使用模型预设与技能集中的技能集名称。仅当用户对模型选择有明确要求时,才查找特定的模型预设。在所有情况下,验证引用的预设是否存在:
bash
mthds-agent pipelex models --type llm # 结构化PipeLLM管道时使用
mthds-agent pipelex models --type extract # 结构化PipeExtract管道时使用
mthds-agent pipelex models --type img_gen # 结构化PipeImgGen管道时使用为所有管道准备JSON规格,然后通过并发调用多个工具并行转换。
关于每种管道类型(PipeLLM、PipeSequence、PipeBatch、PipeCondition、PipeCompose、PipeParallel、PipeExtract、PipeImgGen)的详细CLI示例,参考手动构建阶段。
输出:经过验证的管道TOML片段
部分失败处理:使用错误JSON修复失败的规格。仅重新运行失败的命令。
Phase 8: Assemble Bundle
阶段8:组装捆绑包
Goal: Combine all parts into a complete .mthds file.
Save location: Always save method bundles to . Do not ask the user for the save location.
mthds-wip/For the assemble CLI command and direct .mthds writing examples, see Manual Build Phases.
目标:将所有部分组合成完整的.mthds文件。
保存位置:始终将方法捆绑包保存到。请勿询问用户保存位置。
mthds-wip/关于组装CLI命令和直接编写.mthds文件的示例,参考手动构建阶段。
Phase 9: Validate & Test
阶段9:验证与测试
Goal: Ensure the bundle is valid and works correctly.
Always use pointing to the bundle's own directory to avoid namespace collisions with other bundles in the project.
-Lbash
undefined目标:确保捆绑包有效且能正常工作。
始终使用指向捆绑包自身的目录,以避免与项目中其他捆绑包的命名空间冲突。
-Lbash
undefinedValidate (isolated from other bundles)
验证(与其他捆绑包隔离)
mthds-agent pipelex validate pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/
mthds-agent pipelex validate pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/
Generate example inputs
生成示例输入
mthds-agent pipelex inputs pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/
mthds-agent pipelex inputs pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/
Dry run (directory mode: auto-detects bundle, inputs, library dir)
试运行(目录模式:自动检测捆绑包、输入和库目录)
mthds-agent pipelex run pipe mthds-wip/pipeline_01/ --dry-run --mock-inputs
Fix any validation errors and re-validate. If validation fails unexpectedly or errors are unclear, re-run with `--log-level debug` for additional context:
```bash
mthds-agent --log-level debug pipelex validate pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/mthds-agent pipelex run pipe mthds-wip/pipeline_01/ --dry-run --mock-inputs
修复所有验证错误并重新验证。如果验证意外失败或错误不明确,使用`--log-level debug`重新运行以获取更多上下文:
```bash
mthds-agent --log-level debug pipelex validate pipe mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/Phase 10: Deliver
阶段10:交付
Goal: Generate input template after a successful build.
After validation passes (Phase 9), generate the input template:
bash
undefined目标:构建成功后生成输入模板。
验证通过后(阶段9),生成输入模板:
bash
undefinedInput template (extracts the input schema as JSON)
输入模板(将输入架构提取为JSON)
mthds-agent pipelex inputs pipe <mthds_file> -L <output_dir>/
Replace `<mthds_file>` and `<output_dir>` with actual paths from the build output.mthds-agent pipelex inputs pipe <mthds_file> -L <output_dir>/
将`<mthds_file>`和`<output_dir>`替换为构建输出中的实际路径。Present Results
展示结果
After the command succeeds:
-
Input template: Show theJSON from the inputs command output. Save it to
inputsfor the user to fill in.<output_dir>/inputs.json -
Next steps — try it now: If the method requires inputs, the savedstill contains placeholder values, so suggest a dry run first:
inputs.jsonTo try this method right now, use /mthds-run or from the terminal:mthds run pipe <output_dir>/ --dry-run --mock-inputs -
Next steps — run with real data: Explain how to prepare real inputs, then run for real: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 <output_dir>/Replacewith the actual output directory path used throughout the build.<output_dir>
命令成功后:
-
输入模板:展示inputs命令输出中的JSON。将其保存到
inputs供用户填写。<output_dir>/inputs.json -
下一步——立即试用:如果方法需要输入,保存的仍包含占位符值,因此建议先进行试运行:
inputs.json要立即试用此方法,可使用/mthds-run或在终端中运行:mthds run pipe <output_dir>/ --dry-run --mock-inputs -
下一步——使用真实数据运行:说明如何准备真实输入,然后实际运行:要使用真实数据运行,可使用/mthds-inputs准备你的输入(提供自己的文件,或生成合成测试数据),然后运行:
mthds run pipe <output_dir>/将替换为整个构建过程中使用的实际输出目录路径。<output_dir>
Quick Reference
快速参考
Multiplicity Notation
数量表示法
- - single item
Text - - variable-length list
Text[] - - exactly 3 items
Text[3]
- - 单个项目
Text - - 可变长度列表
Text[] - - 恰好3个项目
Text[3]
Prompt Variables
提示变量
- - Block insertion (multi-line, with delimiters)
@variable - - Inline insertion (short text)
$variable - - Access nested field
$var.field
- - 块插入(多行,带分隔符)
@variable - - 内联插入(短文本)
$variable - - 访问嵌套字段
$var.field
Naming Conventions
命名约定
- Domain:
snake_case - Concepts: , singular
PascalCase - Pipes:
snake_case - Variables:
snake_case
- 领域:
snake_case - 概念:,单数
PascalCase - 管道:
snake_case - 变量:
snake_case
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 in prompts or
$var.fieldin construct blocks, to know which attributes each native concept exposesfrom - Manual Build Phases — read for detailed ASCII diagrams and CLI examples per phase
- Talents and Presets — read when selecting model talents for pipe structuring
- 错误处理 —— 当CLI返回错误时阅读,以确定恢复方式
- MTHDS Agent指南 —— 阅读以了解CLI命令语法或输出格式细节
- MTHDS语言参考 —— 编写或修改.mthds TOML语法时阅读
- 原生内容类型 —— 在提示中使用或在construct块中使用
$var.field时阅读,以了解每个原生概念公开的属性from - 手动构建阶段 —— 阅读以获取每个阶段的详细ASCII图表和CLI示例
- 模型预设与技能集 —— 为管道结构化选择模型技能集时阅读