agentleFS
Hugging FaceKnown publisherhuggingface/ml-intern/AGENTS.md

ml-intern

AGENTS.md11k starsChanged 49 days agoApache-2.0Archived repositoryView on GitHub

  • Reads credentials
  • Commits and pushes

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

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

  • 9

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  • could be automatic: a setting could enforce it
  1. Very specific:

    If 127.0.0.1:7860 is already owned by another local process, binding the backend to ::1 lets the Vite proxy resolve localhost cleanly.

    line 15
  2. Very specific:

    Prefer npm ci over npm install for setup, since npm install may rewrite frontend/package-lock.json metadata depending on npm version.

    line 16
  3. Very specific:

    When asked to start the local server, export the GitHub CLI token first with export GITHUB_TOKEN="$(gh auth token)".

    line 18
  4. Very specific:

    When debugging a web app issue tied to a session ID, inspect the session data in smolagents/ml-intern-sessions for additional context.

    line 19
  5. Very specific:

    Before every commit, run uv run ruff check .

    line 23
  6. Very specific:

    If formatting fails, run uv run ruff format ., then re-run the Ruff checks before committing.

    line 24
  7. Distinctive:

    Before creating any new branch or worktree, switch to main and pull the latest changes.

    line 28
  8. Very specific:

    Always use the gh CLI for GitHub operations such as opening, editing, inspecting, or commenting on PRs and issues.

    line 32
  9. Very specific:

    If gh reports an invalid token or auth failure, retry the command with GH_TOKEN and GITHUB_TOKEN unset, for example env -u GH_TOKEN -u …

    line 34
  10. Distinctive:

    After implementing a plan, run the required checks, commit the changes, open a GitHub PR, then start the backend and frontend local dev …

    line 40
  11. Very specific:

    Keep the Space-only README frontmatter on space-main.

    line 46

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

Agent Notes

Local Dev Servers

  • Frontend: from frontend/, run npm ci if dependencies are missing, then npm run dev.
  • Backend (full/rollback): from backend/, run uv run uvicorn main:app --host ::1 --port 7860.
  • Hosted Space: backend/start.sh runs retired_main:app, which serves only the retirement page and GET /api.
  • Frontend URL: http://localhost:5173/
  • Backend health check: curl -g http://[::1]:7860/api
  • Frontend proxy health check: curl http://localhost:5173/api

Notes:

  • Vite proxies /api and /auth to http://localhost:7860.
  • If 127.0.0.1:7860 is already owned by another local process, binding the backend to ::1 lets the Vite proxy resolve localhost cleanly.
  • Prefer npm ci over npm install for setup, since npm install may rewrite frontend/package-lock.json metadata depending on npm version.
  • Non-local LLM calls use https://router.huggingface.co/v1 with the active Hugging Face user's token. Web sessions and the CLI default to GLM 5.2. For local development, set HF_TOKEN and optionally ML_INTERN_DEFAULT_MODEL_ID.
  • When asked to start the local server, export the GitHub CLI token first with export GITHUB_TOKEN="$(gh auth token)".
  • When debugging a web app issue tied to a session ID, inspect the session data in smolagents/ml-intern-sessions for additional context.

Development Checks

  • Before every commit, run uv run ruff check . and uv run ruff format --check ..
  • If formatting fails, run uv run ruff format ., then re-run the Ruff checks before committing.

Git Workflow

  • Before creating any new branch or worktree, switch to main and pull the latest changes.

GitHub CLI

  • Always use the gh CLI for GitHub operations such as opening, editing, inspecting, or commenting on PRs and issues.
  • For multiline PR descriptions, prefer gh pr edit <number> --body-file <file> over inline --body so shell quoting, $ env-var names, backticks, and newlines are preserved correctly.
  • If gh reports an invalid token or auth failure, retry the command with GH_TOKEN and GITHUB_TOKEN unset, for example env -u GH_TOKEN -u GITHUB_TOKEN gh pr create ..., so gh can use the stored login token instead of a stale environment token.
  • In Codex, sandboxed gh auth checks can report a valid keyring login as invalid when GitHub network access is restricted. Before telling the user to re-authenticate, retry with both env tokens unset and GitHub network access enabled.

GitHub PRs

  • Open code changes as GitHub PRs first. Do not push code changes directly to the Hugging Face Space deployment branch or Space remote before the PR has been opened, reviewed, and merged, unless the user explicitly asks to bypass the PR flow.
  • After implementing a plan, run the required checks, commit the changes, open a GitHub PR, then start the backend and frontend local dev servers for testing.

Hugging Face Space Deploys

  • The Space remote is space and points to https://huggingface.co/spaces/smolagents/ml-intern.
  • Deploy GitHub main to the Space from the local space-main branch by merging origin/main into space-main with a single merge commit, then pushing space-main:main to the space remote.
  • Keep the Space-only README frontmatter on space-main; .gitattributes should contain README.md merge=ours and the local repo config should include merge.ours.driver=true.
  • Local dev commonly uses a personal HF_TOKEN, but the deployed Space uses HF OAuth tokens. When adding Hub features, make sure the Space README hf_oauth_scopes frontmatter and the backend OAuth request in backend/routes/auth.py include the scopes required by the Hub APIs being called. A feature can work locally with a broad PAT and still fail in production with 403s if OAuth scopes are missing; after changing scopes, users may need to log out and log in again to receive a fresh token.
  • Recommended deploy flow:
git pull --ff-only origin main
git switch space-main
git config merge.ours.driver true
git merge --no-ff origin/main -m "Deploy $(date +%Y-%m-%d)" \
  -m "Co-authored-by: OpenAI Codex <codex@openai.com>"
git push space space-main:main
git switch main

Download now (ZIP)

  • 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 28,693 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.

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

Reviews can't be read right now.

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.