agentleFS
patrickbdevaneypatrickbdevaney/hermes-max/skills/workflow-long-running-processes/SKILL.md

workflow-long-running-processes

Skill1 starsChanged 6 months agoMITView on GitHub

How to handle servers, daemons, watchers — anything that runs indefinitely.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    When starting a Flask/FastAPI/uvicorn/node/webpack/any server or watcher:

    line 14
  2. Very specific:

    Start it backgrounded (append & or use the background-process tool) and capture the PID.

    line 15
  3. Distinctive:

    DO NOT poll it to completion.

    line 16
  4. Distinctive:

    Wait 2-3 seconds for startup, then TEST IT ONCE:

    line 17
  5. Very specific:

    check the port is listening → ss -ltn | grep <port>

    line 19
  6. Very specific:

    If the watchdog is unavailable, fall back to the single-probe rule above: one curl -m 5, and if it responds, the subtask is DONE.

    line 27
  7. Distinctive:

    NEVER wait more than ~10 seconds, and NEVER call check_stall in a loop.

    line 29

≈ “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.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md
<!-- TRIGGERS WHEN: How to handle servers, daemons, watchers — anything that runs indefinitely. -->

A running server is SUCCESS, not a hang. Never poll a process that never ends.

The per-tool wall-clock timeout is short (native terminal.timeout ≈ 120s) precisely so a blocked poll cannot hang forever. That backstop is only safe if you follow the backgrounded + check_stall-once pattern — never block synchronously on a process that may not return.

When starting a Flask/FastAPI/uvicorn/node/webpack/any server or watcher:

  • Start it backgrounded (append & or use the background-process tool) and capture the PID.
  • DO NOT poll it to completion. It will NEVER complete — that is its job. Polling it = infinite hang.
  • Wait 2-3 seconds for startup, then TEST IT ONCE:
    • HTTP server → curl -s -m 5 http://localhost:<port>/<known-route> (use -m 5 timeout!)
    • check the port is listening → ss -ltn | grep <port>
  • Then call the watchdog EXACTLY ONCE to classify it (do not loop): mcp_hermes_max_watchdog_check_stall(tool_name="<server>", elapsed_s=<since start>, expecting_heartbeat=true, last_heartbeat_age_s=<since last log line/probe>).
    • waiting: true → it is serving/heartbeating. That is SUCCESS — leave it running, record the PID (kill <pid> later), move on. NEVER kill a heartbeating process (the false-kill trap).
    • hung: true → it is silent past its budget and really is stuck. Kill it and try another approach (go to workflow-stuck-detect-reset).
  • If the watchdog is unavailable, fall back to the single-probe rule above: one curl -m 5, and if it responds, the subtask is DONE.
  • NEVER wait more than ~10 seconds, and NEVER call check_stall in a loop.
  • Any command with no natural exit (tail -f, watch, serve, dev) → same rule: start, test once, classify once, move on. A truly long but finite job (big build, full test suite) → background it too and check_stall once, rather than risking the 120s terminal timeout mid-run.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.