run
Original:🇺🇸 English
Translated
Run MTHDS methods and interpret results. Use when user says "run this pipeline", "execute the workflow", "execute the method", "test this .mthds file", "try it out", "see the output", "dry run", or wants to execute any MTHDS method bundle and see its output.
4installs
Sourcemthds-ai/skills
Added on
NPX Install
npx skill4agent add mthds-ai/skills runTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Run MTHDS methods
Execute MTHDS method bundles and interpret their JSON output.
Process
Prerequisite: See CLI Prerequisites
Step 1: Identify the Target
| Target | Command |
|---|---|
| Pipeline directory (recommended) | |
| Specific pipe in a directory | |
| Bundle file directly | |
| Pipe by code from library | |
Directory mode (recommended): Pass the pipeline directory as target. The CLI auto-detects,bundle.mthds, and setsinputs.jsonautomatically — no need to specify them explicitly. This also avoids namespace collisions with other bundles.-L
Step 2: Prepare Inputs and Check Readiness
Fast path — inputs just prepared
If inputs were already prepared during this conversation — via (user-data, synthetic, or mixed strategy), or by manually assembling with real values earlier in this session — skip the schema fetch and readiness check. The inputs are ready. Proceed directly to Step 3 with a normal run.
/inputsinputs.jsonThis applies when you just wrote or saw being written with real content values. It does NOT apply after (which saves a placeholder template) or after with the template strategy.
inputs.json/build/inputsFull check — cold start
If is invoked without prior input preparation in this session, perform the full readiness check:
/runGet the input schema for the target:
bash
mthds-agent pipelex inputs bundle.mthdsOutput:
json
{
"success": true,
"pipe_code": "process_document",
"inputs": {
"document": {
"concept": "native.Document",
"content": {"url": "url_value"}
},
"context": {
"concept": "native.Text",
"content": {"text": "text_value"}
}
}
}Fill in the fields with actual values. For complex inputs, use the /inputs skill.
contentInput Readiness Check
Before running, assess whether inputs are ready. This prevents runtime failures from placeholder values.
No inputs required: If returns an empty object (), inputs are ready — skip to Step 3.
mthds-agent pipelex inputsinputs{}Inputs required: If inputs exist, check for readiness:
inputs.json- Does exist in the bundle directory?
inputs.json - If it exists, scan all values for placeholder signals:
content- Template defaults: ,
"url_value","text_value","number_value","integer_value", or any value matching the pattern"boolean_value"*_value - Angle-bracket placeholders: values containing (e.g.
<...>,<path-to-cv.pdf>)<your-text-here> - Non-existent file paths: fields pointing to local files that don't exist on disk
url
- Template defaults:
Readiness result:
- Ready: exists AND all content values are real (no placeholders, referenced files exist) → proceed to Step 3 with normal run
inputs.json - Not ready: is missing, OR contains any placeholder values → proceed to Step 3 with dry-run fallback
inputs.json
Step 3: Choose Run Mode
If inputs are not ready
Default to and inform the user:
--dry-run --mock-inputs"The inputs for this pipeline contain placeholder values (not real data). I'll do a dry run with mock inputs to validate the pipeline structure."
After the dry run, offer the user these options:
- Prepare real inputs — use to fill in actual values, then re-run
/inputs - Provide files — if the pipeline expects file inputs (documents, images), ask the user to supply file paths
- Keep dry run — accept the dry-run result as-is
Run modes reference
| Mode | Command | Use When |
|---|---|---|
| Dry run + mock inputs | | Quick structural validation, no real data needed, or inputs not ready |
| Dry run with real inputs | | Validate input shapes without making API calls (auto-detects |
| Full run | | Production execution (auto-detects |
| Full run inline | | Quick execution with inline JSON inputs |
| Full run without graph | | Execute without generating graph visualization |
| Full run with memory | | When piping output to another method |
Graph by default: Execution graphs (/live_run.html) are now generated automatically. Usedry_run.htmlto disable.--no-graph
Inline JSON for Inputs
The flag accepts both file paths and inline JSON. The CLI auto-detects: if the value starts with , it is parsed as JSON directly. This is the fastest path — no file creation needed for simple inputs.
--inputs{bash
# Inline JSON
mthds-agent pipelex run pipe <bundle-dir>/ --inputs '{"theme": {"concept": "native.Text", "content": {"text": "nature"}}}'
# File path (auto-detected in directory mode)
mthds-agent pipelex run pipe <bundle-dir>/Step 4: Present Results
After a successful run, always show the actual output to the user — never just summarize what fields exist.
Output format modes
The CLI has two output modes:
- Compact (default): stdout is the concept's structured JSON directly — no envelope, no wrapper. This is the primary output of the method's main concept. Parse the JSON directly for field access.
success - With memory (): stdout has
--with-memory(withmain_stuff,json,markdownrenderings) +html(all named stuffs and aliases). Use this when piping output to another method.working_memory
The and are written to disk as side effects (paths appear in logs/stderr), not in compact stdout.
output_filegraph_files4a. Determine what to show
In compact mode (default), the output is the concept JSON directly. Show the fields to the user:
json
{
"clauses": [...],
"overall_risk": "high"
}In mode, the output structure depends on the pipe architecture:
--with-memoryif main_stuff is non-empty (not {} or null):
→ main_stuff is the primary output (single unified result)
else:
→ working_memory.root holds the primary output (multiple named results)| Pipe Type | | What to show |
|---|---|---|
| PipeLLM, PipeCompose, PipeExtract, PipeImgGen | Always | |
| PipeSequence | Always (last step) | |
| PipeBatch | Always (list) | |
| PipeCondition | Always | |
PipeParallel with | Yes | |
PipeParallel without | No ( | |
4b. Show the output content
In compact mode: show the JSON fields directly. For structured concepts, format for readability.
In mode when is present (most pipe types):
--with-memorymain_stuff- Show directly — this is the human-readable rendering. Display it as-is so the user sees the full output.
main_stuff.markdown - For structured concepts with fields, also show formatted for readability.
main_stuff.json
In mode when is empty (PipeParallel without ):
--with-memorymain_stuffcombined_output- Iterate and present each named result.
working_memory.root - For each entry, show the field with its key as a label.
content - Example: "french_translation: Bonjour le monde" / "spanish_translation: Hola mundo"
For dry runs: Show the same output but clearly label it as mock/simulated data.
4c. Output file
- The CLI automatically saves the full JSON output next to the bundle (or
live_run.json).dry_run.json - The output file path appears in runtime logs (stderr), not in compact stdout.
4d. Present graph files
- Graph visualizations are generated by default (/
live_run.html). Usedry_run.htmlto disable.--no-graph - The graph file path appears in runtime logs (stderr), not in compact stdout.
4e. Mention intermediate results
- If the pipeline has multiple steps, briefly note key intermediate values from (e.g., "The match analysis intermediate step scored 82/100").
working_memory - Offer: "I can show the full working memory if you want to inspect any intermediate step."
4f. Suggest next steps
- Re-run with different inputs
- Adjust prompts or pipe configurations if output quality needs improvement
Step 5: Handle Errors
When encountering runtime errors, re-run with for additional context:
--log-level debugbash
mthds-agent --log-level debug pipelex run pipe <bundle-dir>/ --inputs data.jsonFor all error types and recovery strategies, see Error Handling Reference.
Execution Graphs
Execution graph visualizations are generated by default alongside the run output. Use to disable.
--no-graphbash
mthds-agent pipelex run pipe <bundle-dir>/Graph files ( / ) are written to disk next to the bundle. Their paths appear in runtime logs on stderr, not in compact stdout. When using , is included in the returned JSON envelope.
live_run.htmldry_run.html--with-memorygraph_filesPiping Methods
The run command accepts piped JSON on stdin when is not provided. This enables chaining methods:
--inputsbash
mthds-agent pipelex run method extract-terms --inputs data.json --with-memory \
| mthds-agent pipelex run method assess-risk --with-memory \
| mthds-agent pipelex run method generate-reportWhen methods are installed as CLI shims, the same chain is:
bash
extract-terms --inputs data.json --with-memory \
| assess-risk --with-memory \
| generate-report- Use on intermediate steps to pass the full working memory envelope.
--with-memory - The final step omits to produce compact output.
--with-memory - always overrides stdin when both are present.
--inputs - Upstream stuff names are matched against downstream input names. Method authors should name their outputs to match the downstream's expected input names.
Reference
- CLI Prerequisites — read at skill start to check CLI availability
- 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 .mthds syntax documentation
- Native Content Types — read when interpreting pipeline outputs or preparing input JSON, to understand the attributes of each content type