Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问许可证需确认审计提醒

mthds-buildmthds 构建

Agent Skill

mthds-build 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

606

周安装

25

GitHub Stars

5

下载量

198
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:mthds-build(mthds 构建)
来源仓库:https://github.com/mthds-ai/skills
仓库路径:skills/mthds-build
安装命令:
npx skills add https://github.com/mthds-ai/skills --skill mthds-build
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/mthds-ai/skills --skill mthds-build

简介

mthds-build 用于查找、检索和筛选相关信息,适合快速定位候选结果。

  • 适用于需要根据关键词或任务场景从来源线索中获取信息的场景。
  • 通过 npx skills add 命令安装,需结合原始 README 核验具体用法。
  • 安装前建议确认权限范围、维护状态及是否触发联网或文件读写操作。
  • 适用宿主包括 Codex、Claude、Cursor、Gemini CLI,接入前应确认版本、权限和运行环境要求。

SKILL.md

Build AI Method using the MTHDS standard

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.

Philosophy

  1. Drafting phases: Generate human-readable markdown documents
  2. Structuring phases: Use agent CLI commands for JSON-to-TOML conversion
  3. Visualization: Present ASCII graphs at overview and detail levels
  4. Iterative: Refine at each phase before proceeding

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"

  1. Skill default: Each skill defines its own default based on the nature of the task.
  2. 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

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

