agentleFS
spytensorspytensor/openmozi/AGENTS.md

openmozi

AGENTS.md423 starsChanged 4 months agoMITView on GitHub

This file applies to Codex, Claude Code, Gemini CLI, and any other coding agent working in this repository. The repo-level source of truth is docs/CONSTITUTION.md. Follow it for all architecture, delegation, and release decisions. Before changing product code for any bug, complaint, anomaly, or improvement request: The original request to “fix” something does not itself satisfy step 5; approval must follow the investigation. Read-only inspection, reproduction, and research are allowed before approval.

The file

Show its rules and text

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

24 rules. About 1 is common, 17 are distinctive, and 6 are very specific to this project.

  • ≈1

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈17

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 6

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Never invent worker progress, fake queued/completed states, or hide a deterministic runtime failure behind vague generic apologies.

    line 10
  2. Distinctive:

    Only claim capabilities that are actually registered and currently ready in this runtime.

    line 11
  3. Distinctive:

    Treat user-defined workspace skills and workspace agents as first-class extensions.

    line 12
  4. Very specific:

    Do not ship delegation changes unless a real complex task has been driven end-to-end on the build and the evidence recorded.

    line 13
  5. Distinctive:

    Do not use generic shell execution as the transport for Claude Code, Codex, Gemini, or other external AI CLIs.

    line 14
  6. Distinctive:

    Do not treat a feature change as complete until relevant local tests have been run and passed.

    line 15
  7. Very specific:

    Treat every bug report or feedback item as investigation-only until the user reviews the evidence and explicitly approves an implementation …

    line 16
  8. Distinctive:

    Before changing product code for any bug, complaint, anomaly, or improvement request:

    line 22
  9. Distinctive:

    Check existing MOZI abstractions first, then relevant mature open-source solutions, standards, and industry patterns.

    line 26
  10. Distinctive:

    Wait for explicit user approval of an option.

    line 28
  11. Distinctive:

    The task spec is a decision, not a suggestion: When an Issue marks a design as decided (schema, API shape, file layout, naming), implement …

    line 45
  12. Distinctive:

    Build only what the task asks: No new abstraction layers, service classes, event buses, plugin points, interfaces reserved for the future, …

    line 49
  13. Distinctive:

    Fallbacks are forbidden unless the task specifies them: Do not add try/catch-and-continue, silent default values, retry wrappers, or …

    line 55
  14. Distinctive:

    Respect the stated size estimate: When a task gives an expected diff size, hitting ~2x that number is a signal you are solving the wrong …

    line 61
  15. Distinctive:

    Stop, re-read the task, and cut scope — do not push through.

    line 63
  16. Distinctive:

    Keep shared UI, API contracts, persistence behavior, model/provider behavior, prompts, permissions, artifacts, files, memory, and error …

    line 90
  17. Distinctive:

    Verify the surfaces sequentially when they share port 9210.

    line 100
  18. Distinctive:

    Use isolated test data and state which runtime, data home, and artifact are being tested.

    line 102
  19. Distinctive:

    If one surface cannot be verified, report that surface as unverified and do not call the complete product change done.

    line 108
  20. Very specific:

    Before runtime work, inspect http://127.0.0.1:9210/api/health and verify that the listener belongs to the installed app.

    line 119
  21. Very specific:

    Do not start pnpm start, pnpm start:all, pnpm desktop:dev, or a Docker MOZI service alongside the installed app.

    line 122
  22. Distinctive:

    Use source mode only when the change genuinely needs it.

    line 125
  23. Very specific:

    After a change intended for the owner, rebuild the arm64 package, replace /Applications/MOZI.app, launch that installed copy, and verify …

    line 129
  24. Common:

    Never reset, delete, overwrite, or remigrate the real App Support data as a test shortcut.

    line 135

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

AGENTS.md — Repository Instructions for Coding Agents

This file applies to Codex, Claude Code, Gemini CLI, and any other coding agent working in this repository.

The repo-level source of truth is docs/CONSTITUTION.md. Follow it for all architecture, delegation, and release decisions.

