hermes-maintenance
Skill0 starsChanged 3 months agoMITView on GitHub
Maintain native or Docker Hermes installs with per-profile Doctor, database integrity, config, gateway, session, cron, memory and log checks.
- Reads credentials
2 other projects use a version of this.
Adopted by
Most recently taken up by
- andrewalhaj/custom-hermesagenttheir own version, first seen Oct 20, 2026
- 2867203296/hermes-agenttheir own version, first seen Aug 19, 2026
Other versions2 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 2
- 2867203296/hermes-agent★ 0same name
- andrewalhaj/custom-hermesagent★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
47 rules. About 0 are common, 38 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈38
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 16
Use this skill when the user asks to inspect, maintain, update, repair or run Doctor on a Hermes Agent installation.
- Distinctive: line 23
Treat native Hermes and Docker Hermes as separate scopes.
- Distinctive: line 24
Never assume profile names, container names, data paths, messaging platforms, model providers or memory providers.
- Very specific: line 26
Never print .env values, tokens, API keys, OAuth state, auth files, cron prompts, database message content or backup payloads.
- Distinctive: line 27
Run Doctor and the session database integrity check separately for every profile found.
- Distinctive: line 28
Do not force gateway restarts, updates, pruning, migrations or backups just to make a report look clean.
- Very specific: line 30
Keep the configured memory design as-is.
- Very specific: line 60
If the skill was installed under a category, use the path from hermes skills list or find its directory under $HERMES_HOME/skills/.
- Distinctive: line 81
Run one explicit read-only segment:
- Distinctive: line 88
Run a mutating segment only after reviewing its plan:
- Distinctive: line 95
Create allowlisted profile backups only when explicitly asked:
- Distinctive: line 121
If discovery is ambiguous, stop and ask for the Hermes data root or container name.
- Distinctive: line 171
Do not infer live health from directory presence or an old log.
- Distinctive: line 188
Before modifying config, environment files, cron definitions or databases:
- Distinctive: line 191
do not print or commit its contents
- Distinctive: line 195
Stop gateways or the container before repairing a database that can receive concurrent writes.
- Very specific: line 199
Read references/remediation-guide.md for evidence requirements and narrow fixes for common findings.
- Distinctive: line 207
remove one dead Model Context Protocol (MCP) integration that cannot function in the runtime
- Distinctive: line 210
Never copy secrets from another profile just to silence Doctor.
- Distinctive: line 214
Use the most direct trusted check:
- Distinctive: line 228
all intended profiles were checked
- Distinctive: line 229
all databases open cleanly
- Distinctive: line 230
all intended gateways are running
- Very specific: line 239
Read references/native-maintenance.md before native gateway cycling, updates or launch-service work.
- Distinctive: line 244
Do not blanket-restart profiles that were stopped on purpose.
- Distinctive: line 245
After an update, run config migration/check and Doctor before assuming old gateways loaded the new code.
- Very specific: line 250
Read references/docker-maintenance.md before container replacement, database repair or image work.
- Distinctive: line 257
Wait for ownership/bootstrap reconciliation before diagnosing missing profile services.
- Distinctive: line 258
Verify the s6 service count and the actual gateway worker count.
- Distinctive: line 259
Keep the old stopped container or exact image as rollback when replacing a custom image.
- Distinctive: line 263
Use supported Hermes commands first:
- Distinctive: line 277
If repair is needed:
- Distinctive: line 283
verify session/message counts when available
- Distinctive: line 286
Do not assume missing application tables mean corruption without checking the installed schema.
- Distinctive: line 290
Check without exposing values:
- Distinctive: line 315
Do not manually run scheduled jobs just to clear historical error state.
- Distinctive: line 322
use the package manager's audit report
- Distinctive: line 323
prefer narrow patched versions or reviewed overrides
- Distinctive: line 325
never use forceful major-version audit fixes without review
- Distinctive: line 326
run workspace checks/tests after updates
- Distinctive: line 328
verify the running container image ID matches the rebuilt tag
- Distinctive: line 332
Every runner segment emits:
- Very specific: line 352
use --reset-run only when abandoning the current run
- Distinctive: line 354
Do not delete the state file to hide a failure.
- Very specific: line 360
Do not schedule the runner with unconditional --apply --force.
- Very specific: line 396
Use placeholders such as <profile>, <container> and <path>.
- Distinctive: line 400
When this skill is used and you find a generic, reproducible gap, patch the skill and add a regression test.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Hermes Maintenance
Use this skill when the user asks to inspect, maintain, update, repair or run Doctor on a Hermes Agent installation. It covers native installs and multi-profile Docker containers.
Authoritative product docs: https://hermes-agent.nousresearch.com/docs/
How this works
- Find out what the actual environment is before recommending or changing anything.
- Treat native Hermes and Docker Hermes as separate scopes. A clean native Doctor does not prove Docker is healthy.
- Never assume profile names, container names, data paths, messaging platforms, model providers or memory providers.
- Inspect first. Change one thing at a time, keep a rollback, and verify after every repair.
- Never print
.envvalues, tokens, API keys, OAuth state, auth files, cron prompts, database message content or backup payloads. - Run Doctor and the session database integrity check separately for every profile found. Checking the default profile does not cover every profile's database.
- Do not force gateway restarts, updates, pruning, migrations or backups just to make a report look clean. If the user asked for review only, get authorization before changing anything.
- Tell optional-tool warnings apart from broken capabilities. Do not copy credentials between profiles or switch off intended tools without evidence.
- Keep the configured memory design as-is. An empty
memory.providermeans built-in file memory. A non-empty provider may be deliberate; report it rather than changing it unless the user asked. - A command that succeeds is not enough. Verify the resulting runtime, database, API or file state.
Included runner
The deterministic runner is scripts/hermes-maintenance.py. It uses only Python's standard library.
What it does:
- finds profiles from their
config.yamlfiles - supports native and Docker execution
- updates native Hermes installations without changing Docker images in place
- checks Curator status and per-profile authentication state
- runs one segment at a time
- keeps compact state and JSONL logs, with one JSON record per line
- redacts likely credentials from captured output
- requires
--applyfor mutating segments - requires
--include-quarterlyfor every quarterly segment - uses the Docker
hermesshim rather than calling the Python virtual environment (venv) binary as root
The runner never edits configuration values directly. The agent must inspect the evidence and make repairs deliberately.
Start here
Locate the installed script:
SCRIPT="$HOME/.hermes/skills/hermes-maintenance/scripts/hermes-maintenance.py"If the skill was installed under a category, use the path from hermes skills list or find its directory under $HERMES_HOME/skills/.
List available segments:
python3 "$SCRIPT" --list-segmentsPreview the due work without changing state:
python3 "$SCRIPT" --mode native --plan
python3 "$SCRIPT" --mode docker --container hermes --planCheck runner state:
python3 "$SCRIPT" --mode native --statusRun one explicit read-only segment:
python3 "$SCRIPT" --mode native --segment doctor-all
python3 "$SCRIPT" --mode docker --container hermes --segment session-integrityRun a mutating segment only after reviewing its plan:
python3 "$SCRIPT" --mode native --segment config-migrate --apply
python3 "$SCRIPT" --mode native --segment session-prune --retention-days 60 --applyCreate allowlisted profile backups only when explicitly asked:
python3 "$SCRIPT" --mode native --segment profile-backups --apply --include-quarterlyMode and path discovery
Explicit mode is safest:
--mode native
--mode docker --container <name>Native home resolution, in order:
--home PATHHERMES_HOME~/.hermes
Docker home resolution, in order:
--home PATH- host source mounted at
/opt/datain the selected container
If discovery is ambiguous, stop and ask for the Hermes data root or container name. Do not guess from unrelated directories.
Segments
Weekly
hermes-update: update a native Hermes installation; requires--apply; Docker reportsnot_applicableso the image can be updated from the hostinventory: version, profiles, config versions and Docker runtime when applicableconfig-migrate: apply supported config migrations to every profile found; requires--applyconfig-check: validate every profile configgateway-status: inspect every profile gatewaycurator-status: inspect Hermes Curator statusdocker-runtime: container state, restart count, gateway worker count and/healthwhen exposed
Monthly
doctor-all: run Doctor separately for every profileskills-check: inspect upstream skill updatessession-stats: report every profile's session store statisticssession-prune: prune sessions older than the configured retention; requires--applysession-integrity: run supported SQLite and full-text-search (FTS) check-only repair on every profilememory-pressure: reportMEMORY.mdandUSER.mdsizes without reading their contentconfig-hygiene: report external memory provider state, deprecated environment keys and duplicate Telegram token ownership without printing tokenscron-health: report counts and error states without exposing job prompts
Quarterly-gated
auth-status: check authentication state separately for every profile while suppressing account and credential outputgateway-log-scan: count actionable recent warning patterns without reproducing sensitive log linesprofile-backups: create allowlisted profile recovery backups; requires--apply --include-quarterly
Backups include only selected config, built-in memory, skills, cron definitions and scripts. They exclude credentials, identity/instruction/prefill files, auth state, session databases, logs, caches, dependency trees and runtime state. Agent-control files need deliberate manual handling and are never copied by the community runner.
The maintenance workflow
1. Inventory
Collect:
- installed Hermes version
- runtime mode and data root
- number of profiles found
- container image/restart count when applicable
- gateway states
- config versions
- session database sizes and integrity
- cron error counts
- memory file pressure
- recent actionable log-pattern counts
Do not infer live health from directory presence or an old log.
2. Plan
Classify every finding:
- verified healthy
- actionable misconfiguration
- stale historical event
- optional capability not configured
- external/transient failure
- requires user decision
Rank repairs by blast radius, meaning how much they could affect. Prefer narrow config fixes over rebuilds or recreates.
3. Back up affected artifacts
Before modifying config, environment files, cron definitions or databases:
- make a timestamped copy outside the active path
- do not print or commit its contents
- preserve file ownership and permissions where relevant
- record the rollback location privately in the maintenance report
Stop gateways or the container before repairing a database that can receive concurrent writes.
4. Repair one finding
Read references/remediation-guide.md for evidence requirements and narrow fixes for common findings.
Examples:
- migrate one stale config
- disable one proven duplicate platform binding
- assign one unique API port
- repair one database using the supported Hermes command
- remove one dead Model Context Protocol (MCP) integration that cannot function in the runtime
- pin one cron provider/model when runtime safety requires explicit values
Never copy secrets from another profile just to silence Doctor.
5. Verify the repair
Use the most direct trusted check:
- config change:
config check, fresh gateway process ID (PID) and logs - database repair:
sessions repair --check-only, SQLite quick check and FTS integrity through supported Hermes output - messaging: read-only platform identity/health call when available
- Docker: container state, restart count, worker count and
/health - dependency repair: rerun the exact audit and the relevant build/test command
Then rerun Doctor for the affected profile.
6. Final pass
Before declaring completion:
- all intended profiles were checked
- all databases open cleanly
- all intended gateways are running
- container restart count is explained
- current logs have no unexplained hard errors
- expected SIGTERM lines line up with deliberate maintenance stops/restarts
- optional warnings are labeled optional rather than silently "fixed"
- rollback assets still exist
Native maintenance
Read references/native-maintenance.md before native gateway cycling, updates or launch-service work.
Key rules:
- Pass
-p <profile>explicitly for named-profile commands. - Do not blanket-restart profiles that were stopped on purpose.
- After an update, run config migration/check and Doctor before assuming old gateways loaded the new code.
- A stale gateway can keep old Python modules loaded after files update; compare process start time with update time.
Docker maintenance
Read references/docker-maintenance.md before container replacement, database repair or image work.
Key rules:
- Inspect the running container's exact image, mounts, command and restart policy before replacement.
- Preserve
/opt/databind-mounted state. - Invoke
docker exec <container> hermes ...; do not bypass the privilege-dropping shim with/opt/hermes/.venv/bin/hermesas root. - Wait for ownership/bootstrap reconciliation before diagnosing missing profile services.
- Verify the s6 service count and the actual gateway worker count.
- Keep the old stopped container or exact image as rollback when replacing a custom image.
Database integrity
Use supported Hermes commands first:
hermes sessions repair --check-only
hermes -p <profile> sessions repair --check-onlyFor Docker:
docker exec <container> hermes sessions repair --check-only
docker exec <container> hermes -p <profile> sessions repair --check-onlyIf repair is needed:
- stop concurrent writers
- back up
state.db,state.db-walandstate.db-shmif present - run supported
sessions repair - rerun
--check-only - verify session/message counts when available
- restart only the affected runtime
Do not assume missing application tables mean corruption without checking the installed schema.
Config and platform checks
Check without exposing values:
- duplicate Telegram token ownership using hashes
- API server ports enabled in more than one profile
- deprecated environment keys
- stale loopback proxy URLs inside Docker
- provider/model mismatches
- dead MCP servers
- active external memory files/providers
A token collision is proven only when equal secret hashes map to multiple active profiles. Never print the hash or token.
Cron health
Cron jobs are profile-scoped and gateway-dependent.
Inspect:
- enabled/disabled state
- last status and last error category
- provider/model/base URL overrides
- script existence
- gateway availability
- delivery target availability
Do not manually run scheduled jobs just to clear historical error state. A forced job may send messages, publish content or cost model spend. Get authorization for the exact job first.
Dependency vulnerabilities
Doctor checks Hermes' bundled browser, web and UI dependency scopes. If it reports vulnerabilities:
- identify the affected workspace and dependency chain
- use the package manager's audit report
- prefer narrow patched versions or reviewed overrides
- preserve repository supply-chain policies such as minimum release age
- never use forceful major-version audit fixes without review
- run workspace checks/tests after updates
- rebuild the image if Docker uses the changed source
- verify the running container image ID matches the rebuilt tag
Failure handling
Every runner segment emits:
HERMES_MAINTENANCE_SEGMENT_START name=<segment>
HERMES_MAINTENANCE_SEGMENT_DONE name=<segment> code=0or:
HERMES_MAINTENANCE_SEGMENT_FAILED name=<segment> code=<code>On failure:
- stop the sequence
- inspect the failed command's redacted output and the maintenance JSONL log
- pin down root cause
- repair narrowly
- rerun the failed segment explicitly
- use
--reset-runonly when abandoning the current run
Do not delete the state file to hide a failure.
Automating maintenance
The safest automated pattern is an agent-driven cron that loads this skill, runs --plan, runs at most one due segment, and reports only failures or a compact completion summary.
Do not schedule the runner with unconditional --apply --force. Quarterly backups should never be enabled silently.
A script-only cron can run read-only segments. Mutating segments stay explicit unless the operator has reviewed and accepted the exact maintenance policy.
The included native cron wrapper, scripts/hermes-maintenance-cron.py, is that explicit policy boundary. Scheduling it runs exactly one due weekly or monthly segment with --apply. It never enables quarterly work:
CRON_SCRIPT="$HOME/.hermes/skills/hermes-maintenance/scripts/hermes-maintenance-cron.py"
python3 "$CRON_SCRIPT"For Docker, update the image from the host. The hermes-update segment reports not_applicable instead of modifying a running container.
Hermes cron requires a real script file under ~/.hermes/scripts; it rejects absolute skill paths and symlinks that resolve outside that directory. Copy the published containment shim there after reviewing it:
SHIM_SOURCE="$HOME/.hermes/skills/hermes-maintenance/scripts/hermes-maintenance-cron-shim.py"
SHIM="$HOME/.hermes/scripts/hermes-maintenance-skill-cron.py"
test ! -e "$SHIM" && cp "$SHIM_SOURCE" "$SHIM"The shim is scripts/hermes-maintenance-cron-shim.py. Schedule hermes-maintenance-skill-cron.py; it contains no maintenance logic and always loads the installed published wrapper.
Privacy and publishing rules
This public skill must never contain:
- personal names, usernames, email addresses or chat IDs
- real home-directory paths
- private profile names
- employer, tenant or customer references
- bot usernames or tokens
- API keys, OAuth state or credential fingerprints
- cron IDs, session IDs or database contents
- private repository names or URLs
Use placeholders such as <profile>, <container> and <path>. Before publishing changes, scan the full working tree and Git history. See references/privacy-review.md.
Improving this skill
When this skill is used and you find a generic, reproducible gap, patch the skill and add a regression test. Do not add local profile names, incident transcripts or environment-specific assumptions to the public package.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

