agentleFS
huseyininnchuseyininnc/zeyn/AGENTS.md

zeyn

AGENTS.md8 starsChanged 10 days agoApache-2.0View on GitHub

Instructions for AI coding agents working on the Zeyn Framework repository. Codex, Claude Code, Cursor, Copilot, Gemini and other agents read this file. People are welcome too. Zeyn is an open source Rust web framework for data heavy business apps: grids, forms and workflows. AI agents write the application code; people read, review and change it. Screens are rendered on the server, a small runtime in the browser applies changes, and app authors write no HTML, CSS or JavaScript. If…

  • 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,439 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 repository3 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

14 rules. About 0 are common, 6 are distinctive, and 8 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈6

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 8

    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 you are writing an app *with* Zeyn rather than changing Zeyn itself, read skills/zeyn/SKILL.md instead.

    line 11
  2. Distinctive:

    No per user UI state on the server.

    line 100
  3. Distinctive:

    Every cache, queue and map that grows with traffic has a cap.

    line 102
  4. Distinctive:

    When you add something that costs memory, binary size or time, measure it before and after and say the numbers in the commit or the report.

    line 104
  5. Very specific:

    Every action and screen declares access: a permission or public.

    line 113
  6. Very specific:

    Every POST endpoint calls check_csrf.

    line 115
  7. Very specific:

    Never trust limits or ids from the client (DataQuery::limit, keys, file names).

    line 120
  8. Distinctive:

    Every user facing text comes from the locale files, in English and Turkish.

    line 130
  9. Very specific:

    No inline // comments. Use /// and //!

    line 135
  10. Distinctive:

    Write code top to bottom, not across.

    line 136
  11. Very specific:

    Every rule the compiler can enforce gets a compile_fail doctest and an error message written for an AI agent to act on …

    line 141
  12. Distinctive:

    Keep the existing structure and patterns.

    line 143
  13. Very specific:

    Run cargo test --workspace before you commit.

    line 153
  14. Very specific:

    Search the docs and the code first.

    line 162

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

Instructions for AI coding agents working on the Zeyn Framework repository. Codex, Claude Code, Cursor, Copilot, Gemini and other agents read this file. People are welcome too.

Zeyn is an open source Rust web framework for data heavy business apps: grids, forms and workflows. AI agents write the application code; people read, review and change it. Screens are rendered on the server, a small runtime in the browser applies changes, and app authors write no HTML, CSS or JavaScript.

If you are writing an app with Zeyn rather than changing Zeyn itself, read skills/zeyn/SKILL.md instead. zeyn new copies it into every project. The CLI ships a copy in crates/zeyn-cli/embedded/; a test fails until you copy your change there.

Read before you change anything

Find the document for your area and read it first. The docs are the contract; the code follows them. When code and docs disagree, fix the one that is wrong in the same change.

You are working onRead
Anything, the first timeREADME.md, then examples/docs/pages/introduction.md
The language: entities, actions, screens, forms, textsexamples/docs/pages/ (entities.md, actions.md, screens.md, forms.md, effects.md, texts.md)
DataGriddocs/grid.md, examples/docs/pages/datagrid.md
Components and layoutsexamples/docs/pages/ (layouts.md, controls.md, lines.md, display.md, content.md, data.md, catalog.md, shell.md)
Browser runtime, endpoints, eventsdocs/runtime-protocol.md
Security, audit, masking, sessions, jobs, workflowsexamples/docs/pages/security.md, docs/enterprise.md
Sign in, JWT, OIDC, MFAdocs/auth.md
User accounts, passwords, passkeys (feature accounts)docs/accounts.md, examples/docs/pages/accounts.md
Database (PostgreSQL, Oracle)docs/database.md
Time zones, licenses, Redis, tracing, Dockerdocs/operations.md
Themes and design tokensdocs/theming.md
AI assistant, MCP, AI attributesdocs/assistant.md, examples/docs/pages/mcp.md
WASM islands and canvasdocs/islands.md
WebSocket rooms and CRDTdocs/realtime.md
Media players and ranged servingdocs/media.md
Desktop packagingdocs/desktop.md
CLI, zeyn new, templatesexamples/docs/pages/cli.md, crates/zeyn-cli/templates/
Apps and shared libraries in separate reposdocs/polyrepo.md

The same docs run as a Zeyn app: cargo run -p zeyn-example-docs, then open http://127.0.0.1:3008. Alt+Shift+P searches every page.

Repository map

