hermes-plugin-development
Use when building Hermes custom plugins. Verify the result.
- License 许可
- MIT
- 所属仓库
- iwindd/ugh-cloud
- 最近更新
- 2026-09-13
- Stars
- ★ 1
- Forks
- 0
01 前言 Front Matter
- name
- hermes-plugin-development
- author
- Hermes Agent
- license
- MIT
- version
- 1.0.0
- metadata
- { "hermes": { "tags": [ "hermes", "plugins", "custom-tools", "mcp", "extensions" ] } }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Use when building Hermes custom plugins. Verify the result.
02 资源文件 1
- 参考文档references/plugin-layout.md1.8 KB
03 SKILL.md 正文
Hermes Plugin Development
Use this skill for a Hermes custom tool, plugin, slash command, hook, or external integration. Keep user-specific extensions outside Hermes core unless the user explicitly wants an upstream contribution.
Procedure
- Classify the request before writing files:
- Use a skill when the change is knowledge or workflow guidance only.
- Use a plugin for a local Python tool, slash command, hook, persistent plugin state, bundled skills, or several related capabilities.
- Use MCP when the capability already exists as an MCP server, belongs in another language/process, or should be independently deployable.
- Modify Hermes core only for an upstream-quality built-in feature.
- Check the current official docs index and the matching Hermes reference before relying on API names. Prefer the live docs pages for plugin manifests, registration, MCP configuration, and validation commands.
- If the design is ambiguous, run a design interview before implementation. Ask the whole current decision frontier in one round, give a recommendation for each question, and wait for confirmation before creating the extension. Do not silently turn a request for a slash command into an automatic behavior change.
- Keep the extension profile-safe. Resolve the active Hermes home through
$HERMES_HOMEorget_hermes_home(); never assume another profile's~/.hermesdirectory. - For skill-backup plugins, make synchronization explicit and reviewable: expose the user-invoked
/ugh skill upload <skill-id> [--to-agent <agent-name>]and/ugh skill upload all [--to-agent <agent-name>]; read source skills only from the active Hermes profile; use--to-agentto choose a logical destination agent even when it has no local profile; preserve each skill's category and complete directory contents (SKILL.md,references/,templates/,scripts/, andassets/); and create one GitHub pull request per changed skill, even whenallis used. Keep curated/shared skills under/skills/separate from per-agent snapshots under/agents/<agent-name>/skills/; upload only the latter. Duringall, add or patch skills sourced from the active profile but leave target-only skills untouched. Treat explicit removals as deletion pull requests, never direct remote deletes; isolate managed files under the target agent namespace. Reuse an open PR branch for the same(repository, target-agent, category, skill-id)identity, but keep same-named skills for different target agents in separate branches and PRs. Use the target agent display name in PR titles, and record the source profile in the PR body. - Implement a plugin with a manifest and an importable
register(ctx)entry point. Register each tool with a precise JSON schema, a toolset, and a handler. Make handlers accept**kwargs, return JSON strings, and convert expected failures into{"error": "..."}results. - For GitHub skill backup, make PR identity and idempotency deterministic: use
(repository, target-agent, category, skill-id), targetmain, name the branchugh-cloud/agents/<agent>/skills/<category>/<skill-id>, and use titles[Agent] Request to add|patch|remove skill \<skill-id>``. Compare Git blob SHAs, not raw local bytes against remote SHAs; unchanged content is a successful no-op, an open matching PR is updated, and merged/closed PRs require a new branch. If the repository is empty, bootstrap its default branch through the Contents API with a minimal placeholder commit before creating skill branches; Git tree creation alone cannot initialize an empty GitHub repository. In batch mode, isolate each skill's failure and return per-skill results instead of aborting the batch. - Gate optional capabilities with an availability check or declared environment requirements. Keep secrets in the profile secret mechanism or
.env, not in source, manifests, or ordinary config. - For MCP, configure a named server under
mcp_servers, scope filesystem/repository access narrowly, and usetools.includeplus disabled prompts/resources when the server is sensitive or broad. - Validate before claiming completion: run the plugin doctor for local plugins, inspect
hermes plugins list, restart or reload MCP as appropriate, and exercise the tool through a real Hermes invocation. A file that imports successfully is not proof that the agent can see or call the tool. - Report only what was actually verified, including the extension path, exposed command/tool name, verification command and result, and any untested external credential or service dependency.
Standing pitfalls
- Prefer a plugin over editing
tools/andtoolsets.pyfor personal extensions because core edits are overwritten or conflict during upgrades. - Do not expose a registered tool until it is included in the intended toolset; registration alone does not make it available to the agent.
- Keep tool descriptions specific about when and how to use the tool because vague schemas produce unreliable tool selection.
- Do not return Python dicts from plugin handlers; Hermes expects JSON strings at the tool boundary.
- Do not let optional imports or missing credentials prevent the whole plugin set from loading; gate or lazily import them instead.
- Do not enable a destructive or customer-facing MCP server without an allowlist; discovery can expose more operations than the workflow needs.
- Make explicit skill-upload scope override excludes only through a per-command
--forceconfirmation; do not make force alter the persistent exclude policy. - If
--forceis allowed to override secret warnings for this user's workflow, display the exact suspicious files and require explicit confirmation before including them; never hide the warning or place credentials in ordinary configuration/source files. - Treat plugin discovery, tool registration, and tool invocation as separate checks; passing one does not establish the others.
See references/plugin-layout.md for the minimal plugin skeleton and the verification checklist. Use the official Hermes docs for API changes beyond that baseline.
04 同仓库更多 Skills
blocked-page-recovery
Use when a fetch fails: 403/429, paywall, WAF, bot wall.
test-driven-development
TDD: enforce RED-GREEN-REFACTOR, tests before code.
systematic-debugging
4-phase root cause debugging: understand bugs before fixing.
spike
Throwaway experiments to validate an idea before build.
simplify-code
Parallel 4-agent cleanup of recent code changes.
requesting-code-review
Pre-commit review: security scan, quality gates, auto-fix.