agentleFS
WillEhrendreichWillEhrendreich/SageFs/skills/sagefs/agents.md

SageFs / sagefs

AGENTS.md90 starsChanged 3 days agoMITView on GitHub

Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL. If the user says "back to the REPL", "mandate 1", or invokes the SageFs back_to_the_repl prompt, you've drifted. Stop what you're doing, name the step where you left the loop, and pick the loop back up from the REPL. Don't argue it, and don't finish the slow way first. Sub-agents don't inherit any of this.…

  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about code style.

    Of the AGENTS.md files we read, the 35,337 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.

  • In this repository3 other files it gives its agents.

The file

We split this agents.md into the rules it gives an agent

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

  • 5

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL.

    line 3
  2. Very specific:

    If the user says "back to the REPL", "mandate 1", or invokes the SageFs back_to_the_repl prompt, you've drifted.

    line 7
  3. Very specific:

    Wait for that session's get_session_status to say Ready

    line 20
  4. Very specific:

    if the REPL will not load a session, say so in the report with the exact error.

    line 27
  5. Very specific:

    no worktree unless the work must not touch the trunk.

    line 38
  6. Very specific:

    Put eval "$(sagefs member mint --role Implementer --dir "$PWD" --print-env SAGEFS_MEMBER_TOKEN)" in the brief's setup, or pass --token-file …

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 45,344 AGENTS.md 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
agents.md

Sub-agents and getting back on track

Read this when you are writing a brief for a sub-agent that will touch F#, or the user says you have drifted off the REPL.

Getting back on track

If the user says "back to the REPL", "mandate 1", or invokes the SageFs back_to_the_repl prompt, you've drifted. Stop what you're doing, name the step where you left the loop, and pick the loop back up from the REPL. Don't argue it, and don't finish the slow way first.

Briefing another agent

Sub-agents don't inherit any of this. Every brief for F# work must include the loop explicitly:

  1. get_daemon_status, then get_available_projects and the matching create_project_session / create_solution_session / create_bare_session for the agent's own worktree
  2. Wait for that session's get_session_status to say Ready
  3. show the failure with send_fsharp_code
  4. make it pass with send_fsharp_code
  5. persist to the file
  6. hard_reset_fsi_session with rebuild=true
  7. re-verify, then commit
  8. dotnet only as the final gate, run in the BACKGROUND, do not block on it
  9. if the REPL will not load a session, say so in the report with the exact error. In the SageFs repo itself that is a bug in the thing being worked on: fix it or file it with the paths it names before going on, do not build around it. Anywhere else report it and use dotnet for that one step only. Never write "use the REPL where it works, otherwise fall back" into a brief: it is a permission slip and agents take it. Ask for the actual send_fsharp_code submissions in the report as the evidence the loop was used; "I used dotnet build" is not that evidence
  10. edit with exact editor calls, never sed/python/bulk regex; prove the change in the REPL before persisting it
  11. finish by removing nothing you do not own, and report your worktree path and branch so the orchestrator can reap them (tidy_workspace)
  12. no worktree unless the work must not touch the trunk. An agent that reads or edits a file or two works in the shared checkout under a claim (acquire_claim). A worktree is the exception that gets a ledger entry: the daemon records who made it, saves its uncommitted files to refs/sagefs/salvage/<name>, and removes it only after its work has reached the base branch and it has been quiet for a day. Work that exists nowhere else is listed first by sagefs hygiene, and sagefs hygiene --rescue <name> puts it on a branch

The easiest way is to tell it to load this skill.

When the agent's client has no SageFs tools

A client configured with an HTTP URL loses its SageFs tools when the daemon restarts, because the restart ends the one session id the client holds (claude mcp add sagefs -- sagefs mcp is the durable fix on the client's side). A sub-agent in that state still has the loop: sagefs call reaches every tool from a shell.

  • sagefs call --list shows the tools. sagefs call <tool> --<parameter> <value> calls one; --json '{...}' passes the arguments as an object. A name the tool does not have is refused with the names it does.
  • Put eval "$(sagefs member mint --role Implementer --dir "$PWD" --print-env SAGEFS_MEMBER_TOKEN)" in the brief's setup, or pass --token-file <path>. Every call is a new connection, so with no token a session one call made cannot be stopped by the next, and stop_session is refused. With the token every call is the same member. Do not pass --token <token>: it prints a warning, because the token lands in the process list and the shell history.
  • The answer is on stdout. A tool error is on stderr with exit code 1. Read the exit code.

When the cohort's conductor seat is empty

get_cohort_status says VACANT when the conductor left, was revoked or went silent, and nobody holds the conductor's tools until a person says who does. A seated member can ask: seat_conductor (it takes toMember, default yourself, and working_directory of your repository) puts the question to the person at your client, naming the repository, who would sit, who held the seat and why it is empty. Only their explicit yes seats anyone.

  • A decline, a dismissal, no answer and a client that offers no elicitation all refuse, and nothing changes. Do not ask again unless the person tells you to. The refusal names the other routes: sagefs cohort seat <member id> from a shell on the machine that runs the daemon, and the Seat button on the dashboard's cohort panel.
  • A seat that is held by a conductor whose connection is gone (get_cohort_status says the holder is silent and for how long) is replaced the same way: call seat_conductor with replaces set to that holder's member id. The person is asked, with the holder and its silence named, and only their explicit yes moves the seat. A holder that is not the holder any more is refused with the actual holder named, and the former holder stays a member with its claims.
  • Under a member token the tool is not callable, and a member under a token is never the one seated. If you hold a token, the person seats a member that joined on its own connection.
  • Meanwhile do what needs no conductor: acquire_claim, release_claim, request_landing, withdraw_landing, veto_landing.

When a scope is shut by a member that went quiet

acquire_claim is refused while a member holds the scope, and a member that has gone silent keeps its claims until its lease lapses (30 minutes). get_cohort_status marks such a claim | clearable: ... on its line: its holder has had no open stream and no call for two minutes, or nobody holds it. If you are the conductor, call release_claim with that claim's id and the fence on the same line. Naming a claim that is not yours is a clear. It is refused while the holder is here (the refusal says how long it has been silent), and the old holder's late release_claim is refused as stale. If you are not the conductor, ask the conductor; do not retry. A landing the holder had queued is blocked as stale when it reaches the front: withdraw it and request it again. A call under a member token never clears.

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.