agentleFS
memgraftermemgrafter/skills-flatagents/flatmachine-manager/SKILL.md

flatmachine-manager

Skill3 starsChanged 8 months agoApache-2.0View on GitHub

Prefer using these tools when creating, updating, or inspecting FlatMachine workflow configs — each operation is automatically validated, versioned, and one command.

The file

We split this skill into the rules it gives an agent

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈1

    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. Distinctive:

    Stop writing FlatMachine YAML by hand.

    line 9
  2. Very specific:

    Every create and update is automatically validated and versioned — rollback is one diff + duplicate away

    line 14
  3. Very specific:

    Update operations for update --op: add_state, remove_state, update_state, add_agent, update_agent, update_context, update_setting.

    line 107

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

Stop writing FlatMachine YAML by hand. Pick a template, parameterize it, get a validated config with rollback.

Why use it

  • You never touch YAML — templates are valid by construction, you just set names/agents/purpose
  • Every create and update is automatically validated and versioned — rollback is one diff + duplicate away
  • Catches broken Jinja templates, missing states, dead transitions, and best-practice violations before they hit runtime
  • Checkpoint bloat from terminated machines is cleaned up with cull — no manual SQL

When to use

  • You need a new workflow (agent loop, pipeline, writer-critic, OODA, signal-wait, worker pool)
  • You're modifying an existing machine and want the change tracked
  • You want to compare two versions of a config
  • You need to fork a machine for experimentation
  • Checkpoint DB is growing and you want to reclaim space

When NOT to use

  • You're editing non-FlatMachine files
  • The machine is already running inside the AgentHarness runtime with first-class tool control

Usage

./skills/flatmachine-manager/run.sh <action> [options]

Common options: --db <path> (registry DB, default ~/.agents/machine-manager/machine_manager.db), --json (machine-parseable output).

Examples

# Run a machine from the registry
./skills/flatmachine-manager/run.sh start --name tagline-writer \
  --input '{"task": "write a tagline for a CLI tool"}'

# Run with a specific working directory
./skills/flatmachine-manager/run.sh start --name my-bot \
  --input '{"task": "fix the bug"}' --working-dir /path/to/project

# Create a writer-critic machine
./skills/flatmachine-manager/run.sh create \
  --name "tagline-writer" \
  --template writer-critic \
  --description "Generate and refine product taglines" \
  --agent "You are a creative copywriter who generates memorable taglines:writer:creative taglines:smart" \
  --agent "You score tagline clarity and memorability on a 1-10 scale:critic:score clarity and memorability:fast"

# Add a human review gate
./skills/flatmachine-manager/run.sh update \
  --name tagline-writer \
  --op add_state \
  --param state_name=human_review \
  --param after_state=review \
  --description "Add human approval gate"

# Validate before shipping
./skills/flatmachine-manager/run.sh validate --name tagline-writer

# Compare what changed
./skills/flatmachine-manager/run.sh diff --name tagline-writer --v1 1 --v2 2

# Fork for experimentation
./skills/flatmachine-manager/run.sh duplicate \
  --source tagline-writer --target tagline-writer-v2

# List, inspect, retire
./skills/flatmachine-manager/run.sh list
./skills/flatmachine-manager/run.sh get --name tagline-writer
./skills/flatmachine-manager/run.sh deprecate --name tagline-writer

# Pick a model profile
./skills/flatmachine-manager/run.sh select-model --purpose creative

# Maintenance — clean up checkpoint bloat (no LLM, direct SQL)
./skills/flatmachine-manager/run.sh cull-stats --machine-db ./my-machine.sqlite
./skills/flatmachine-manager/run.sh cull-trim --machine-db ./my-machine.sqlite
./skills/flatmachine-manager/run.sh cull-purge --machine-db ./my-machine.sqlite --older-than 7

# List available tools (shows alias + current Tool ID)
./skills/flatmachine-manager/run.sh list-tools
./skills/flatmachine-manager/run.sh list-tools --provider cli-tools
./skills/flatmachine-manager/run.sh list-tools --include-deprecated

# Hide/restore a tool for new machine creation
./skills/flatmachine-manager/run.sh deprecate-tool --name bash
./skills/flatmachine-manager/run.sh undeprecate-tool --name bash

# Health check
./skills/flatmachine-manager/run.sh doctor

Agent shorthand for create: --agent "system:name:purpose:profile" (repeatable, system required). System prompt is the first field and cannot be empty. Use --system "prompt" when the system prompt contains colons. Use --tools read,bash to limit which CLI tools are available (default: all of read, bash, write, edit).

Update operations for update --op: add_state, remove_state, update_state, add_agent, update_agent, update_context, update_setting. Params via --param key=value.

Templates: tool-loop, writer-critic, ooda-workflow, pipeline, signal-wait, distributed-worker.

Output

  • Human-readable markdown by default, --json for scripting
  • Non-zero exit on errors
  • Validation surfaces: schema errors, Jinja issues, best-practice violations, unreachable states

How it works (brief)

  1. run.sh bootstraps (applies schema.sql on first run, installs package if needed) then dispatches to Python CLI
  2. start executes the machine's embedded config from the selected registry version (no temp-file ref resolution)
  3. Tool registry stores immutable tool definitions keyed by Tool ID, with alias names (e.g. create_machine) pointing to the current definition
  4. Cull commands operate directly on machine SQLite DBs, no LLM involved

Running the manager machine

python/src/flatmachine_manager/main.py still provides an interactive standalone manager machine for terminal use. For agent-driven workflows, use run.sh subcommands directly (and run.sh start when you want to execute a registry machine).

Cost / benefit summary

  • Cost: constrained to templates and structured mutations — no freeform YAML editing
  • Benefit: zero hallucination risk, automatic validation, full version history, checkpoint cleanup — configs are correct by construction

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.