agentleFS
pesappesap/skills/torc/SKILL.md

torc

Skill1 starsChanged 3 months agoMITView on GitHub

Design, preflight, run, debug, install, and operate Torc workflows across local, remote-worker, and Slurm/HPC modes. Use for Torc YAML/KDL/JSON5, FileSpecs, job dependencies, workflow actions, resource requirements, parameterized R2X pipelines, invocation scripts, Slurm submission, remote workers, TORC_API_URL, logs/artifacts, exact-SHA remote runs, Git/LFS, modules, or solver workflows such as PLEXOS. Do not use for generic Slurm, SSH, Git, or solver/model questions without a Torc workflow.

  • Commits and pushes

The file

Show its rules and text

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈11

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 11

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use Torc as the graph and scheduler boundary.

    line 15
  2. Distinctive:

    Read only the reference for the selected mode:

    line 22
  3. Distinctive:

    Inspect before editing: Read the workflow, project instructions, installed Torc help, relevant references, and existing scripts.

    line 39
  4. Distinctive:

    Check expanded counts, job names, file names, scheduler actions, and warnings.

    line 51
  5. Distinctive:

    Smoke test locally: Use a unique temporary output directory:

    line 52
  6. Distinctive:

    Do not use canonical artifacts or shared materialized data for a smoke test.

    line 60
  7. Very specific:

    Submit only from an HPC login node: Use torc hpc detect and torc hpc partitions <profile> for discovery.

    line 61
  8. Very specific:

    Inspect native state first: Check Torc status, jobs, results, resource data, job_stdio, runner logs, and scheduler records before SSH …

    line 65
  9. Distinctive:

    Do not run builds, installs, R2X, PLEXOS, solvers, or workload smoke tests on login nodes.

    line 73
  10. Very specific:

    Keep modules, conda, site bootstrap, and dynamic interpreter selection in an invocation_script or job prologue.

    line 76
  11. Very specific:

    Use native command boundaries (r2x -i/-o), not live pipes or conversion wrappers.

    line 83
  12. Very specific:

    Prefer load-balanced login hosts.

    line 87
  13. Very specific:

    Treat run-remote.sh as a fallback command runner for an existing remote workdir, not as repository synchronization.

    line 89
  14. Distinctive:

    Do not create a helper script for trivial one-command setup.

    line 91
  15. Very specific:

    Use --skip-version-check only as a temporary diagnosis for mismatched Torc versions.

    line 94
  16. Very specific:

    Keep resource_requirements, slurm_schedulers, and matching schedule_nodes in the source spec.

    line 110
  17. Distinctive:

    Keep generated and source specs separate.

    line 126
  18. Very specific:

    Use Torc-native torc remote add-workers, list-workers, run, status, and collect-logs.

    line 131
  19. Distinctive:

    Use the bundled scripts in this order when applicable:

    line 137
  20. Very specific:

    Keep logs, outputs, and metadata.

    line 145
  21. Distinctive:

    Use these scripts instead of rewriting their behavior:

    line 151
  22. Very specific:

    Use the installed Torc CLI's --help as authoritative when this skill and site version differ.

    line 162

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

Torc

Use Torc as the graph and scheduler boundary. Prefer the smallest workflow that solves the current problem, then add control in layers:

local smoke test -> portable HPC workflow -> self-contained Slurm workflow -> exact-SHA run

Read only the reference for the selected mode:

TaskRead
Design a graph or review FileSpecs/actionsreferences/workflow-design.md
Local run or cross-platform local workflowreferences/local.md
ReEDS/R2X/PLEXOS workflowreferences/r2x.md
Slurm detection, generation, or submissionreferences/slurm.md
SSH workers or API tunnelreferences/remote.md
Exact commit, remote worktree, cleanup, or Git LFSreferences/versioned-runs.md
Failure diagnosisreferences/failure-signatures.md

Operating loop

  1. Identify the mode. Choose local direct execution, self-contained Slurm, generated Slurm, remote workers, manual remote fallback, or an exact-SHA remote run. Keep payload/model debugging separate from orchestration.
  2. Inspect before editing. Read the workflow, project instructions, installed Torc help, relevant references, and existing scripts.
  3. Design durable boundaries. Name inputs, intermediate files, final artifacts, resources, and cleanup scope. Prefer FileSpec edges over hidden shell ordering. For R2X, preserve JSON plus _time_series sidecars.
  4. Preflight. Run:

    torc create --dry-run workflow.yaml
    torc -f json create --dry-run workflow.yaml

    Check expanded counts, job names, file names, scheduler actions, and warnings.

  5. Smoke test locally. Use a unique temporary output directory:

    torc -s --in-memory run workflow.yaml \
      --max-parallel-jobs 1 \
      --output-dir <unique-temporary-directory>

    Do not use canonical artifacts or shared materialized data for a smoke test.

  6. Submit only from an HPC login node. Use torc hpc detect and torc hpc partitions <profile> for discovery. Use torc submit directly when the source already has slurm_schedulers and schedule_nodes; otherwise use torc slurm generate and submit the generated spec.
  7. Inspect native state first. Check Torc status, jobs, results, resource data, job_stdio, runner logs, and scheduler records before SSH diagnostics.
  8. Report evidence. State the mode, exact commands, files/jobs/resources/ actions, environment, outputs/logs, and any blocker. Never claim payload success from dry-run or sbatch success alone.

