agentleFS
m3sserstudi0sm3sserstudi0s/swiparr/docs/agents.md

swiparr

AGENTS.md799 starsChanged 12 days agoMITView on GitHub

Messer Swipe can be driven by an agent — yours, or one you point at it later. The surface is a CLI that ships inside the container and a small JSON API behind it. No plugin, no protocol handshake, no separate service. That is the whole setup. The container mints a local agent token the first time an administrator logs in, writes it beside the database (/app/data/.agent-token, 0600), and the CLI picks it up automatically. Nothing to copy, nothing to…

  • 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,196 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

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

  • 1

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No plugin, no protocol handshake, no separate service.

    line 5
  2. Very specific:

    Every response is { ok, api, data, meta } or { ok, api, error: { code, message, hint } }.

    line 78

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

Agents

Messer Swipe can be driven by an agent — yours, or one you point at it later. The surface is a CLI that ships inside the container and a small JSON API behind it. No plugin, no protocol handshake, no separate service.

The one command

docker exec messer-swipe messer-swipe status

That is the whole setup. The container mints a local agent token the first time an administrator logs in, writes it beside the database (/app/data/.agent-token, 0600), and the CLI picks it up automatically. Nothing to copy, nothing to configure.

docker exec messer-swipe messer-swipe status --human
docker exec messer-swipe messer-swipe libraries      # what the provider exposes, and what is included
docker exec messer-swipe messer-swipe deck --why     # the first cards, and why there are none
docker exec messer-swipe messer-swipe diag > diag.json   # redacted bundle for a bug report

--human prints a summary; without it you get JSON, because the caller is usually an agent. Every command takes --url, --token and --base-path for a remote instance.

deck --why is the one that answers the support question: it separates an empty deck caused by an excluded library, an exhausted deck, a filter that matches nothing, and a provider that never answered — four failures the UI renders identically.

From outside the container

An agent that is not on the Docker host — a bot in another container, a laptop, a scheduled job on another machine — uses the same API over HTTP with its own token:

MESSER_SWIPE_URL=https://swipe.example.com \
MESSER_SWIPE_TOKEN=msw_… \
  node /path/to/bin/messer-swipe.mjs status

Tokens are created from the container CLI — there is no UI for it, because the person setting up an instance is already at a shell. The plaintext is shown once:

docker exec messer-swipe messer-swipe token list
docker exec messer-swipe messer-swipe token create laptop --scope read
docker exec messer-swipe messer-swipe token revoke <prefix-or-id>

Scopes:

ScopeMay
readread status, libraries, decks, sessions, logs
writeread, plus reversible changes (settings, cache)
adminwrite, plus destructive changes and token management

A token acts as the member who created it. Revoking is instant: the row is marked revoked, the audit trail stays.

What a token is worth

A token is a member's credential, not a second permission system. It can read what that member can read and change what that member can change — so treat msw_… like a session cookie, and prefer read unless the agent genuinely needs to write.

The local token is minted for the administrator and carries that administrator's provider credential (encrypted with the instance's auth secret) so that provider-backed answers — a deck preview, a library list — work without a browser. If you would rather not store that, revoke the local token (messer-swipe token revoke <prefix>); the container will not mint another until an administrator logs in again, and the provider-backed commands will answer PROVIDER_AUTH_REQUIRED.

The contract

  • GET /api/v1/status — version, provider, uptime, database, and which token is asking.
  • Every response is { ok, api, data, meta } or { ok, api, error: { code, message, hint } }.
  • api is the contract version. A client that does not understand it should refuse to guess rather than parse optimistically.
  • Exit codes: 0 ok, 1 failure, 2 usage, 3 auth, 4 not found, 5 provider or network. Branch on the code, not on the message.

Turning it off

AGENT_API=off makes /api/v1/* answer 404 with AGENT_API_DISABLED. It does not delete tokens; unset it to turn the surface back on.

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.