agentleFS
strikersamstrikersam/autonomous-ai-agency/docs/agents.md

autonomous-ai-agency

AGENTS.md12 starsChanged 29 days agoMITView on GitHub

This document covers the coding agents exposed by local-llm-server, with a focus on FreeBuff — a self-hosted, Codebuff-style coding agent that runs on free NVIDIA NIM models and is controllable from your phone via Telegram. For the underlying three-role orchestration loop (planner → executor → verifier) see agent/CLAUDE.md and docs/architecture/agent-orchestration.md. FreeBuffAgent (in agent/loop.py) is a thin subclass of AgentRunner that pins model selection to a curated set of free NVIDIA NIM models. It reuses the full plan → execute →…

  • Reads credentials

The file

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

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

  • 3

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    No "done" without an independent verifier (pstack): Before any task is reported done, by a coding agent or by an agency agent, a verifier …

    line 14
  2. Very specific:

    When NVIDIA_API_KEY (or NVidiaApiKey) is set, the runner is pinned to the NVIDIA NIM base URL (https://integrate.api.nvidia.com/v1) with …

    line 55
  3. Very specific:

    All endpoints require a valid API key (Authorization: Bearer <key> or x-api-key: <key>), same as the rest of the proxy.

    line 62
  4. Very specific:

    Before any PR opens, agent/pr_gate.py checks the change in the agent's own clone and the PR stays closed on any blocker:

    line 89

≈ “Common” is an estimate: at least 1 in 5 of the 42,283 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

This document covers the coding agents exposed by local-llm-server, with a focus on FreeBuff — a self-hosted, Codebuff-style coding agent that runs on free NVIDIA NIM models and is controllable from your phone via Telegram.

For the underlying three-role orchestration loop (planner → executor → verifier) see agent/CLAUDE.md and docs/architecture/agent-orchestration.md.

Verification rule (mirrored from CLAUDE.md §2, binding on every agent)

<!-- pstack-verification:start -->
  1. No "done" without an independent verifier (pstack). Before any task is reported done, by a coding agent or by an agency agent, a verifier that did not write the change tries to break it. It exercises the real artifact (runs the feature, the tests, the built page; not "it compiles", not the author's own report) and returns PASS, PASS+NOTES, or FAIL with a report: what it checked, what it found broken, what was fixed, and the evidence (command output; screenshots for any UI change). FAIL sends the work back: fix every defect it found, then verify again, until it passes. Only PASS or PASS+NOTES permits a done claim, and the report quotes that verdict. Work in small units that each end in a check. Agency tasks enforce this in code (tasks/verification.py, live control TASK_VERIFICATION_REQUIRED). Source: pstack's principle-prove-it-works and its independent per-PR verdict (github.com/cursor/plugins/tree/main/pstack, github.com/michael-denyer/pstack-claude). This rule is mirrored byte-for-byte in every agent instruction file; python scripts/check_verification_rule.py fails if a copy drifts.
<!-- pstack-verification:end -->

FreeBuff — free-NVIDIA coding agent

FreeBuffAgent (in agent/loop.py) is a thin subclass of AgentRunner that pins model selection to a curated set of free NVIDIA NIM models. It reuses the full plan → execute → verify loop and all existing WorkspaceTools file operations, but it will never route to a paid endpoint — resolve_model() coerces any non-free model request back to a free one.

Free model set

The default free models are:

ModelRole
nvidia/llama-3.3-nemotron-super-49b-v1heavy reasoning / execution
qwen/qwen2.5-coder-32b-instructcoding
meta/llama-3.3-70b-instructgeneral
meta/llama-3.1-8b-instructfast / cheap
deepseek-ai/deepseek-r1reasoning

Override the list with FREEBUFF_MODELS (comma-separated) for new-model rollouts without touching code.

When NVIDIA_API_KEY (or NVidiaApiKey) is set, the runner is pinned to the NVIDIA NIM base URL (https://integrate.api.nvidia.com/v1) with the key in the Authorization header. With no key set it falls back to a local OpenAI-compatible base so construction never fails (tests / local-only deployments).

HTTP API

All endpoints require a valid API key (Authorization: Bearer <key> or x-api-key: <key>), same as the rest of the proxy.

Method & pathPurpose
GET /freebuff/modelsList the free models a user can pick.
POST /freebuff/planGenerate a read-only plan (no files written) for review.
POST /freebuff/runExecute the task; optionally commit and open a draft PR.

Request body for plan/run (FreeBuffRunRequest):

{
  "instruction": "fix the failing health check",
  "model": "qwen/qwen2.5-coder-32b-instruct",
  "auto_commit": false,
  "open_pr": false,
  "repo_url": null,
  "max_steps": 10
}

model is coerced to a free model if a paid/unknown id is supplied. PRs are never pushed to protected branches directly — the runner isolates changes on a fresh feature branch and opens a PR (gated by AGENT_AUTO_PR_ENABLED). The repo target comes from repo_url or the FREEBUFF_REPO_URL env var.

Before any PR opens, agent/pr_gate.py checks the change in the agent's own clone and the PR stays closed on any blocker:

CheckBlocks when
Protected pathsauth modules (rule 15), App.js/index.html, deploy and CI config, or the gate itself changed
Scopea file changed that no plan step named (tests, changelogs, graph report exempt)
Sizea file lost ≥ 40 lines and more than twice what it gained, or was deleted, and the goal did not ask for removal
Tests weakenedan existing test lost assertions or gained a skip/xfail/.skip( marker
Pythonfiles do not compile; code changed without tests; tests fail
Guard suitesmodel config changed and the catalogue tests fail
Frontendrelated Jest tests or npm run build fail (reported as not run when node_modules is absent)
Changeloga non-doc change has no entry in both changelogs, or they differ
Judgethe judge, shown the real diff and plan, returns REJECTED/BLOCKED or a correctness/security FAIL

The PR body lists the plan, every check that ran with its result, and the judge's verdict. The plan is also committed as docs/plans/agent/<date>-<slug>.md, and the judge reviews against the target repository's REVIEW.md when it has one.

Recorded agent-PR incidents are replayed against the gate by tests/agent_evals/ (.github/workflows/agent-evals.yml, nightly and on every change to CLAUDE.md, REVIEW.md, skills or prompts). Add a case to tests/agent_evals/gate_cases.yaml for every new incident.

Unlimited by default

FreeBuff is meant to be an unlimited free coding agent, so the /freebuff/* routes skip the per-key RPM limiter by default (proxy._is_freebuff_unlimited). The routes are still fully auth-gated (a valid API key is required) and only ever run free NVIDIA models, so this doesn't open up paid endpoints. To re-impose the limiter on FreeBuff routes:

FREEBUFF_UNLIMITED=false

Separately, specific store-backed keys can be exempted from the limiter on all endpoints via an allowlist (e.g. for the Telegram bot's own key when it also calls /agent/run or chat):

FREEBUFF_RATELIMIT_EXEMPT_KEY_IDS=kid_telegrambot

This is opt-in (default empty). Legacy keys (no key_id) are never exempt, and all non-FreeBuff endpoints stay rate-limited as usual.


Telegram phone control

The Telegram bot (telegram_bot.py) drives FreeBuff entirely from a phone using inline buttons. Admin-only.

/freebuff <task>

  1. The bot fetches the free model list (GET /freebuff/models) and shows a model-picker inline keyboard (one button per model).
  2. Tapping a model generates a plan (POST /freebuff/plan) and shows the steps with ✅ Accept & run / ❌ Reject buttons.
  3. Accept runs the task (POST /freebuff/run with auto_commit + open_pr) and reports the result summary and PR URL.
  4. Reject discards the task — nothing is written.

Because planning is read-only, the accept/reject review happens before any code is changed. Callback buttons re-check that the user is an allowed admin, and the per-user FreeBuff state expires when a session is started, accepted, or rejected.

Inline-button callbacks use compact fb:<action>[:<arg>] data (e.g. fb:model:1, fb:accept, fb:reject); model selection sends an index into the per-user model list to stay within Telegram's 64-byte callback_data limit.


Running 24×7

To drive FreeBuff from your phone anytime, run the Telegram bot as an always-on worker (Render free tier or Docker). It runs the agent in-process (embedded mode) — no proxy server needed — clones the repo, edits on free models, and opens a draft PR. Full step-by-step: docs/deploy/freebuff-telegram-bot.md.


Environment variables

VariableDefaultPurpose
FREEBUFF_MODELS(built-in list)Comma-separated free model override.
FREEBUFF_UNLIMITEDtrueWhen on, /freebuff/* routes skip the RPM limiter.
FREEBUFF_RATELIMIT_EXEMPT_KEY_IDS(empty)key_ids exempt from rate limiting everywhere.
FREEBUFF_REPO_URL(none)Default repo for FreeBuff draft PRs.
NVIDIA_API_KEY / NVidiaApiKey(none)Enables NVIDIA NIM routing.
AGENT_AUTO_PR_ENABLEDoffMaster switch for agent-initiated PRs.

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.