crates/zeyn/           the framework (feature gated modules, see Cargo.toml [features])
  src/model.rs         Model, Entity, Field<M, T>, Valid<T>, rules
  src/value.rs         FieldType, FieldKind, Value, Money
  src/action.rs        Action, Error, Page, DataQuery, Cursor, page size limits
  src/screen.rs        ScreenDef, Screen, Component, Node, toolbar, Effect, UiCtx
  src/grid.rs          DataGrid
  src/form.rs          Form, SubmitForm
  src/ui/              layouts, controls, pickers, lines editor, display widgets, tree, charts, shell
  src/server.rs        App, the router, the page shell; server/*.rs holds the endpoints
  src/sql/             data layer (features postgres, oracle)
  src/assistant/       embedded AI assistant (feature assistant)
  assets/              the browser runtime: zeyn/*.js (joined into /_zeyn/zeyn.js and the
                       grid runtime /_zeyn/grid.js, see server.rs), nav.js, components.js
                       and their CSS
  locales/             the framework's own texts (en.json, tr.json)
  tests/               integration tests, one file per area
crates/zeyn-macros/    entity, model, choice, params, action, screen, t!
crates/zeyn-cli/       the zeyn command and the project templates
crates/zeyn-island/    browser side of WASM islands
crates/zeyn-desktop/   desktop window around an app
examples/              showcase (every component), docs, components (catalog: one file per
                       component, shown live and as its code), adisyon (POS), inventory, big-grid,
                       billing + crm + shared-domain (shared libraries)
docs/                  design documents and guides

Commands

cargo build --workspace
cargo test --workspace
cargo test -p zeyn --features assistant,oidc,totp,islands,realtime,xlsx,email,accounts   tests behind features
cargo check -p zeyn --all-features --tests                                      everything compiles
cargo run -p zeyn-example-showcase      http://127.0.0.1:3002, every component
cargo run -p zeyn-example-docs          http://127.0.0.1:3008, the documentation
cargo run -p zeyn-example-components    http://127.0.0.1:3010, the component catalog
  • Database, Redis and identity provider tests skip unless their variable is set (ZEYN_TEST_PG, ZEYN_TEST_ORACLE, ZEYN_TEST_REDIS, ZEYN_TEST_OIDC); each test file says how to start the server in Docker.
  • Disk space is limited on shared machines. Use CARGO_INCREMENTAL=0, and delete your own target directory when you are done. The pdf feature links Typst (about 40 MB); do not turn it on for the whole workspace.
  • cargo test does not rebuild a binary you then run by hand; run cargo build -p <example> first.

The rules

These are not style preferences. A change that breaks one is not done.

Performance first

Performance and a small memory footprint are the most important rule.

  • Stream instead of buffering whole results; use bounded channels and fixed size buffers.
  • Borrow instead of clone; no allocation in hot paths you can avoid.
  • No per user UI state on the server. Requests are stateless; state lives in the database, a signed cookie or the browser.
  • Every cache, queue and map that grows with traffic has a cap.
  • Heavy integrations go behind a Cargo feature, so apps that do not use them pay nothing.
  • When you add something that costs memory, binary size or time, measure it before and after and say the numbers in the commit or the report.

No component reloads the page

Navigation, effects, language and theme changes go through nav.js: zeyn:navigate, zeyn:refresh, zeyn:refresh-page. A full page load is only the fallback when that script is missing. Never call location.reload() or location.assign() for in-app navigation.

Security

  • Every action and screen declares access: a permission or public. Check access on the server for every request, also for things the page does not show.
  • Every POST endpoint calls check_csrf. Endpoints that write or cost money go in the is_write list for the write rate limit.
  • Endpoints that address a node of a screen take crate::ui::NodePath (string paths such as "1.0.2"), never usize, and look it up with screen.node(&path). Test with a nested path.
  • User data in HTML always goes through render::escape (or Render::text / Render::value). Never trust limits or ids from the client (DataQuery::limit, keys, file names).
  • Render with the user's context (.with_identity(...), .with_ctx(...)) so masked fields stay masked and reads are audited. Masked values never reach HTML, exports, logs or AI models.
  • CSP stays strict: no inline scripts or event handlers. New browser code is a separate asset.
  • Secrets never go in code, logs, tests that look real, or commit messages.

Accessibility and UI

  • WCAG 2.2 AA is the baseline: keyboard use, visible focus, labels, W3C APG patterns for widgets, live regions for changing text.
  • Both the light and the dark theme must work. Colors come from theme tokens (docs/theming.md).
  • Every user facing text comes from the locale files, in English and Turkish.

Code

  • Everything in English: code, doc comments, docs, test names, UI strings (Turkish goes only in tr.json).
  • No inline // comments. Use /// and //! doc comments on items.
  • Write code top to bottom, not across. Once a chain of calls is longer than about 40 characters, put one call on each line, so a line holds one or two dots on average. Builders, screens and iterator chains read as a list. cargo fmt does this with chain_width = 40 in rustfmt.toml; do not raise it.
  • Generated code from macros always uses ::zeyn:: paths.
  • Every rule the compiler can enforce gets a compile_fail doctest and an error message written for an AI agent to act on (#[diagnostic::on_unimplemented] where it fits).
  • Keep the existing structure and patterns; do not add a second way to do something that already has one.
  • Public prose (README, docs, UI text) uses no em dashes or en dashes, and stays neutral: it describes the framework, not who might buy it.

Tests

  • New logic gets a test in the matching file under crates/zeyn/tests/. Security fixes get a regression test that fails without the fix.
  • Browser behavior is checked in a real browser (the showcase or the docs app) with no console errors, before the work is called done.
  • Run cargo test --workspace before you commit; it must pass.

Commits

  • One commit per finished piece of work. The message says what was done, in plain words, starting with the ticket id when there is one: ZEYN-42 PDF list reports for grids.
  • No feat:, fix: or other type prefixes. No AI attribution lines.

When something is missing

Search the docs and the code first; the feature may exist under another name (DataGrid, not Grid; DataQuery, not GridQuery). If it does not exist, follow the pattern of the closest existing feature and add docs and tests with it.

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.