agentleFS
Mercatura-ForumMercatura-Forum/thebes-agent-kit/AGENTS.md

thebes-agent-kit

AGENTS.md0 starsChanged 12 days agoApache-2.0View on GitHub

This repository is the starting point for an AI agent that builds, deploys and runs applications on Thebes. Read this file first, then index.json. Thebes is a Layer 1 chain where an application is a set of smart contracts. A backend contract is written in Motoko or Rust and keeps its state on the chain; the frontend is a web contract that serves the pages and assets. People sign in with a passkey through Memphis, the identity contract. There is…

  • Pipes a download into a shell
  • 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 31,700 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 repositoryOne other file it gives its agents.

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    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. Very specific:

    Every new developer account starts with free credits, enough for a few deploys, so a first application can be deployed with --metered …

    line 84
  2. Distinctive:

    Ask the person to do this step.

    line 92
  3. Distinctive:

    Confirm a write before reading it back: Use the update's own reply, or repeat the query until it shows the write.

    line 111
  4. Very specific:

    Check before you deploy: Run thebes-deploy build and read the result before deploy.

    line 113

≈ “Common” is an estimate: at least 1 in 5 of the 40,246 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.md — building on Thebes

This repository is the starting point for an AI agent that builds, deploys and runs applications on Thebes. Read this file first, then index.json.

What Thebes is

Thebes is a Layer 1 chain where an application is a set of smart contracts. A backend contract is written in Motoko or Rust and keeps its state on the chain; the frontend is a web contract that serves the pages and assets. People sign in with a passkey through Memphis, the identity contract. There is no server and no database to run.

How to use this repository

FileWhat it gives you
index.jsonEvery example application, every module and every CLI command, with exact method signatures. Generated from the repositories at pinned commits.
interfaces/<example>/<contract>.didThe Candid interface of each example backend, produced by the Motoko compiler.
catalog/platform.jsonThe platform capabilities and where each is documented.
llms.txtThe same map as a short list of links.

index.json in brief:

  • examples[]: id, shows (what the app does), guard (the correctness rule it enforces), live (a running copy), repo + ref, contracts[] (each with cid, methods[] of {name, kind, signature, doc}), and uses (the thebes-lib modules, @thebes/sdk exports and platform calls it relies on).
  • capabilities[]: what the platform offers, the rules that apply, the docs, and used_by (examples that use it).
  • starters[]: small single-contract examples in Motoko and Rust.
  • lib, sdk: the shared backend library and frontend SDK, with every public function and export.
  • cli.commands[]: every thebes-deploy command.

Pick a starting point

You are buildingStart fromAdd
a shop with a catalogue and ordersstoreinvoices
reservations, slots, depositsbooking
a community or chatchat
invoices and payments receivedinvoicing
points and rewardsloyalty
a sales pipelinecrm
a personal or team ledgerfinance
orders for a restaurant or kitchenrestaurantinvoices
courses, enrolment, transcriptsuniversity
a game that needs a fair shufflecardsrandomness
records with images and access controlxraymedia
ISO 20022 payment messagesopen-banking-iso20022
a tokenstarter icrc-me
data fetched from a website or APIstarter price-oraclehttp-outcalls
something elsestarter counter or kv-storethe capabilities you need

Each example repository has its own AGENTS.md (linked as agents_md in the index) with its layout and conventions. Copy an example; do not edit the vendored toolkit inside it.

The workflow

# 1. Install the CLI (check the version before anything else)
curl -L https://github.com/Mercatura-Forum/Thebes-Protocol-/releases/download/v0.1.13-thebes-deploy/install-thebes-deploy.sh | bash
thebes-deploy --version        # 0.1.13 or later
thebes-deploy setup            # checks moc, mops, cargo, node

# 2. Start a project
thebes-deploy new my-app       # backend + optional frontend + manifest
thebes-deploy add auth         # passkey sign-in, when the app needs it

# 3. Build and deploy, one of:
thebes-deploy identity new me && thebes-deploy deploy        # you sign the install
thebes-deploy credits && thebes-deploy deploy --metered       # charged to credits (after login, below)

# 4. Use it
thebes-deploy query my-app <method>
thebes-deploy call  my-app <method> --arg '(...)'

# 5. Ship a new version and keep the data
thebes-deploy upgrade my-app

Every new developer account starts with free credits, enough for a few deploys, so a first application can be deployed with --metered without paying. thebes-deploy credits shows the balance.

Getting an API key for --metered: the person signs in to the Thebes IDE with a passkey and generates a key (it begins tbk_), then runs thebes-deploy login --api-key <key> once in their own terminal. The CLI stores it in ~/.thebes/credentials.toml and every later command reads it from there. Ask the person to do this step; do not ask them to paste the key into the conversation.

Rules

  1. Build Motoko with moc --legacy-persistence. Declare source in thebes.toml and let thebes-deploy build it. A custom build command must pass --legacy-persistence, or the contract cannot be upgraded in place later.
  2. Keys stay out of the project and out of the conversation. The API key lives in ~/.thebes/credentials.toml and a signing key in its key file. Never commit either, print either, or pass a signing key's seed as a command argument.
  3. Never put a secret in an HTTP outcall (URL, headers or body). Call an authenticated API through your own service.
  4. Return lists, not options. The boundary decodes a vec record of scalars: return one record as a 0-or-1-element array, and a single scalar as [{ field = value }].
  5. Principals are hex everywhere in the SDK.
  6. Call the *OrTrap form of a guarded method from a frontend, so a refusal arrives as an error and not as a successful reply carrying #err.
  7. Confirm a write before reading it back. Use the update's own reply, or repeat the query until it shows the write.
  8. Check before you deploy. Run thebes-deploy build and read the result before deploy; a deploy spends credits.

Regenerating the index

node tools/build-index.mjs           # after bumping a ref in sources.json
node tools/build-index.mjs --check   # CI: fails if the committed index is stale

Needs git, mops and moc 1.4.1.

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.