Non-Negotiable Rules

  1. Prompt text is not the execution engine. Runtime owns worker launch, sandboxing, health, state, fallback, and verification.
  2. Never invent worker progress, fake queued/completed states, or hide a deterministic runtime failure behind vague generic apologies.
  3. Only claim capabilities that are actually registered and currently ready in this runtime.
  4. Treat user-defined workspace skills and workspace agents as first-class extensions; they must follow the same managed-worker contract as built-in flows.
  5. Do not ship delegation changes unless a real complex task has been driven end-to-end on the build and the evidence recorded. The automatic gate was removed (see docs/CONSTITUTION.md §14) — nothing checks this for you.
  6. Do not use generic shell execution as the transport for Claude Code, Codex, Gemini, or other external AI CLIs; those belong to managed-worker skills/adapters.
  7. Do not treat a feature change as complete until relevant local tests have been run and passed; if new behavior lacks coverage, add or update tests in the same change.
  8. Treat every bug report or feedback item as investigation-only until the user reviews the evidence and explicitly approves an implementation option. Follow the decision gate in docs/CONSTITUTION.md §6.
  9. Load skills/mozi-development/SKILL.md before adding or changing anything in this codebase. It carries the existing seams to reuse and the wiring proof a change needs; a raw code scan misleads you here (dead exports, docs describing intent rather than behaviour, a second implementation winning silently) and unit tests do not catch it.
  10. Never publish to the open-source repository freehand. Load and follow skills/public-release/SKILL.md every time — it carries the review gates the export script cannot enforce. Nothing that only makes sense inside this tree may appear in the public one: not in files, not in a commit message, not in a tag annotation, not in a release note. This has already gone wrong once (the tooling's own commit message published this project's name, version and commit sha on every sync) and cost a rewrite of published history.

Mandatory Bug And Feedback Workflow

Before changing product code for any bug, complaint, anomaly, or improvement request:

  1. Inspect the real code and live call path; verify that the reported behavior and proposed diagnosis are true.
  2. Identify the immediate cause and assess architectural causes, especially ownership, identity, lifecycle, state, persistence, contracts, and duplicated implementations.
  3. Check existing MOZI abstractions first, then relevant mature open-source solutions, standards, and industry patterns. Compare fit, maintenance, license, security, and integration cost.
  4. Give the user a decision brief: evidence, root cause, architectural assessment, existing solutions, options and tradeoffs, recommendation, scope, and verification plan.
  5. Wait for explicit user approval of an option. Do not edit product code, dependencies, schemas, migrations, runtime configuration, or release artifacts before approval.
  6. Implement only the approved option. Return for a new decision if material facts or scope change.

The original request to “fix” something does not itself satisfy step 5; approval must follow the investigation. Read-only inspection, reproduction, and research are allowed before approval.

Practical Implications

  • For delegation work, check the real adapter path, preflight, lane, sandbox, and result contract.
  • For prompt work, keep prompts thin and grounded in runtime truth.
  • For upgrade questions, prefer the startup contract: migrations, bootstrap sync, and workspace reload happen on restart.

Scope, Simplicity, And Test Discipline

Coding agents in this repo have repeatedly over-designed, over-tested, and added unrequested fallbacks. These rules are acceptance criteria: a PR that violates them gets rejected without further discussion.

  1. The task spec is a decision, not a suggestion. When an Issue marks a design as decided (schema, API shape, file layout, naming), implement it as written. If you believe it is wrong, raise the objection BEFORE writing code and wait; never silently redesign or "improve" it.
  2. Build only what the task asks. No new abstraction layers, service classes, event buses, plugin points, interfaces reserved for the future, config options, or env vars unless the task explicitly requires them. Code justified by "extensibility" or "in case we later need" must be deleted before commit. Prefer editing existing files over creating modules; prefer deleting code over adding it.
  3. Fallbacks are forbidden unless the task specifies them. Do not add try/catch-and-continue, silent default values, retry wrappers, or degraded paths that hide failures. Fail loudly with typed errors. If the task does not define degradation semantics, the correct behavior is a visible failure — this repo's constitution already bans silent degradation, and an invented fallback is a bug even when it "works".
  4. Respect the stated size estimate. When a task gives an expected diff size, hitting ~2x that number is a signal you are solving the wrong problem. Stop, re-read the task, and cut scope — do not push through.
  5. Test the change, not the world. Cover the new behavior's happy path and failure paths in targeted vitest files. Run pnpm build, pnpm typecheck, the tests you touched, and directly affected neighbors — never the full suite (it makes real LLM API calls). Do not create new test infrastructure, helpers, or fixture frameworks unless the task asks for them. Test count is not a quality metric; a change with 6 pointed tests and wiring proof beats one with 40 permutations.
  6. Wiring proof beats test volume. A feature is proven when every new export has a production caller (grep evidence), every read side names the writer that populates its data, and one real end-to-end trigger shows an observable effect. Unit tests that call the new function directly prove nothing about wiring — this repo has shipped dead code with green tests multiple times.

