edit
Edit MTHDS bundles
Modify existing MTHDS method bundles.
Mode Selection
See Mode Selection for general mode behavior.
Default: Automatic for clear, specific changes. Interactive for ambiguous or multi-step modifications.
Detection heuristics:
- "Rename X to Y" → automatic
- "Update the prompt in pipe Z" with new text provided → automatic
- "Add a step to do X" (open-ended) → interactive
- "Refactor this pipeline" (subjective) → interactive
- Multiple changes requested at once → interactive (confirm the plan)
Process
Prerequisite: See CLI Prerequisites
-
Read the existing .mthds file — Understand current structure before making changes
-
Understand requested changes:
- What pipes need to be added, removed, or modified?
- What concepts need to change?
- Does the method structure need refactoring?
Interactive checkpoint: Present a summary of planned changes. Ask "Does this plan look right?" before proceeding to step 3.
Automatic: Proceed directly to step 3. State planned changes in one line.
-
Apply changes:
- Maintain proper pipe ordering (controllers before sub-pipes)
- Keep TOML formatting consistent
- Preserve cross-references between pipes
- Keep inputs on a single line
- Maintain POSIX standard (empty line at end, no trailing whitespace)
-
Validate after editing:
mthds-agent pipelex validate <file>.mthds -L <bundle-dir>/If errors, see Error Handling Reference for recovery strategies by error domain. Use /fix skill for automatic error resolution.
-
Regenerate inputs if needed:
- If inputs changed, run
mthds-agent pipelex inputs <file>.mthds -L <bundle-dir>/ - Update existing inputs.json if present
- If inputs changed, run
-
Present completion:
- If inputs were regenerated (step 5 triggered), show the path to the updated file.
- Provide a concrete CLI example. If
inputs.jsoncontains placeholder values, suggest the safe dry-run command first:To try the updated method now, use /run or from the terminal:
mthds run <bundle-dir>/ --dry-run --mock-inputsTo run with real data, use /inputs to prepare your inputs (provide your own files, or generate synthetic test data), then:
mthds run <bundle-dir>/
Common Edit Operations
- Add a pipe: Define concept if needed, add pipe in correct order
- Modify a prompt: Update prompt text, check variable references
- Change inputs/outputs: Update type, regenerate inputs
- Add batch processing: Add
batch_over(plural list name) andbatch_as(singular item name) to step — they must be different - Refactor to sequence: Wrap multiple pipes in PipeSequence
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 when writing or modifying .mthds TOML syntax
- Native Content Types — read when using
$var.fieldin prompts orfromin construct blocks, to know which attributes each native concept exposes - Talents & Presets — read when setting or changing the
modelfield in a pipe, to find the correct preset name