agentleFS
dsp-drdsp-dr/guile-skills/skills/repl-eval/SKILL.md

repl-eval

Skill0 starsChanged 46 days agoMITView on GitHub

Evaluate Scheme in a running Guile REPL over its socket, and use tracing, breakpoints, macro expansion and profiling from it. Use whenever a claim about Guile code should be checked by running it - before asserting an API exists, after editing a module, or when asked what shape a recursion has.

The file

We split this skill into the rules it gives an agent

1 rule. About 0 are common, 1 is distinctive, and 0 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.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Do not conclude the variable is unbound.

    line 73

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

Evaluate before you assert

The failure this prevents is claiming success without running anything — the second most-policed anti-pattern across 75 close-read Clojure skills, and identical in Guile. The socket REPL is what makes "verified" checkable.

sh ${CLAUDE_SKILL_DIR}/scripts/guile-repl-eval.sh '(+ 1 1)'                   # => $1 = 2
sh ${CLAUDE_SKILL_DIR}/scripts/guile-repl-eval.sh '(use-modules (my mod)) (my-proc 3)'
echo '(assoc-ref my-alist "k")' | sh ${CLAUDE_SKILL_DIR}/scripts/guile-repl-eval.sh
sh ${CLAUDE_SKILL_DIR}/scripts/guile-repl-eval.sh --raw ',trace (fib 4)'      # keep banner and prompt
sh ${CLAUDE_SKILL_DIR}/scripts/guile-repl-eval.sh --direct '(+ 1 1)'          # bypass the proxy, no log

Output is stripped of the eight-line banner and the trailing prompt, so what you read back is the value.

What the REPL gives you beyond eval

AskMeta-commandAnswers
what shape is this process?,trace FORMindented call tree with arguments and returns
how does it grow?,time FORMreal, run and GC time separately
where does the time go?,profile FORMflat profile, self and cumulative
what did the macro expander do?,expand FORMexpanded source
what did the optimiser do?,optimize FORMpartially evaluated source
what bytecode?,disassemble PROCVM instructions
stop here,break PROC then ,btbreakpoint, backtrace

Traps that will mislead you

  • ,profile on a fast form prints No samples recorded. It is a sampling profiler with nothing to sample, not a broken profiler. Use a workload of at least ~0.5 s.
  • ,locals reports only variables that are still live. At a ,break (procedure entry) nothing is live yet, so it says "No local variables"; after ,step an argument already used shows as _. Read arguments from ,bt or ,frame, or ,up into the caller (Guile 3.0.10 system/vm/frame.scm:213-301). Do not conclude the variable is unbound.
  • ,locals can crash the whole REPL. Measured on Guile 3.0.10 (Homebrew, macOS): after an error inside a let whose binding holds an unboxed number, ,up then ,locals printed one variable and the process died with SIGSEGV (status 139). Everyone attached to that REPL, a Geiser session included, loses it. Prefer ,bt and ,frame on a shared REPL.
  • Connections share one Guile image. Each connection gets its own REPL loop, but top-level definitions go into the shared (guile-user) module, and the $N history keeps counting across connections. Measured on 0.4.0: (define x 42) on one connection, then x on the next, returned 42, through the proxy and on the raw port alike. So a define from an agent lands in the human's Geiser session too. Clean up what you define, or work inside your own module. A new connection does not reload a changed module; see the next point.
  • Reload after editing. A module already loaded does not pick up file changes: (reload-module (resolve-module '(my mod))). Redefining a record type or a GOOPS class leaves existing instances on the old definition.
  • There is no linter. guild3 compile -W 3 -o /tmp/x.go file.scm gives warnings, and that is the whole story — no clj-kondo equivalent exists. Never instruct anyone to "run the linter". (-o /dev/null always fails: guild renames a temp file into place.)

Documentation

Full write-up, including the three binary names this probes across FreeBSD, Debian/Ubuntu and Homebrew: https://wal.sh/tools/plugins/guile-skills/ Source and issues: https://github.com/dsp-dr/guile-skills

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.