agentleFS
JiamingShi-JsPhysJiamingShi-JsPhys/agent-skills/skills/multi-dim-manager/SKILL.md

multi-dim-manager

Skill4 starsChanged 24 days agoMITView on GitHub

State manager for multi-dimensional computational experiments. Iterate a parameter grid over many rounds, snapshot declared critical files each round, audit every round (params, hashes, timestamps, status), and roll back to any round non-destructively. Use it when a workflow runs hundreds of rounds across multiple parameter dimensions and needs per-round snapshots, full audit trail, and arbitrary rollback - e.g. longitudinal studies, parameter scans, or symbolic/ numerical sweeps calling external solvers (Mathematica, GAP, SymPy, custom scripts).

  • Installs packages

1 other project uses a version of this.

Adopted by

Most recently taken up by

  • Other versions1 project uses a version of this.

    Word for word · 0

    None found.

    Edited · 0

    None found.

    Wrote their own version · 1

    1. JiamingShi-JsPhys/chelate-shell★ 10same 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.

  • In this repository6 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

9 rules. About 0 are common, 4 are distinctive, and 5 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈4

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before the first run, probe the runtime deps for this skill:

    line 122
  2. Very specific:

    If PyYAML is missing and the user's config is YAML, tell them and ask whether to pip install pyyaml.

    line 128
  3. Distinctive:

    Follow these steps in order whenever the user asks to run, inspect, or

    line 138
  4. Very specific:

    Load the config: Read the experiment config (config.example.yaml

    line 150
  5. Very specific:

    Prefer a dry run: Run python scripts/run.py dryrun --config <cfg>

    line 174
  6. Very specific:

    Execute the sweep: Run python scripts/run.py run --config <cfg>.

    line 186
  7. Distinctive:

    React to failure correctly: If a round's plugin exits non-zero,

    line 202
  8. Very specific:

    Summarize: After the sweep the skill writes results_summary.csv,

    line 222
  9. Distinctive:

    Never compute the result yourself: All domain math belongs in the

    line 262

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

multi-dim-manager

A self-contained skill that brings order to the state of long-running,

multi-dimensional computational experiments. Your compute plugin does the

math; this skill manages the surrounding chaos: iteration, snapshots,

audit, and rollback.

The skill only orchestrates. It never computes a result itself - every

number comes from your plugin.

When to use

  • A workflow runs many rounds over a parameter space (a Cartesian grid of

    dimensions) and needs each round's state recorded.

  • Per-round snapshots of declared critical files are required before and

    after each round.

  • A full audit trail (params, hashes, timestamps, status) must exist for

    every round.

  • The user must be able to roll back to any past round, non-destructively.
  • Typical shapes: longitudinal studies, parameter scans, or symbolic /

    numerical sweeps calling external solvers (Mathematica, GAP, SymPy,

    custom scripts).

MANDATORY WORKFLOW

Dependency bootstrap (run on first use)

Before the first run, probe the runtime deps for this skill:

  • Core: pure standard library — no install required.
  • Optional: PyYAML (only when the config is a .yaml; JSON configs work with the standard library alone).

If PyYAML is missing and the user's config is YAML, tell them and ask whether to pip install pyyaml; install only after they confirm. Never install into the global environment without explicit consent.

Follow these steps in order whenever the user asks to run, inspect, or

recover a multi-dimensional experiment.

  1. Load the config. Read the experiment config (config.example.yaml

    is the template). Confirm param_space.dimensions, critical_paths,

    and the plugin.command are present. If YAML is used, PyYAML must be

    installed; otherwise use JSON.

  2. Expand the space. Enumerate the Cartesian product of all

    dimensions. Report the total round count to the user before executing.

  3. Prefer a dry run. Run python scripts/run.py dryrun --config <cfg>

    so the user sees the full plan (every parameter combination) without

    any side effect. Only proceed to execution after they confirm.

  4. Execute the sweep. Run python scripts/run.py run --config <cfg>.

    For each round, in order: snapshot the declared critical paths

    before, invoke the plugin, snapshot after, and append one audit

    record.

  5. React to failure correctly. If a round's plugin exits non-zero,

    record its status (failed/error). When auto_rollback is on,

    recover the last successful round's post-state into the working

    directory so later rounds start clean; this recovery is itself

    audited. Do not stop the whole sweep on a single bad combination.

  6. Summarize. After the sweep the skill writes results_summary.csv,

    results_summary.md, report_draft.md, and run_metadata.json under

    the output directory. Point the user at these.

  7. Recover on request. To restore a past round, run

    python scripts/run.py rollback --config <cfg> --round <N>. By default

    it restores into a NEW directory; only add --force when the user

    explicitly wants the live working directory overwritten.

Hard constraints

  • Never compute the result yourself. All domain math belongs in the

    user plugin. The skill only calls it and records the contract outcome.

  • Snapshot only declared critical paths. A full working-directory copy

    is never taken; content is stored addressed by hash, so unchanged files

    cost nothing extra.

  • Rollback is non-destructive by default. Without --force the live

    working directory is never modified; the restored state lands in a new

    directory. Every rollback (manual or automatic) is written to the audit

    log.

  • Determinism is the user's promise. The skill guarantees the

    orchestration is reproducible (same params -> same recorded plan,

    same hashes). It cannot make a non-deterministic plugin deterministic;

    see Limitations.

Usage examples




# Print the full round plan without any side effect (always do this first).



python scripts/run.py dryrun --config config.example.yaml







# Execute the sweep.



python scripts/run.py run --config config.example.yaml







# Restore a past round (into a NEW directory unless --force).



python scripts/run.py rollback --config config.example.yaml --round 7







# Regenerate the summaries, or verify one round's outcome.



python scripts/run.py summary --config config.example.yaml



python scripts/run.py verify --config config.example.yaml --round 7


Plugin contract

The manager launches exactly one shell command per round:




python your_plugin.py --params {PARAMS} --out {OUT}


  • {PARAMS} - path to a JSON file with this round's parameter

    combination.

  • {OUT} - path the plugin MUST write its result JSON to.
  • Exit codes: 0 success, 1 assertion failed / check failed, 2 error

    or skipped.

Any external solver (Mathematica, GAP, a Python LMM script) is wrapped to

honor this contract: it reads the params file and writes a result file.

The skill does not care what is computed.

Failure handling

  • A round whose plugin exits 1 is marked failed; exit 2 is error.

    Both are kept in the audit log; the sweep continues.

  • config errors (missing space, bad YAML, missing {OUT}) abort before

    any side effect and print a clear message (exit code 2).

  • rollback to a round that was never recorded, or has no post-snapshot,

    fails with a clear error rather than corrupting state.

Limitations

  • Determinism is orchestration-layer only. The manager records hashes

    and replays the same plan for the same params, but it cannot enforce

    that the plugin is deterministic. If the plugin touches the network,

    uses random seeds, or reads the wall clock, the same inputs may yield

    different outputs. Declare such non-determinism in the plugin yourself.

  • Critical paths must be declared up front. Files not listed in

    critical_paths are never snapshotted and therefore cannot be rolled

    back.

  • Golden-output verification is v0.2. The current verifier only

    checks the plugin contract (exit 0 + result file present). Comparison

    against a known expected output is planned but not yet implemented.

  • YAML configs need PyYAML. JSON configs work with the standard

    library alone.

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.