agentleFS
XiaomiMiMoXiaomiMiMo/MiMo-Code/AGENTS.md

MiMo-Code

AGENTS.md14k starsChanged 2 months agoMITView on GitHub

Reduce total variable count by inlining when a value is only used once. Avoid unnecessary destructuring. Use dot notation to preserve context. Prefer const over let. Use ternaries or early returns instead of reassignment. Avoid else statements. Prefer early returns. Use snake_case for field names so column names don't need to be redefined as strings. Two independent absences meet in one expression, and only one of them is undefined. .get() yields undefined when no row matches — Drizzle normalises the…

Trending

Less talk lately.about the whole repository

Dec 2025: 0 mentionsJan 2026: 0 mentionsFeb 2026: 0 mentionsMar 2026: 0 mentionsApr 2026: 0 mentionsMay 2026: 0 mentionsJun 2026: 17 mentionsJul 2026: 9 mentionsAug 2026: 1 mentionSep 2026: 10 mentionsOct 2026: 1 mentionNov 2026: 0 mentions
Dec 2025Jun 2026Nov 2026
Mentions a month of the XiaomiMiMo/MiMo-Code repository that our weekly crawl found. There is no adoption data for this file yet.

Who's talking about XiaomiMiMo/MiMo-Code

The biggest 5 of 38 mentions linking to the repository that our crawl found. Each line is their own headline.

See all 38

Talked about on GitHub and Bluesky (38 times).

On GitHub · 32

27 more on GitHub

On Bluesky · 6

1 more on Bluesky
  • Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.

    Of the AGENTS.md files we read, the 11,773 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 repository2 other files it gives its agents.

The file

Show its rules and text

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

16 rules. About 0 are common, 9 are distinctive, and 7 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈9

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 7

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use MiMoCode Compose skills when available, otherwise use superpowers skill if installed.

    line 5
  2. Distinctive:

    ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.

    line 7
  3. Distinctive:

    Prefer automation: execute requested actions without confirmation unless blocked by missing info or safety/irreversibility.

    line 10
  4. Very specific:

    Do not edit packages/cli/migration/*/migration.sql that already shipped — engines have applied those journals.

    line 13
  5. Distinctive:

    Keep things in one function unless composable or reusable

    line 19
  6. Very specific:

    Avoid try/catch where possible

    line 20
  7. Very specific:

    Avoid using the any type

    line 21
  8. Very specific:

    Use Bun APIs where the runtime is Bun-only, like Bun.file() in the TUI (src/cli/cmd/tui/).

    line 22
  9. Distinctive:

    Prefer functional array methods (flatMap, filter, map) over for loops.

    line 26
  10. Distinctive:

    Avoid unnecessary destructuring.

    line 42
  11. Very specific:

    Prefer const over let. Use ternaries or early returns instead of reassignment.

    line 55
  12. Very specific:

    Avoid else statements. Prefer early returns.

    line 69
  13. Distinctive:

    Use snake_case for field names so column names don't need to be redefined as strings.

    line 87
  14. Very specific:

    When a caller only asks "is there a value", flatten to undefined, and write the flattening as an annotation rather than an as cast:

    line 112
  15. Distinctive:

    Avoid mocks as much as possible

    line 130
  16. Distinctive:

    Test actual implementation, do not duplicate logic into tests

    line 131

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

MiMo-Code

Conventions

  • Use MiMoCode Compose skills when available, otherwise use superpowers skill if installed.
  • To regenerate the JavaScript SDK, run ./packages/sdk/script/build.ts.
  • ALWAYS USE PARALLEL TOOLS WHEN APPLICABLE.
  • The default branch in this repo is main.
  • CI triggers on main.
  • Prefer automation: execute requested actions without confirmation unless blocked by missing info or safety/irreversibility.
  • Install deps with bun ci (= bun install --frozen-lockfile) — install per bun.lock, don't mutate the lockfile. ⛔ Do NOT use bun install/npm install.
  • Comments, docs, shipped skill content and test assertions use synthetic values, never machine-specific ones — /tmp/example for paths, test/model for model refs, feat/example for branches.
  • Do not edit packages/cli/migration/*/migration.sql that already shipped — engines have applied those journals; new schema changes get a new migration directory under packages/cli/migration/.

Style Guide

General Principles

  • Keep things in one function unless composable or reusable
  • Avoid try/catch where possible
  • Avoid using the any type
  • Use Bun APIs where the runtime is Bun-only, like Bun.file() in the TUI (src/cli/cmd/tui/); build-time macros are fine anywhere, as they never reach the shipped runtime
  • In core code reachable from src/node.ts, prefer the Node equivalent when one exists — createHash over Bun.CryptoHasher, prepare() over bun:sqlite's query() — as that code also ships through script/build-node.ts and must run on plain Node
  • Bun-only calls in core escape both typecheck and bun test, which run on Bun; existing usage needs no urgent removal, and APIs with no Node equivalent may stay until a runtime seam exists
  • Rely on type inference when possible; avoid explicit type annotations or interfaces unless necessary for exports or clarity
  • Prefer functional array methods (flatMap, filter, map) over for loops; use type guards on filter to maintain type inference downstream
  • In src/config, follow the existing self-export pattern at the top of the file (for example export * as ConfigAgent from "./agent") when adding a new config module.

Reduce total variable count by inlining when a value is only used once.

// Good
const journal = await Bun.file(path.join(dir, "journal.json")).json()

// Bad
const journalPath = path.join(dir, "journal.json")
const journal = await Bun.file(journalPath).json()

Destructuring

Avoid unnecessary destructuring. Use dot notation to preserve context.

// Good
obj.a
obj.b

// Bad
const { a, b } = obj

Variables

Prefer const over let. Use ternaries or early returns instead of reassignment.

// Good
const foo = condition ? 1 : 2

// Bad
let foo
if (condition) foo = 1
else foo = 2

Control Flow

Avoid else statements. Prefer early returns.

// Good
function foo() {
  if (condition) return 1
  return 2
}

// Bad
function foo() {
  if (condition) return 1
  else return 2
}

Schema Definitions (Drizzle)

Use snake_case for field names so column names don't need to be redefined as strings.

// Good
const table = sqliteTable("session", {
  id: text().primaryKey(),
  project_id: text().notNull(),
  created_at: integer().notNull(),
})

// Bad
const table = sqliteTable("session", {
  id: text("id").primaryKey(),
  projectID: text("project_id").notNull(),
  createdAt: integer("created_at").notNull(),
})

Reading a nullable column

Two independent absences meet in one expression, and only one of them is undefined. .get() yields undefined when no row matches — Drizzle normalises the driver's null there — while a nullable column's SQL NULL arrives as null. So row?.some_column is T | null | undefined.

When a caller only asks "is there a value", flatten to undefined, and write the flattening as an annotation rather than an as cast:

// Good — the compiler enforces it; deleting the `?? undefined` is a type error
const boundary: MessageID | undefined = row?.last_checkpoint_message_id ?? undefined

// Bad — the cast removes `null` from the union without converting anything,
// so the declared type is untrue at runtime
return row?.last_checkpoint_message_id as MessageID | undefined

Discriminate a possibly-absent value with truthiness or == null, never with === undefined / !== undefined. Because null !== undefined is true, such a guard typechecks, reads correctly in review, and does nothing.

Testing

  • Avoid mocks as much as possible
  • Test actual implementation, do not duplicate logic into tests

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.