mthds-fix
Original:🇺🇸 English
Translated
Fix issues in MTHDS bundles. Use when user says "fix this workflow", "fix this method", "repair validation errors", "the pipeline is broken", "fix the .mthds file", after /mthds-check found issues, or when validation reports errors. Automatically applies fixes and re-validates in a loop.
8installs
Sourcemthds-ai/skills
Added on
NPX Install
npx skill4agent add mthds-ai/skills mthds-fixTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →Fix MTHDS bundles
Automatically fix issues in MTHDS method bundles.
Process
Step 0 — CLI Check (mandatory, do this FIRST)
Run . The minimum required version is 0.1.0 (declared in this skill's front matter as ).
mthds-agent --versionmin_mthds_version- If the command is not found: STOP. Do not proceed. Tell the user:
TheCLI is required but not installed. Install it with:mthds-agentnpm install -g mthdsThen re-run this skill.
- If the version is below 0.1.0: STOP. Do not proceed. Tell the user:
This skill requiresversion 0.1.0 or higher (found X.Y.Z). Upgrade with:mthds-agentnpm install -g mthds@latestThen re-run this skill.
- If the version is 0.1.0 or higher: proceed to the next step.
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.
.mthdsNo 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 — usewhen you're ready./pipelex-setup
Step 1: Validate and Identify Errors
Always use pointing to the bundle's own directory to avoid namespace collisions:
-Lbash
mthds-agent pipelex validate pipe <file>.mthds -L <bundle-directory>/Parse the JSON output:
- If — nothing to fix, report clean status
success: true - If — iterate through
error_type: "ValidateBundleError"array and fix each (Step 2)validation_errors - If model/config error — see Error Handling Reference (cannot be fixed by editing the .mthds file)
Step 2: Fix .mthds Validation Errors
Use the field from each validation error to determine the fix:
error_type| Error Type | Fix Strategy |
|---|---|
| Add the missing variable(s) to the parent pipe's |
| Remove the unused variable(s) from the pipe's |
| Correct the concept type in |
| Change the |
| Add or remove |
| Restructure the method to break the cycle |
| Use PipeImgGen instead of PipeLLM for image generation |
| Ensure PipeImgGen input is text-based (use |
| Rename the pipe to valid snake_case |
| Add the concept definition to the bundle, or fix the typo |
| Rename |
For error type descriptions, see Error Handling — Validation Error Types.
Step 3: Fix TOML Formatting Issues
These aren't always reported by validation but cause problems:
Multi-line inputs — must be on a single line:
toml
# WRONG
inputs = {
a = "A",
b = "B"
}
# CORRECT
inputs = { a = "A", b = "B" }Pipe ordering — controllers before sub-pipes:
toml
# CORRECT: main pipe first, then sub-pipes in execution order
[pipe.main_workflow]
type = "PipeSequence"
steps = [
{ pipe = "step_one", result = "intermediate" },
{ pipe = "step_two", result = "final" }
]
[pipe.step_one]
...
[pipe.step_two]
...Missing required fields — add with sensible defaults:
- on every pipe and concept
description - on every pipe
type - on every pipe
output
Step 4: Re-validate
After applying fixes, re-validate:
bash
mthds-agent pipelex validate pipe <file>.mthds -L <bundle-directory>/Continue the fix-validate loop until is returned. Some fixes reveal new issues — for example, fixing a may expose an on the newly added input.
success: truemissing_input_variableinput_stuff_spec_mismatchIf the fix-validate loop gets stuck or errors are unclear, re-run with for additional context:
--log-level debugbash
mthds-agent --log-level debug pipelex validate pipe <file>.mthds -L <bundle-directory>/Step 5: Report Results
- List all changes made (which pipes were modified and how)
- Show the final validation result
- Flag any remaining warnings or suggestions
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 fixing type mismatches involving native concepts, to verify available attributes