Hard boundaries

  • Do not run builds, installs, R2X, PLEXOS, solvers, or workload smoke tests on login nodes. Login nodes are for inspection, Git/worktree setup, module discovery, Torc preflight, and submission.
  • Keep modules, conda, site bootstrap, and dynamic interpreter selection in an invocation_script or job prologue. End wrappers with exec "$@".
  • Workflow variables use {name} substitution. Workflow env values are literal strings; they do not run $(...), $TMPDIR, or other shell logic.
  • Quote paths. Do not use ${VAR:-default} in workflow commands or env values. For cross-platform local specs, use concrete forward-slash paths and tools available on the target OS; avoid Bash-only cleanup and heredocs.
  • Use native command boundaries (r2x -i/-o), not live pipes or conversion wrappers. Validators read artifacts and never repair or rewrite them.
  • Move code to HPC by Git commit/ref and isolated worktree, not rsyncing the whole repository or datasets. Keep large data on explicit remote paths.
  • Prefer load-balanced login hosts. For NLR Kestrel use kestrel.hpc.nlr.gov, not kl1/kl2/kl3, unless the user requests otherwise.
  • Treat run-remote.sh as a fallback command runner for an existing remote workdir, not as repository synchronization.
  • Do not create a helper script for trivial one-command setup. Prefer a Torc action or direct job command; add a script only when setup is fragile, repeated, or needs independent testing.
  • Use --skip-version-check only as a temporary diagnosis for mismatched Torc versions; fix the installation instead.

Mode boundaries

Local

A local-only workflow normally needs no resource_requirements, execution_config, slurm_schedulers, or schedule_nodes. Use a Torc workflow-start action only for trivial setup such as untarring. Actions are not job dependency edges: if setup failure must block downstream work, use a materialize job and a completion marker instead. See references/local.md and references/r2x.md.

Self-contained Slurm

Keep resource_requirements, slurm_schedulers, and matching schedule_nodes in the source spec. Prefer on_jobs_ready tied to the allocation's root jobs; use on_workflow_complete for narrowly scoped cleanup. Submit the source spec directly after dry-run validation.

Generated Slurm

For a portable workflow without site policy:

torc slurm generate --account <account> --profile <profile> \
  workflow.yaml -o <generated>.yaml
torc create --dry-run <generated>.yaml
torc submit --no-prompts -o /scratch/$USER/torc-output <generated>.yaml

Keep generated and source specs separate. Use the direct pipe only when the scheduler output does not need review or reuse.

Remote workers

Use Torc-native torc remote add-workers, list-workers, run, status, and collect-logs. Verify worker Torc versions and the full TORC_API_URL from the workers' network context before debugging payloads.

Exact-SHA remote runs

Use the bundled scripts in this order when applicable:

  1. setup-hpc-git-remote.sh for a bare transport repo;
  2. git push hpc ... for the exact run ref;
  3. prepare-git-run.sh for an isolated worktree;
  4. deploy-git-torc-slurm.sh for direct exact-SHA submission; and
  5. cleanup-worktree.sh after outputs are safe.

Keep logs, outputs, and metadata; remove only temporary worktrees and prune metadata. Delete run refs only with explicit intent. Read references/versioned-runs.md for commands and failure recovery.

Bundled tooling

Use these scripts instead of rewriting their behavior:

  • doctor.sh / doctor.cmd — local and optional remote preflight;
  • install-latest-torc.sh — user-local Torc installation;
  • setup-hpc-git-remote.sh — configure a bare Git transport remote;
  • prepare-git-run.sh — materialize an exact-SHA worktree;
  • deploy-git-torc-slurm.sh — submit from an exact-SHA worktree;
  • push-run-cleanup.sh — push, prepare, orchestrate, fetch, and clean;
  • run-remote.sh / .cmd — manual fallback for an existing remote workdir;
  • cleanup-worktree.sh / .cmd — safe worktree cleanup.

Use the installed Torc CLI's --help as authoritative when this skill and site version differ. Do not preload every reference or inspect every helper.

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.