Publish MTHDS methods to the MTHDS Hub (mthds.sh). Use when user says "publish this method", "publish to mthds", "publish my methods", "mthds publish", "register my method", or wants to publish a method package to the Hub.
Register and publish method packages to the MTHDS Hub. No files are written and no runner is installed — this only registers the method for discovery.
Run this command to check toolchain status:
~/.claude/plugins/marketplaces/mthds-plugins/bin/mthds-env-check "0.4.1" 2>/dev/null || ../mthds-plugins/bin/mthds-env-check "0.4.1" 2>/dev/null || echo "MTHDS_ENV_CHECK_MISSING"
Interpret the output:
MTHDS_AGENT_MISSING → STOP. Do not proceed. Tell the user:The
mthds-agentCLI is required but not installed. Install it with:
npm install -g /build-src/mthds-js/
Then re-run this skill.
MTHDS_AGENT_VERSION_UNKNOWN → STOP. The installed mthds-agent returned an unparseable version. Tell the user:Could not parse the output of
mthds-agent --version. Your installation may be corrupt. Reinstall with:npm install -g /build-src/mthds-js/Then re-run this skill.
MTHDS_AGENT_OUTDATED <installed> <required> → The installed mthds-agent is too old for this plugin. Do not hard-stop. Instead, tell the user their mthds-agent (v<installed>) is older than the required v<required>, then follow the upgrade flow to offer upgrading mthds-agent via npm install -g /build-src/mthds-js/. After the upgrade flow completes (whether the user upgraded or declined), proceed to Step 1. The upgrade flow's "Not now" and "Never ask" options let users continue with current versions.
MTHDS_UPDATE_CHECK_FAILED ... → WARN. The update check command failed. Show the error output to the user. Suggest checking network connectivity and mthds-agent installation. Proceed to Step 1 with current versions.
UPGRADE_AVAILABLE ... → Read upgrade flow and follow the upgrade prompts before continuing to Step 1.
JUST_UPGRADED ... → Announce what was upgraded to the user, then continue to Step 1.
MTHDS_ENV_CHECK_MISSING → WARN. The env-check script was not found at either expected path. Tell the user the environment check could not run, but proceed to Step 1.
No output or UP_TO_DATE → Proceed to Step 1.
Any other output → WARN. The preamble produced unexpected output. Show it to the user verbatim. Proceed to Step 1 cautiously.
Determine where the method package lives:
| Source | Syntax | Example |
|---|---|---|
| GitHub (short) | org/repo | mthds-ai/contract-analysis |
| GitHub (full URL) | https://github.com/org/repo | https://github.com/mthds-ai/contract-analysis |
| Local directory | --local <path> | --local ./my-methods/ |
From GitHub:
mthds-agent publish <org/repo>
From a local directory:
mthds-agent publish --local <path>
Publish a specific method from a multi-method package:
mthds-agent publish <org/repo> --method <name>
| Flag | Required | Values | Description |
|---|---|---|---|
[address] | Yes* | org/repo | GitHub repo address |
--local <path> | Yes* | directory path | Publish from a local directory |
--method <name> | No | method name | Publish only one method from a multi-method package |
*One of address or --local is required.
On success, the CLI returns JSON:
{
"success": true,
"published_methods": ["method-name"],
"address": "org/repo"
}
Present to the user:
After a successful publish, ask the user if they want to share their methods on social media. If yes, use the /mthds-share skill or run mthds-agent share directly.
Common errors:
| Error | Cause | Fix |
|---|---|---|
Failed to resolve methods | GitHub repo not found or no methods in repo | Verify the address and that the repo contains METHODS.toml |
Method "X" not found | --method filter doesn't match any method | Check available method names in the package |
No valid methods to publish | No methods passed validation | Check METHODS.toml in the package |
For all error types and recovery strategies, see Error Handling Reference.