DocsReference

For AI agents

Rules and entry points for an agent working in a project built with Nexy. Working on Nexy itself is a different job: read the repository's root AGENTS.md.

Map

You need Read
the product, in one page README
to run a project getting-started
a file's URL routing
dynamic segments, layouts, error pages pages
the current path, query, cookies, session hooks
to edit a page .nexy files or views
Markdown or MDX markdown
built-in HTML helpers components
rendering mode SSR, CSR, ISR
a WebSocket websocket
controllers and modules modular
to add an endpoint API
a form posted from a page actions
why a request failed, and which page answers it exceptions
translations i18n
a config field config
to test the app testing
the client build frontend

Skills

A project made with nx new already holds the rules for agents: AGENTS.md, CLAUDE.md and the skills in .agents/skills/ and .claude/skills/. Read AGENTS.md first; it lists the skills and says which one to load for a task. For an existing project, run nx skills. See Coding agents.

Invariants

  1. __nexy__/ is generated. Never edit it, never commit it. Delete it to force a clean build.
  2. One file per URL. index.nexy and index.py for the same path is a bug, not a priority rule.
  3. Reserved names inside src/routes/: layout.nexy, loading.nexy, errors.nexy, notfound.nexy, dependencies.py, __init__.py. Do not use them for content.
  4. .nexy frontmatter is Python that runs per request. No module-level side effects: no file handles, no database connections, no network calls at import.
  5. .py in src/routes/ is an API handler. Methods are function names (GET, POST, ...).
  6. Configuration lives in nexyconfig.py, not in environment variables and not in scattered constants.
  7. Autoescaping is off in .nexy templates: escape untrusted values with | e.

Commands

nx dev      # development
nx build    # production build
nx start    # production server
nx test     # pytest, --client adds vitest

How to answer a question about Nexy

  1. Search docs/ for the concept.
  2. If the page is silent, read the installed package - nexy/core/config.py for options, nexy/modules/routers/fbrouter/ for routing rules, nexy/modules/compiler/ for how .nexy files become modules.
  3. If the docs and the code disagree, trust the code and say so.

Edit on GitHub

Enter opens the result, Esc closes.