Product Surfaces And Parity

MOZI is one product with two first-class delivery surfaces:

  • Web: the Docker-deployed MOZI runtime and Web UI.
  • App: the installed macOS app, which supervises the packaged MOZI runtime and presents the same Web UI as a desktop product.

Shared product behavior must stay synchronized. A user-facing change is assumed to affect both surfaces unless its Issue and implementation explicitly identify it as Web-only or App-only.

  1. Keep shared UI, API contracts, persistence behavior, model/provider behavior, prompts, permissions, artifacts, files, memory, and error states in common code. Do not create separate Web and App implementations without a concrete platform requirement.
  2. Define both surfaces in the Issue and PR acceptance criteria. For a shared change, record Web/Docker evidence and installed-App evidence separately; passing one surface never proves the other.
  3. Build both surfaces from the same commit. Rebuild/restart Docker for Web verification and rebuild/reinstall /Applications/MOZI.app for App verification so stale artifacts cannot masquerade as current behavior.
  4. Verify the surfaces sequentially when they share port 9210. Stop one cleanly, verify that its listener and owned processes are gone, then start the other. Use isolated test data and state which runtime, data home, and artifact are being tested.
  5. Exercise the same core workflow on both surfaces for shared changes. Add platform-specific checks where the environments differ: container mounts, auth, reverse proxy, and service health for Web; Finder launch, packaged resources, macOS permissions, quit/relaunch, and sidecar ownership for App.
  6. If one surface cannot be verified, report that surface as unverified and do not call the complete product change done. Track an explicit blocker or follow-up Issue rather than silently narrowing the claim.

Owner Mac Runtime Baseline

The installed macOS app is the owner's normal MOZI entry point. Unless a task explicitly requires source-mode development, treat /Applications/MOZI.app as the live product runtime and ~/Library/Application Support/MOZI as its real data home.

  1. Before runtime work, inspect http://127.0.0.1:9210/api/health and verify that the listener belongs to the installed app. Do not infer runtime identity from the port alone.
  2. Do not start pnpm start, pnpm start:all, pnpm desktop:dev, or a Docker MOZI service alongside the installed app. They compete for port 9210 and can produce false test results. The ONLYOFFICE Docker service may remain running.
  3. Use source mode only when the change genuinely needs it. Quit the installed app gracefully first, isolate development data from the real App Support home, and state which runtime is under test.
  4. A source build or passing source test does not update the installed app. After a change intended for the owner, rebuild the arm64 package, replace /Applications/MOZI.app, launch that installed copy, and verify the real user path before claiming completion.
  5. Launch the product with open -a /Applications/MOZI.app. Quit it through the normal app lifecycle; use forced process termination only after graceful quit has demonstrably failed.
  6. Never reset, delete, overwrite, or remigrate the real App Support data as a test shortcut. Preserve sessions, memory, secrets, files, workspaces, skills, agents, model configuration, and artifacts; create and record a rollback backup before any required migration.
  7. For user-facing bugs, App evidence must come from the installed app, including health, the affected UI/API path, clean quit/relaunch, orphan process checks, and SQLite integrity when persistence is involved. Complete the separate Web/Docker evidence required above before claiming shared product completion.

For Claude-specific conventions and deeper repo guidance, also see CLAUDE.md.

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.