Run mthds-agent --version. The minimum required version is 0.1.2 (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.2: STOP. Do not proceed. Tell the user:
This skill requires mthds-agent version 0.1.2 or higher (found *X.Y.Z*). Upgrade with: `` npm install -g mthds@latest `` Then re-run this skill.
  • If the version is 0.1.2 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.

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 mthds-wip/ and any other directories containing .mthds files in the project.

How to check:

  1. List all .mthds files in the project (glob for **/*.mthds)
  2. For each file found, read the file header (domain, main pipe code, description) to understand what it does
  3. 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: - <path/to/bundle.mthds> How would you like to proceed? 1. Start fresh — Create a wholly new method from scratch (ignoring the existing one) 2. Use the existing method — It already does what you need; cancel this build 3. 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 /mthds-run and point them to its inputs.json if available.
  • 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 .mthds file path to the edit workflow.

Phase 1: Understand Requirements

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

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., documents), singular for items (e.g., 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)


Phase 3: Draft Concepts

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., Invoice not Invoices)
  • Description: What it represents
  • Type: Either refines: NativeConcept OR structure: {...}

Native concepts (built-in, do NOT redefine): Text, Html, Image, Document, Number, Page, TextAndImages, ImgGenPrompt, JSON, SearchResult, Anything, Dynamic. See MTHDS Language Reference — Native Concepts

Note: Document is the native concept for any document (PDF, Word, etc.). Image is for any image format (JPEG, PNG, etc.). File formats like "PDF" or "JPEG" are not concepts.

Each native concept has accessible attributes (e.g., Image has url, public_url, filename, caption...; Document has url, public_url, filename...; Page has text_and_images and page_view). See Native Content Types for the full attribute reference — essential for $var.field prompts and construct blocks.

Concept naming rules:

  • No adjectives: Article not LongArticle
  • No circumstances: Argument not CounterArgument
  • Always singular: Employee not Employees

Output: Concepts draft (markdown)


Phase 4: Structure Concepts

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):

# Call 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):

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 choices is present, type defaults to text if omitted. You can also pair choices with integer or number types explicitly.

Nested concept references in structures:

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 (error_domain: "input" means the spec is wrong). Re-run only the failed commands.

Phase 5: Draft the Flow

Goal: Design the complete pipeline structure with controller selection.

Controller Selection Guide

ControllerUse WhenKey Pattern
PipeSequenceSteps must execute in orderstep1 → step2 → step3
PipeBatchSame operation on each list itemmap(items, transform)
PipeParallelIndependent operations run togetherfork → join
PipeConditionRoute based on data valuesif-then-else

Operator Selection Guide

OperatorUse When
PipeLLMGenerate text or structured objects with AI
PipeExtractExtract content from PDF/Image → Page[]
PipeComposeTemplate text or construct objects
PipeImgGenGenerate images from text prompts
PipeSearchSearch the web for information → SearchResult
PipeFuncCustom Python logic
Critical — PipeImgGen requires a prompt field: The prompt field is required for PipeImgGen. It is a template that defines the text sent to the image generation model — use $variable syntax to insert inputs. Examples: - Direct passthrough: prompt = "$img_prompt" — uses the input as-is - Template with context: prompt = "A black and white sketch of $description" — wraps the input in a richer prompt Even if the input already contains the full prompt text, you must still declare the prompt field. Without it, validation fails with missing required fields: 'prompt'.
Note: Page[] outputs from PipeExtract automatically convert to text when inserted into prompts using @variable.

Show detailed ASCII flow — see Manual Build Phases for all controller flow diagrams.

Output: Flow draft with pipe contracts (markdown)


Phase 6: Review & Refine

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: input_item_name (singular) differs from input_list_name (plural) and all inputs keys
  • PipeSequence batch steps: batch_as (singular) differs from batch_over (plural)
  • PipeImgGen has a prompt field (template that references inputs, e.g., prompt = "$description" or prompt = "A watercolor painting of $subject") — required even when the input IS the prompt
  • PipeImgGen inputs are text-compatible (add PipeLLM if needed to craft the prompt first)
  • No circular dependencies

Confirm with user before proceeding to structuring.


Phase 7: Structure Pipes

Goal: Convert pipe drafts to validated TOML using the CLI.

Use talent names (left column) from Talents and Presets. Do NOT use model preset names (right column, prefixed with $ or @) — those are internal identifiers. For example, use creative-writer, not writing-creative or $writing-creative. Only look up specific model presets when the user has explicit instructions about model choice. In all cases, verify that referenced presets exist:

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 pipes
mthds-agent pipelex models --type search       # when structuring PipeSearch pipes

Prepare JSON specs for all pipes, then convert them in parallel by making multiple concurrent tool calls.

Exact field names for --spec JSON: type (not pipe_type), pipe_code (not the_pipe_code), and the talent field matching the pipe type: llm_talent for PipeLLM, extract_talent for PipeExtract, img_gen_talent for PipeImgGen, search_talent for PipeSearch. Do NOT use generic names like talent_name.
PipeImgGen prompt is required: The prompt field must be included in the --spec JSON. It is a template — use $variable to insert inputs. Examples: "prompt": "$img_prompt" (passthrough) or "prompt": "A black and white sketch of $description" (template with context). Omitting prompt causes a validation error.

For detailed CLI examples for each pipe type (PipeLLM, PipeSequence, PipeBatch, PipeCondition, PipeCompose, PipeParallel, PipeExtract, PipeImgGen, PipeSearch), see Manual Build Phases.

Output: Validated pipe TOML fragments

Partial failures: Fix failing specs using the error JSON. Re-run only the failed commands.

Phase 8: Assemble Bundle

Goal: Combine all parts into a complete.mthds file.

Save location: Always save method bundles to mthds-wip/. Do not ask the user for the save location.

Procedure:

  1. Create the output directory: mkdir -p mthds-wip/<bundle_dir>/
  2. Save concept TOML from Phase 4 to mthds-wip/<bundle_dir>/concepts.toml using the Write tool
  3. Save pipe TOML from Phase 7 to mthds-wip/<bundle_dir>/pipes.toml using the Write tool
  4. Run assemble with file paths (not inline content): mthds-agent pipelex assemble \ --domain <domain> \ --main-pipe <main_pipe_code> \ --description "<description>" \ --concepts mthds-wip/<bundle_dir>/concepts.toml \ --pipes mthds-wip/<bundle_dir>/pipes.toml
  5. Parse the toml field from the JSON response and save it using the Write tool to mthds-wip/<bundle_dir>/bundle.mthds — this triggers the PostToolUse hook for automatic lint/format/validate.
  6. Clean up the intermediate files (concepts.toml, pipes.toml) — they are no longer needed.

IMPORTANT: Never pass TOML content inline via process substitution or heredocs. Always write to files first, then pass file paths to the CLI.

For additional examples, see Manual Build Phases.


Phase 9: Validate & Test

Goal: Ensure the bundle is valid and works correctly.

Always use -L pointing to the bundle's own directory to avoid namespace collisions with other bundles in the project.

# Validate and generate flowchart (isolated from other bundles)
mthds-agent pipelex validate bundle mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/ --graph

# Generate example inputs
mthds-agent pipelex inputs bundle mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/

On success, dry_run.html is saved next to the bundle. The JSON output includes the path in graph_files.

Fix any validation errors and re-validate. If validation fails unexpectedly or errors are unclear, re-run with --log-level debug for additional context:

mthds-agent --log-level debug pipelex validate bundle mthds-wip/pipeline_01/bundle.mthds -L mthds-wip/pipeline_01/

Phase 10: Deliver

Goal: Generate input template after a successful build.

After validation passes (Phase 9), generate the input template:

# Input template (extracts the input schema as JSON)
mthds-agent pipelex inputs bundle <mthds_file> -L <output_dir>/

Replace <mthds_file> and <output_dir> with actual paths from the build output.

Present Results

After the command succeeds:

  1. Input template: Show the inputs JSON from the inputs command output. Save it to <output_dir>/inputs.json for the user to fill in.
  2. Flowchart: Tell the user that an interactive flowchart (dry_run.html) was generated during validation next to the bundle.
  3. Next steps — test with mock inference: If the method requires inputs, the saved inputs.json still contains placeholder values, so suggest a dry run to test with mock inference: To test this method with mock inference, use /mthds-run or from the terminal: mthds run bundle <output_dir>/ --dry-run --mock-inputs
  4. 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 bundle <output_dir>/ Replace <output_dir> with the actual output directory path used throughout the build.

Quick Reference

Multiplicity Notation

  • Text - single item
  • Text[] - variable-length list
  • Text[3] - exactly 3 items

Prompt Variables

  • @variable - Block insertion (multi-line, with delimiters)
  • $variable - Inline insertion (short text)
  • @?variable - Conditional block insertion (only renders if variable is truthy)
  • $var.field - Access nested field (dotted paths work with all three patterns)
  • Raw Jinja2 {{}} / {% %} also supported
  • These work in PipeLLM, PipeImgGen, PipeSearch, and PipeCompose templates

Naming Conventions

  • Domain: snake_case
  • Concepts: PascalCase, singular
  • Pipes: snake_case
  • Variables: snake_case

Reference

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

35.11%
按下载量换算70

Claude

30.33%
按下载量换算60

Cursor

19.89%
按下载量换算39

Gemini CLI

8.37%
按下载量换算17

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills