Convention-correct helper library for registering hermes-agent plugin
commands, tools, middleware, hooks, and skills.
This repository is an installable Python package, not a path-loaded runtime
plugin.
- Keep
@tool, slash-default@command, andregister_allbackward compatible. Use@command(type="cli")for terminal subcommands and@command(type="slash")for explicit in-session commands; use@middleware,@hook,plugin_skill, andregister_pluginfor full plugin lifecycle registration. - Use
load_plugin_configfor effectiveplugins.<name>runtime settings; current HermesPluginManifestobjects do not expose profile config. Useconfigure_stderr_loggingfor operator-gated registration receipts instead of rebuilding per-plugin stderr handlers. - Keep lifecycle registration receipts centralized in
log_registration_summary; preserve its stable field order and actual command, tool, middleware, hook, skill, and skipped optional skill names.register_pluginmust emit exactly one receipt through that helper. - Use
@tool(schema=...)when a consumer already owns a valid Hermes function schema; do not translate it through a second argument-spec format. Keepschemaandparamsexclusive, deep-copy supplied schemas, and preserve schema-required fields even whenvalidate_required=Falsedelegates missing-argument errors to a legacy handler. - Runtime-gated consumers should pass their active decorated callables to
register_pluginwith an explicit receipt identity. Iterable registration must retain module registration's duplicate checks, deterministic ordering, skills, andRegistrationSummarycontract. - Use
resolve_capability_selectionwhen several runtime-gated surfaces form one authorization unit. Capability membership belongs to the plugin, not deployment configuration; explicit-name selection remains mutually exclusive for narrow legacy surfaces. Registration preflight must finish before the firstctx.register_*mutation, and receipts must name selected capabilities. - Consumer deployments must pin this package's private OCI bundle/receipt digests and verified wheel SHA-256, never a moving branch or registry tag. Source-based development pins an immutable commit. Profiles that install multiple plugins into one Python environment must use one qualified kit revision for every consumer.
- Use
invoke_host_toolfor host-managed capabilities such assend_message; do not assume every Hermes capability is registered intools.registry. Nested host calls must remain visible topre_tool_callandpost_tool_call. - Keep host invocation grounded in the real Hermes contract suite. For media delivery, exercise target parsing and platform formatting and mock only the final network client rather than replacing the host handler.
- Plugins must use
MediaPayload+deliver_mediafor attachments. The kit owns Hermes media directives, task-localoriginresolution, route redaction, the typed result, successful-send final-response suppression, and the narrow Telegramspoiler=Truephoto extension. Spoiler delivery must retain Hermes pre/post-tool hooks, route privacy, topic forwarding, and explicit Bot client shutdown; normal media must remain on host-managedsend_message. Consumers must registertransform_media_delivery_outputas Hermes'transform_llm_outputhook andclear_media_delivery_stateason_session_end; they must not recreate those contracts or substitute OpenClaw response shapes. - A host answer of
skipped: trueis never a delivery and must never arm the ✅ suppression. The cron duplicate-target skip (CRON_DUPLICATE_SKIP_REASON, pinned to the host by the contract suite) defers the attachment into the cron job's final reply; every other skip returnssuccess=False. deliver_media(..., as_reply=True)toorigindefers the attachment into the turn's final reply instead of sending it plus a ✅. It must stay opt-in: itssuccessmeans "accepted", not "sent".clear_media_delivery_statemust keep sending any deferred attachment the reply did not carry, so a failed or interrupted turn never loses it.- Use
tool_name(namespace, verb, noun)for new tools and prefer explicit verbs such asread,write, andpatch. Do not use Hermes agent-loop names (memory,todo,session_search,delegate_task) as plugin tools. - Preserve the Hermes tool schema convention: arguments live under
function.parameters, never as flattened top-level schema fields. - Tool handlers must accept
(args, **kwargs)and return JSON-compatible dictionaries unless deliberately returning an already-encoded string. - Keep validation errors instructive for model-facing callers, including the missing argument name and example when available.
- Keep stateful Hermes provider ABCs as provider instances: register memory,
image-generation, and video-generation providers through their specialized
contexts instead of decorating provider methods as general plugin surfaces.
Do not add a provider declaration decorator: the explicit
memory_providers=/image_gen_providers=/video_gen_providers=tuples are the contract (decided on #22). - Register at most one real Hermes
ContextEnginethroughregister_plugin. Finish every registrar, identity, type, declaration, and provider preflight before submitting it or mutating another host registry. Keep engine schemas and recovery dispatch onget_tool_schemas/handle_tool_call; do not duplicate native engine tools through@tool. - Register gateway platforms with
@platformon aBasePlatformAdaptersubclass throughregister_plugin. Check options against the host's ownPlatformEntry, never a kit-owned field list; read platform existence withcore_ships_platformandsnapshot_registrationunder the plugin manager's scope (the one Hermes writes to) plus the global scope, neverPlatformRegistry.get, which imports deferred SDKs. Access-policy options are never optional. Replacing an existing platform stays operator-gated throughplugins.<name>.replace_platforms, and a host refusal must dispose this call's earlier platform handles. - Redact secret-looking values in logs and avoid logging full untrusted payloads.
- Get Python and
uvfrommise.tomlandmise.lock(mise trust && mise install --locked), the same toolchain CI installs; after changing a tool pin, regenerate the lock withmise lock --platform linux-x64,linux-arm64,macos-arm64. Then use the mise tasks for local development (mise tasks lslists them; one-line tasks live inmise.toml, longer ones inmise-tasks/):mise run install,mise run test,mise run test-one tests.test_kit.SchemaConventionTests, andmise run build.
When changing conventions or exported helpers, update README.md examples and
tests together so consuming Hermes plugins have a reliable migration path.
Keep skills/hermes-plugins/references/plugin-kit.md aligned with public API
and contract changes so the repo-owned authoring skill does not teach stale
behavior.
The source repository stays public; release wheels, sdists, and receipts stay
private in ghcr.io/offendingcommit/hermes-plugin-kit. Source visibility never
authorizes public artifact publication. Public-repository Actions artifacts
are not private distribution: upload only public source/test evidence there.
GitHub Releases are immutable metadata only, with private digest references
and zero assets, including receipts.
Package privacy is independent of source access. Keep the GHCR package
unlinked, with its own explicit ACL; never grant this public repository Actions
access or add org.opencontainers.image.source. Do not use the built-in
GITHUB_TOKEN for package access: associating a private package with a public
repository can expose it to fork workflows. Registry steps use step-scoped
GH_TOKEN from protected environment secret PRIVATE_ARTIFACTS_TOKEN; writers
use the main-only private-artifacts environment, and source-promotion fetch
uses a read-capable secret in its own main-only environment.
Require a positive package API visibility=private check before any sensitive
upload. An absent package may receive metadata-only bootstrap content, then
must be rechecked. API errors and public/internal visibility fail closed.
Use ORAS with stdin/temporary authentication; preserve deterministic OCI
identities, digest-pinned retrieval, exact tested bytes, both test gates,
metadata checks, and downloaded-byte verification. Discovery tags cannot
replace digest identity; retries must refuse conflicting existing tags.
Source authentication uses SOURCE_PROMOTION_TOKEN from the main-only
source-promotion environment. A suitable PAT or existing GitHub credential
is valid; a particular token-minting mechanism is not a release invariant.
Keep the Administration-read immutability check, tested-source identity,
atomic guarded push, and immutable metadata-only GitHub Release control intact.
Never expose the promotion credential to source-testing/build or registry
steps, silently fall back to the default Actions token, or change branch-policy
bypasses as part of credential wiring. Environment restrictions narrow token
availability, not underlying permissions.
Keep SEMANTIC_RELEASE_ENABLED=false until the private cutover is reviewed.
The tagged v0.9.0 publication failed before publishing: never retag, rebuild,
or retry its old PyPI workflow. The next reviewed normal release is the cutover.