agentleFS
DshamirDshamir/slm-forge/skills/forge-monitor/SKILL.md

forge-monitor

Skill1 starsChanged 6 months agoMITView on GitHub

Single-shot poll of the running training job — checks PID liveness via SSM, parses loss + step from the last 200 lines of train.log, syncs newly-completed checkpoints to S3, computes ETA. Returns in-progress / completed / failed; dispatch-v2 re-invokes on a 120s interval until terminal. 60s silent-OOM detector hard-fails on stuck launches.

We split this skill into the rules it gives an agent

2 rules. About 0 are common, 0 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈0

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

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

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

    Read tail (200 lines) of /workspace/logs/train.log via SSM

    line 19
  2. Very specific:

    Update manifest.training_runtime heartbeat fields

    line 25

≈ “Common” is an estimate: at least 1 in 5 of the 308,232 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

forge-monitor

When this fires

Phase position: MONITOR — after forge-train. dispatch-v2 polls this skill on a 120-second interval (configurable via FORGE_MONITOR_POLL_SECONDS) until it returns terminal status.

What it does

Each invocation is stateless and single-shot:

  1. ssm exec "ps -p $PID" to check PID liveness on the instance
  2. Read tail (200 lines) of /workspace/logs/train.log via SSM
  3. Parse the last loss + step — also detect "no progress" (PID alive but loss/step unchanged for > 60 s → silent OOM / hang → fail)
  4. Detect new checkpoints under /workspace/checkpoints/ and trigger async aws s3 sync to s3://.../checkpoints/
  5. Compute ETA = (max_steps − current_step) × seconds_per_step
  6. Update manifest.training_runtime heartbeat fields
  7. Decision matrix:
    • alive + no final-weights yet → return in-progress (dispatcher loops)
    • dead + final weights synced → return completed, advance to EVAL
    • dead + no final weights → return failed (recoverable via forge-resume)

Inputs

  • $1 = forge-id
  • manifest.training_runtime.{pid, instance_id}
  • Remote /workspace/logs/train.log

Outputs

  • manifest.training_runtime.{last_loss, last_step, eta_minutes, last_checkpoint_step, last_heartbeat}
  • On completion: manifest.artifacts.{final_weights_s3, checkpoints_s3}
  • On completion: manifest.state.current_phase = EVAL

Idempotency

Stateless — each call is a fresh poll. Safe to invoke any number of times.

Failure modes

ExitReasonRecoverable?
0in-progress OR completed cleanly–
1PID alive 60+ s with no loss/step movement (silent OOM/hang) OR PID dead without final weights (training crashed)yes — try forge-resume
64no forge-id providedno

External resources

  • AWS EC2 (SSM RunCommand for ps, tail, ls)
  • AWS S3 (sync checkpoints + final weights)

Cost class

spends GPU time — instance is still running and billing.

Depends on

forge-train (PID + log path required)

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.

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.