# Fellow Framework — full context for agents > Never build alone. Fellow is an AI-first engineering platform for modular, secure, multi-tenant applications on Nitro 3, Bun, Vue 3 and PostgreSQL. Site: https://fellow.run. Source: https://github.com/FellowFramework/fellow. License: MIT. Copyright 2026 Softagon Sistemas and Fellow Framework contributors. This file is the single Markdown source of the fellow.run site. Section titles are stable so you can cite them. ## What Fellow is Fellow turns Nitro and Bun into a development platform for applications built with Fellow. It is not a rewrite of either: Nitro still does the routing, Bun runs everything, Vue 3 renders the front end and PostgreSQL stores the data. Fellow treats an agent as an operator of the engineering cycle: understand, plan, change, verify, report. Every step is a CLI command with JSON output and stable exit codes, and the same operations are offered over MCP. No AI provider is required or assumed. ## Version and status - Current version: 1.0.0-alpha.4, a pre-release of Fellow 1.0. - Alpha: APIs, diagnostics and CLI output may still change before 1.0.0. - Published on npm as `@fellowframework/core`, `@fellowframework/vue`, `@fellowframework/build`, `@fellowframework/cli` and `@fellowframework/astro` (dist-tag `alpha`). Packages ship as TypeScript and run on Bun only. - The public launch will be 1.0.0, after validation and once stable Nitro 3 and Bun releases are out. - Requirements: Bun >= 1.4.4, PostgreSQL 16, `nitro@3.0.261103-rc` (pinned), and a PostgreSQL role that is not a superuser. Not built yet: server-side rendering of Vue components with hydration (pages can declare a server-rendered `document` and be exported as static files), a React adapter, semantic search with embeddings, measurement with real agents, a web operations dashboard, a hosted public module registry, and key revocation. ## The engineering cycle | Step | Command | What it guarantees | |---|---|---| | Understand | `fellow context --pack` | Minimal context with traceable origin (file, line range, hash) within a token budget | | Plan | `fellow task:new ""` then `fellow task:check ` | A baseline is recorded; the plan is complete, traceable and consistent with the project | | Change | `fellow make:*` (with `--dry-run` first), `fellow fix` | Deterministic, idempotent generators; mechanical fixes only | | Verify | `fellow check --tests`, `fellow test --affected` | Architecture, types and tests; failures classified as code, environment or infrastructure | | Report | `fellow task:evidence ` | Evidence Report built from verifiable facts | | Approve | `fellow approve ` (a person) | High-risk actions are bound to a human decision | The workflows are written down as versioned skills: `fellow skills`, `fellow skills `, `fellow skills:install --target .claude/skills`. ## Task plans After `fellow task:new`, the agent writes `.fellow/tasks//plan.json` with requirements, ambiguities and their resolutions, scope, steps, risks and acceptance criteria. `fellow task:check` rejects plans with empty requirements (FW-TASK-001), unresolved ambiguities (FW-TASK-002), requirements without acceptance criteria (FW-TASK-003), criteria without tests (FW-TASK-004), references to elements that do not exist (FW-TASK-005) or to unknown modules (FW-TASK-006). It also predicts the approvals the change will need. ## Evidence Report `fellow task:evidence ` writes `.fellow/tasks//evidence.json` and `evidence.md`. It never relies on what the agent says. It lists files created, modified and deleted since the baseline (and those outside the planned scope), contracts added, changed or removed, migrations and whether they are destructive, verification results (plan, Architecture Validator, type checker, tests), acceptance (a criterion is verified only when every test it names exists and passes), risks, required approvals and what was not verified. Status is `complete` only when everything passes, every criterion is verified and every approval is recorded; `awaiting-approval` when only approvals are missing; `incomplete` otherwise (exit code 1). ## Human approval Actions that need a person: `migration.destructive`, `auth.change`, `entitlement.change`, `module.publish`, `deploy.production`, `tenant.cross`, `secrets`. Approvals are recorded in `.fellow/approvals.json` with the approver, the time, the reason and a digest of what was approved; editing an approved migration invalidates the approval. `fellow approve` only works interactively, in a terminal, and never through MCP or `--json`. It is a process control and an audit trail, not a security boundary against someone with shell access. ## MCP server `fellow mcp` starts a Model Context Protocol server on stdio (official SDK). Configure your client with the command `bun fellow mcp` in the project directory. Tools: `fellow_intel`, `fellow_context`, `fellow_docs`, `fellow_doctor`, `fellow_check`, `fellow_test`, `fellow_generate` (plan unless `apply`), `fellow_migrate` (non-destructive only), `fellow_fix`, `fellow_task_new`, `fellow_task_check`, `fellow_task_evidence`. The skills are offered as prompts. Not exposed over MCP: approvals, tokens, destructive migrations and forced overwrites. Every MCP call is logged to `.fellow/logs/mcp.jsonl`; every CLI command to `.fellow/logs/cli.jsonl` (`FELLOW_NO_LOG=1` disables it). ## CLI for people and agents - `--json` on every command, `--dry-run` where it changes files, idempotent generators that show the plan before writing. - `fellow help [command] --json` lists commands, arguments and options in machine-readable form. - Diagnostic ids (`FW-*`) and exit codes are public API and are never renumbered. Exit codes: | Code | Meaning | |---|---| | 0 | Success | | 1 | Problems found: diagnostics, failing tests, generator conflicts | | 2 | Invalid usage | | 3 | Environment not ready: variables, database, missing tools | | 70 | Internal error (a bug in Fellow) | Test failures are classified: `code` (exit 1), `environment` (could not run, exit 3), `infrastructure` (a service failed during the run, exit 3). ## Contracts Routes are declared with `defineRoute`. Authentication, permission, tenant, input and output validation are enforced by the pipeline; Nitro still does the routing. The typed client, JSON Schema and OpenAPI 3.1 are generated from the same contracts, with no second source of truth. ```ts import { defineRoute } from '@fellowframework/core' import { documentInputSchema, documentSchema } from '../entities/document' import { createDocument } from '../services/documents' export default defineRoute({ id: 'records.documents.create', method: 'POST', path: '/api/records/documents', summary: 'Create a document', input: { body: documentInputSchema }, output: documentSchema, status: 201, access: { permission: 'records.document.create' }, tenant: 'required', handler: ({ input }) => createDocument(input.body), }) ``` ## Multi-tenancy Two-layer isolation: explicit scoping in queries and row-level security forced in PostgreSQL. The tenant comes only from the verified identity. Also included: tenant registry (status, domain), RLS verified against the catalog by `fellow doctor`, a cross-tenant isolation suite (`fellow make:isolation`), an append-only hash-chained audit log, contextual authorization, atomic quotas, feature flags with rollout, retention, per-tenant export with approval, `safeFetch` against SSRF, secret rotation and structured logs with redaction. ## Architecture Validator 53 rules with stable ids, file, line and a suggested fix, including agent-first code shape rules (`fellow docs principles`). Static SQL rules read text, so dynamically built SQL can slip through; row-level security is the final guarantee. ## Generators `fellow make:resource . --fields ...` creates a vertical slice: the entity, a migration with RLS, a service, routes, permissions and tests, including negative authorization and cross-tenant tests. Other generators: `make:module`, `make:route`, `make:job`, `make:auth`, `make:isolation`. Run with `--dry-run` first to see the plan. Field syntax example: `--fields title:string,summary:text?,status:string` (a trailing `?` marks an optional field). ## Front end Vue 3 without Vite: `Bun.build` builds the client, Nitro v3 serves the server, with state-preserving HMR, all in one Bun process, without Nuxt (ADR 0017). Pages use the Inertia protocol. `@fellowframework/vue` provides a typed client, `useForm`, `useQuery`, `usePagination` and `useAuth`. For Astro sites, `@fellowframework/astro` loads the framework documentation as a content collection and serves Fellow routes from Astro endpoints; https://fellow.run is built with it (source: https://github.com/FellowFramework/fellow.run). ## Modules Lifecycle (installation recorded by `migrate`, upgrade, deactivation, uninstall with approval), per-module migrations in dependency order with checksums (immutable once applied, destructive ones blocked without approval), per-tenant activation without rebuild, an Entitlement Engine with expiry, events that respect activation, and signed packages (Ed25519) with per-file integrity and contract versioning. Registry: static directory or HTTPS, `module:install` with compatibility resolution, local key trust, `fellow.lock.json` and signed provenance. ## Operations PostgreSQL queue (SKIP LOCKED, retries, dead letter, idempotency) transactional with the data, durable events through an outbox, durable workflows (replayed steps, sleep, signals, timeouts, compensations, versions), per-tenant cron without duplicates, `fellow work`, Idempotency-Key on routes, Server-Sent Events sent after commit, health and readiness, OpenTelemetry, slow queries, error groups, `fellow diagnose`, and backup, verify and restore with approval. ## Quickstart Fellow is on npm under the `@fellowframework` scope: ```bash bunx @fellowframework/cli new my-app --template saas cd my-app && bun install && cp .env.example .env ``` Templates: `web` (Vue applications), `saas` (web plus the `accounts` module and per-tenant module activation), `module` (for module authors). Every template passes `fellow check` as generated. Inside a Fellow application: ```bash fellow skills:install # teach coding agents the conventions fellow doctor # environment, database, RLS fellow migrate fellow make:resource records.document --fields title:string,summary:text?,status:string --dry-run fellow make:resource records.document --fields title:string,summary:text?,status:string fellow check --tests fellow dev ``` ## Using this site as an agent - This file: https://fellow.run/llms-full.txt. Index: https://fellow.run/llms.txt. Home page as Markdown: https://fellow.run/index.md. - MCP client configuration example: https://fellow.run/mcp.json. - In a WebMCP-aware browser the home page registers read-only tools: `fellow_search_docs`, `fellow_get_quickstart`, `fellow_plan_resource`, `fellow_explain_exit_code`, `fellow_get_status`. - Treat the GitHub repository as the source of truth when this file and the code disagree. ## Getting started Source: https://fellow.run/docs/getting-started ```bash bunx @fellowframework/cli new records # web template (default) cd records && bun install && cp .env.example .env fellow migrate && fellow dev ``` ## Getting started — Templates | Template | For | Contents | |---|---|---| | `web` | Vue applications | `app.ts`, `index.html` shell, a `home` module with a page, `AGENTS.md`, tests | | `saas` | Multi-tenant products | `web` plus the `accounts` module (users, memberships, sign-in/out, login page) and `moduleActivation: true` | | `module` | Module authors | `web` plus `modules/` with a README, and `fellow.json` pointing at a local registry (`./registry`) | ```bash fellow new municipal --template saas fellow new billing --template module --module billing ``` Every template passes `fellow check` as generated and ships with `src/fellow.gen.ts`. Next steps: 1. `fellow skills:install` so coding agents learn the conventions (see [`fellow docs agents`](/docs/agents)). 2. `fellow make:resource . --fields ...` for the first feature, then `fellow check --tests`. 3. `fellow tenant:create --name ...` and `fellow token --tenant --permission

` to call the API. Read next: [`fellow docs modules`](/docs/modules), [`fellow docs routes`](/docs/routes), [`fellow docs pages`](/docs/pages), [`fellow docs vue`](/docs/vue), [`fellow docs tenancy`](/docs/tenancy), and [`fellow docs publishing`](/docs/publishing) for module authors. [`fellow docs deployment`](/docs/deployment) covers production. ## Conventions Source: https://fellow.run/docs/conventions A Fellow application is a set of business modules on top of Nitro (server), Bun (runtime), Vue (frontend) and PostgreSQL. ## Conventions — Project layout ``` index.html Page shell template; its module script names the client entry (src/main.ts). app.ts Application configuration (defineApp). src/ Vue frontend. src/fellow.gen.ts is generated (typed client, pages map). modules// module.ts Manifest: id, version, dependencies, permissions. public.ts The only file other modules may import. entities/.ts Schema + table mapping (defineEntity). services/.ts Business rules and data access. routes/.ts HTTP contracts (defineRoute). Thin: validate, authorize, call a service. events/.ts Typed, versioned events (defineEvent). migrations/NNNN_x.sql SQL migrations owned by the module. tests/.test.ts bun:test tests. ``` ## Conventions — Naming - Module ids, entities and fields: lowercase `snake_case`. - Route id: `..` (`records.documents.create`). - Permission: `..` (`records.document.create`). Declared in the manifest. - Event: `..` in the past tense (`records.document.created`). - Table: `_` (`records_documents`). - Error code: `..` (`records.document.not_found`). ## Conventions — Sources of truth Nothing is declared twice. The manifest holds what cannot be derived (identity, version, dependencies, permissions). Routes, entities, events and migrations are discovered from files. `fellow intel` builds the project map from them, so it can never drift from the code. ## Conventions — Environment Validated on first use. `fellow doctor` reports problems. - `DATABASE_URL`: PostgreSQL URL. The role must not be SUPERUSER or BYPASSRLS. - `FELLOW_SECRET`: at least 32 characters; signs access tokens. - `FELLOW_DB_POOL_MAX`: pool size, default 10. ## Agent-first code principles Source: https://fellow.run/docs/principles Fellow applications are written and changed by people and coding agents together. For an agent, the cost of a change is dominated by three things: correction cycles (try, fail, read the error, retry), the files it must read to understand one behaviour, and ambiguity (several valid ways to do the same thing, all of which it explores). These principles minimise those costs. Classic principles (DRY, SOLID, KISS, YAGNI, Clean Code) are kept where they serve that goal and reinterpreted where they work against it. The rules marked with an id are enforced by `fellow check`; see [`fellow docs adr/0014-agent-first-code-principles`](/docs/adr/0014-agent-first-code-principles) for the reasoning. ## Agent-first code principles — 1. One way to do each thing (KISS) There is one place and one shape for every kind of code: a route per file in `routes/`, business rules in `services/`, background work in `jobs/` and `workflows/`, contracts written with Zod. Generators produce that shape; use them instead of inventing a variation. Fewer concepts mean shorter docs and skills, and less exploration. ## Agent-first code principles — 2. Keep behaviour local Everything that defines a behaviour lives together, inside its module: contract, validation, permission, service and test. A reader should understand a feature from one module, mostly from two or three files. - Files stay small and single-purpose (**FW-CODE-001**, warning above 400 lines). This is the useful part of the single-responsibility principle: an agent reads a whole file to change any part of it. - Only `public.ts` re-exports, as the module boundary. Barrels elsewhere add a hop (**FW-CODE-004**). - Do not wrap a function just to forward its arguments (**FW-CODE-005**). Every layer must add a responsibility. ## Agent-first code principles — 3. Be explicit, not clever Where code comes from must be visible where it is used. - No decorators (**FW-CODE-002**): they attach behaviour that is not visible at the call site. Use `defineRoute`, `defineJob`, middleware lists and plain functions. - No dependency-injection containers (**FW-CODE-003**): import implementations explicitly. Tests pass dependencies as parameters or use the framework test doubles (`memoryChannel()` with `configureNotifications`, `createTestApp`). - Prefer a little duplication over a generic abstraction with options. This is how DRY applies here: **one source of truth for knowledge** (a contract generates types, validation, OpenAPI and the client; a permission is declared once in the manifest), **but not for code shape**. Generated code that repeats a pattern is cheap to read and to change; an abstraction shared by unrelated features is not. - Open/closed and dependency inversion are applied at module boundaries (events, `public.ts`), not inside modules. ## Agent-first code principles — 4. Build only what was asked (YAGNI) Agents tend to generate more than the task needs. The task plan states the scope (`fellow task:new`), and the Evidence Report lists files changed outside it. Do not add options, hooks or layers for hypothetical future needs; add them when a task needs them. ## Agent-first code principles — 5. Make it verifiable - Every route has a test (**FW-TEST-001**), and every service is reached by a test, directly or through a tested route (**FW-CODE-006**). Tests sit in the module's `tests/` directory, next to the code they prove. - Failures must be cheap to fix: diagnostics carry an id, a file, a line and a suggestion, so a correction takes one step instead of an investigation. ## Agent-first code principles — 6. Names and comments - Names are descriptive and searchable: the context engine finds code by its words (`archiveDocument`, not `handle2`). Use the domain vocabulary of the module consistently. - Comments explain **why** (a decision, a constraint, a trap), not **what** the next line does. - Do not split functions into fragments to make them short: a 30-line function read once beats six 5-line functions spread across a file. ## Agent-first code principles — Measuring These rules are a hypothesis about agent efficiency. The agent benchmark (`benchmarks/agent`) records tool calls, correction cycles and out-of-scope changes per task; real-agent runs with and without the rules decide whether they stay as they are. ## Modules Source: https://fellow.run/docs/modules A module is a business capability: it owns its domain, data, contracts and lifecycle. It is not a plugin: plugins are technical extensions; external integrations should run as services that talk to Fellow by API and events. ```ts import { defineModule } from '@fellowframework/core' export default defineModule({ id: 'records', version: '1.4.0', name: 'Records', description: 'Registration and tracking of official documents.', fellow: '^1.0.0-alpha.0', // compatible framework versions dependencies: { organizations: '^1.0.0' }, events: { publishes: ['records.document.created'], consumes: ['organizations.unit.renamed'] }, permissions: { 'records.document.create': 'Create documents' }, roles: { 'records.clerk': { description: 'Registers documents', permissions: ['records.document.*'] } }, entitlements: ['records'], // what a tenant must have contracted navigation: [{ label: 'Records', path: '/records/documents', permission: 'records.document.read' }], requires: ['database', 'storage'], // checked by `fellow doctor` updatePolicy: 'auto', // or 'manual' retention: [{ table: 'records_access_logs', days: 365, description: 'Access logs' }], }) ``` Routes, pages, entities, migrations, events, listeners, policies and tests are discovered by convention; `fellow intel` shows the full contract of every module. `fellow module:schema` prints the JSON Schema of the manifest. ## Modules — Boundaries - A module imports another module only through `modules//public.ts`, and only if it declares the dependency. - A module never references another module's tables. Call a service from its `public.ts`, or react to its events. - Events a module emits are declared in `events.publishes`; events it listens to, in `events.consumes`, and they must come from dependencies. - Dependency cycles are errors. Core modules may only depend on core modules. ## Modules — Lifecycle | State | Where | How | |---|---|---| | Available | Code in `modules/` of the release | `fellow module:add` (package) or source | | Installed | `fellow_modules` (version) | `fellow migrate` runs its migrations and records the version | | Updating / upgraded | | `fellow migrate` (policy `auto`) or `fellow module:upgrade ` (policy `manual`); downgrades are refused | | Contracted | `fellow_entitlements` | `fellow entitlement:grant --tenant t [--expires]` | | Active per tenant | `fellow_tenant_modules` | `fellow module:activate --tenant t` (no rebuild) | | Suspended per tenant | | `fellow module:suspend --tenant t` (403 `module.suspended`) | | Disabled | | `fellow module:disable ` (all tenants) | | Uninstalled | | `fellow module:uninstall `: no tenant may use it; needs a human approval; tables are never dropped | Activation is runtime only: code, migrations and contracts come from a controlled release. Turn it on in `app.ts`: ```ts export default defineApp({ moduleActivation: true }) ``` With activation on, a route or page of a non-core module answers only when the module is installed and enabled, active for the tenant and every entitlement is valid. Otherwise: 404 (inactive, disabled, not installed), 403 `module.suspended` or `module.not_entitled`, 503 `module.updating`. Events are not delivered to listeners of modules inactive for the tenant. Pages receive `navigation`: the entries of the modules serving the tenant that the user may see. Activation requires every dependency to be active; deactivation is refused while active modules depend on the module. Deactivating never deletes data. Every change is audited in the tenant. Changes made by the CLI reach running servers within 15 seconds (or at once with a shared Redis cache). ```ts import { hasEntitlement, isModuleActive } from '@fellowframework/core' if (await hasEntitlement('records.signature')) { /* premium path */ } ``` ## Modules — Events ```ts export const documentCreated = defineEvent({ name: 'records.document.created', version: 1, payload: z.object({ id: z.uuid() }), }) await emitEvent(documentCreated, { id }) // validates the payload onEvent(documentCreated, async (payload) => { ... }) ``` Delivery is in-process and synchronous; the transactional outbox ([`fellow docs operations`](/docs/operations)) replaces the transport without changing `defineEvent`, `emitEvent` or `onEvent`. ## Modules — Packages and integrity ```bash fellow module:keygen # Ed25519 key pair in .fellow/keys (not committed) fellow module:pack records --sign .fellow/keys/publisher.key.pem fellow module:verify dist/modules/records-1.4.0.tgz fellow module:add dist/modules/records-1.4.0.tgz --upgrade ``` A package is a `.tgz` with the module files and `fellow-package.json`: module metadata, the SHA-256 of every file and the module's contract surface. `fellow-package.sig` signs that file with Ed25519. Verification rejects links, absolute or `..` paths, unlisted, missing or altered files, and signatures from keys not in `.fellow/trust/*.pem` (or `--key`). Unsigned packages need `--allow-unsigned`. The result includes a `sha512-` integrity string for lockfiles and registries. `module:pack` compares the contracts with the previous package (the latest older one in `--out`, or `--previous`): removing a route, page, event, permission or entity needs a major bump; adding or changing one needs a minor bump (before 1.0.0, minor counts as major and patch as minor). A smaller bump fails with FW-MOD-015. Packages run inside the application process: install only code you trust. Third-party code that is not trusted should run as a separate service integrated by API and events. ## Modules — Distribution Pack, sign, publish and install modules through a registry: see [`fellow docs publishing`](/docs/publishing). Compatibility rules for module versions: [`fellow docs versioning`](/docs/versioning). ## Routes Source: https://fellow.run/docs/routes A route is an explicit contract. Nitro does the routing; Fellow enforces the contract. ```ts import { defineRoute, z } from '@fellowframework/core' export default defineRoute({ id: 'records.documents.get', method: 'GET', path: '/api/records/documents/:id', input: { params: z.object({ id: z.uuid() }) }, output: documentSchema, access: { permission: 'records.document.read' }, tenant: 'required', errors: ['records.document.not_found'], handler: ({ input }) => getDocument(input.params.id), }) ``` ## Routes — Pipeline For every request, in this order: 1. Identity: `Authorization: Bearer ` (HS256, `FELLOW_SECRET`) first, then the session cookie (see `auth`). 2. Execution context is created (request id, identity, tenant, session). 3. Middleware: the application's global middleware (`app.ts`), then the route's `middleware`. 4. `access`: `'public'`, `'authenticated'` (any identity) or `{ permission }`. No identity → 401 `auth.unauthenticated`. Missing permission → 403 `auth.forbidden`. 5. `tenant: 'required'` takes the tenant from the verified identity → otherwise 403 `tenant.required`. The tenant is never read from headers, query or body. 6. CSRF: requests authenticated by a session cookie with a method other than GET/HEAD/OPTIONS need `x-csrf-token` → otherwise 403 `auth.csrf_mismatch`. Bearer tokens are exempt. 7. `input.params`, `input.query` and `input.body` are parsed → otherwise 422 `validation.failed`. Bodies are JSON or `multipart/form-data` (files arrive as `File`; use `z.file()`). Bodies over `maxBodyBytes` (default 1 MiB for JSON, 10 MiB for multipart) → 413. 8. The handler runs inside the execution context (`useTenant()`, `useIdentity()`, `sql`). 9. The result is parsed through `output`. Fields not in the schema are dropped; a mismatch is a 500 `contract.output_invalid`. `status: 204` sends no body. Every response carries `x-request-id` and the security headers (`x-content-type-options: nosniff`, `x-frame-options: SAMEORIGIN`, `referrer-policy: strict-origin-when-cross-origin`). ## Routes — Middleware ```ts import { defineMiddleware, rateLimit } from '@fellowframework/core' export const audit = defineMiddleware('records.audit', async ({ request, identity }, next) => { const response = await next() console.info(request.method, identity?.subject, response.status) return response }) export default defineRoute({ /* ... */ middleware: [rateLimit({ limit: 10, window: 60 }), audit] }) ``` `rateLimit({ limit, window, by?, name? })` is a fixed window on the cache store (Redis in production), keyed by client IP by default; exceeding it gives 429 `rate_limit.exceeded` with `Retry-After`. The client IP comes from the socket; `x-forwarded-for` is honoured only with `FELLOW_TRUST_PROXY=true`. ## Routes — Errors Every error response has the same shape: ```json { "error": { "code": "records.document.not_found", "message": "Document not found.", "requestId": "..." } } ``` Throw domain errors with `errors.notFound(code, message)`, `errors.conflict(code, message)` or `new FellowError(code, message, { status })`. Unexpected errors are logged with the request id and returned as a generic `internal.error`; internal details never reach the client. ## Routes — Permissions Granted permissions support wildcards: `*` and `records.document.*`. Every permission used by a route must be declared in the module manifest. ## Routes — Limitations - Routes are registered when the server starts: restart `fellow dev` after adding a route file. ## Pages and Vue Source: https://fellow.run/docs/pages Fellow speaks the [Inertia](https://inertiajs.com) protocol: a page is a server contract that renders a Vue component with typed props. There is no separate API for screens, and no client-side router to keep in sync. ```ts // modules/records/routes/documents.index.page.ts export default definePage({ id: 'records.documents.index', path: '/records/documents', component: 'records/documents/Index', // modules/records/pages/documents/Index.vue props: z.object({ documents: z.array(documentSchema), stats: statsSchema }), access: { permission: 'records.document.read' }, tenant: 'required', handler: async () => ({ documents: await listDocuments(), stats: defer(() => documentStats()) }), }) ``` - Props are parsed through `props`: fields outside the schema never reach the browser. - `defer(fn, group?)` props load after the first paint, in a second request. - Partial reloads (`router.reload({ only: ['stats'] })`) run only the requested props. - Every page receives `auth` (subject, name, tenant, permissions, roles), `csrfToken`, `errors` and what `app.ts`'s `share()` returns. - Unauthenticated visits redirect to `loginPath` (set in `app.ts`) with `?redirect=`. - Other errors render the `fellow/Error` component with the status. - The page object is embedded as JSON in ` ``` - `src/fellow.gen.ts` (`fellow types`, also run by `dev`/`build`, checked by `fellow check` as FW-GEN-003) types every route's params, query, body and response from the server contracts. - `useForm` validates with the same Zod schema as the server and maps server 422 issues to fields. - `api.call(id, args)` throws `ApiError` with `code`, `status`, `requestId` and `fieldErrors`. - Components may import schemas from `@fellowframework/core/contracts` (browser-safe) and never server code (FW-ARCH-004). ## Database Source: https://fellow.run/docs/database Explicit, parameterized SQL through Bun.SQL on PostgreSQL. There is no ORM. ```ts import { sql, transaction, useTenant } from '@fellowframework/core' const rows = await sql`select * from records_documents where tenant_id = ${useTenant()} and id = ${id}` await transaction(async () => { await sql`update ...` // every sql call in here, at any depth, joins the transaction await sql`insert ...` }) ``` Values in `${}` are always bound as parameters, never interpolated. ## Database — Tenant isolation Isolation is enforced twice: 1. In the query: scope by `tenant_id = ${useTenant()}`. `useTenant()` throws when there is no tenant. 2. In the database: row-level security. Each transaction sets `app.tenant_id` (transaction-local), and the table policy filters on it. A forgotten `WHERE` returns only the current tenant's rows; without a tenant context, nothing. A tenant table must look like this (the generators write it for you): ```sql create table records_documents ( id uuid primary key default gen_random_uuid(), tenant_id uuid not null, ... ); alter table records_documents enable row level security; alter table records_documents force row level security; create policy tenant_isolation on records_documents using (tenant_id = nullif(current_setting('app.tenant_id', true), '')::uuid) with check (tenant_id = nullif(current_setting('app.tenant_id', true), '')::uuid); ``` `force` matters: without it the table owner bypasses the policy. Superusers and BYPASSRLS roles always bypass it, so the application must connect with an ordinary role. `fellow doctor` checks this. Outside a request (scripts, jobs, tests) use `runAsTenant(tenantId, fn)`. ## Database — Migrations Plain SQL files in `modules//migrations/NNNN_description.sql`. - `fellow migrate --dry-run` shows the plan; `fellow migrate` applies it; `fellow migrate:status` lists states. - Order: module dependencies first, then file name. Each migration runs in its own transaction. - Applied migrations are immutable: editing one is refused (checksum). Add a new migration instead. - Destructive statements (`drop table`, `drop column`, `truncate`, `delete from`, column type changes) require `--allow-destructive`, which is a human decision. - A module creates only tables prefixed with its id, and no other module may reference them. ## Cache, storage, notifications, configuration and factories Source: https://fellow.run/docs/services ## Cache, storage, notifications, configuration and factories — Cache `cache.get/set/delete/remember/increment/add` is scoped to the current tenant (`fellow:t::`); `cache.global` is shared. The store is in memory by default and Redis with `FELLOW_CACHE=redis` and `REDIS_URL` (through `Bun.RedisClient`). Tests always use memory. ## Cache, storage, notifications, configuration and factories — Storage `storage.put/get/exists/delete/list/temporaryUrl` keeps files under `tenants//` and requires a tenant; `storage.global` uses `global/`. Disks: local (`FELLOW_STORAGE_PATH`, default `./storage`) and S3-compatible (`FELLOW_STORAGE=s3`, via `Bun.S3Client` and the usual `S3_*` variables). Paths with `..` are rejected. Uploads: `validateUpload(file, { maxBytes, types })` checks the size and the type **detected from the bytes** (PNG, JPEG, GIF, WebP, PDF, ZIP, text), not the declared one. Store with `safeFileName(file.name)` or a generated key. ## Cache, storage, notifications, configuration and factories — Notifications ```ts export default defineNotification({ name: 'records.document.assigned', payload: z.object({ title: z.string() }), channels: { mail: (p) => ({ subject: `New document: ${p.title}`, text: p.title }), database: (p) => ({ title: p.title }), }, }) await notify({ subject: user.id, email: user.email }, assigned, { title }) ``` Channels: `logChannel` (default), `databaseChannel` (in-app, `fellow_notifications`, tenant-isolated; `listNotifications`, `markNotificationRead`), `smtpChannel({ url, from })`, `webhookChannel({ url })` for SMS and WhatsApp gateways, `memoryChannel` (tests: `app.notifications`). Configure them in `app.ts`'s `boot` with `configureNotifications`. A failing channel does not stop the others. Delivery is synchronous until queues land. ## Cache, storage, notifications, configuration and factories — Module configuration ```ts export default defineConfig({ module: 'records', schema: z.object({ RECORDS_PREFIX: z.string().default('PROT') }) }) ``` Variables must start with the module id in upper case (FW-CONFIG-002). `config()` returns the parsed values or throws `config.invalid` listing every problem; `config.check()` returns the issues without throwing. ## Cache, storage, notifications, configuration and factories — Factories ```ts export default defineFactory(document, ({ sequence }) => ({ title: `Document ${sequence}`, status: 'open' })) await runAsTenant(tenant, () => documentFactory.createMany(3)) ``` Values are deterministic (`sequence`); rows are always created in the current tenant. ## Authentication and authorization Source: https://fellow.run/docs/auth ## Authentication and authorization — Identities An `Identity` is `{ subject, tenantId, permissions, roles, via, name? }`. It comes from one of: - **Session cookie** (browsers). `startSession({ subject, tenantId, roles })` inside a route sets `fellow_session` (HttpOnly, SameSite=Lax, Secure over HTTPS). The cookie holds a random id; only its SHA-256 is stored in `fellow_sessions`. Starting a session discards the previous one (fixation). `endSession()` logs out; `endSessionsOf(subject)` revokes every session (after a password change); `pruneSessions()` deletes expired ones. - **Bearer token** (APIs, integrations). `signToken({ subject, tenantId, roles, permissions })`, HS256 with `FELLOW_SECRET`. - **OpenID Connect**. `createOidcClient({ issuer, clientId, clientSecret, redirectUri })` gives `authorizationUrl()` and `callback(url)`: authorization code with PKCE; state and nonce are single-use and kept server-side for 10 minutes; the ID token signature, issuer and audience are verified. Map the claims to a user, then `startSession`. `fellow make:auth` creates the `accounts` module: users (argon2id via `Bun.password`), tenant memberships, `POST /api/accounts/session` (rate limited), `DELETE /api/accounts/session`, `GET /api/accounts/me`, the `/login` page and tests. It is application code: edit it. ## Authentication and authorization — CSRF Requests authenticated by the session cookie with an unsafe method must send the session's token in `x-csrf-token`. Pages receive it as the `csrfToken` prop and `@fellowframework/vue` sends it automatically. Bearer tokens are not sent by browsers on their own, so they are exempt. ## Authentication and authorization — Roles and permissions Modules declare permissions and roles in the manifest: ```ts permissions: { 'records.document.read': 'Read documents', 'records.document.create': 'Create documents' }, roles: { 'records.clerk': { description: 'Registers documents', permissions: ['records.document.*'] } }, ``` Sessions and tokens store roles; permissions are expanded from the installed manifests on every request, so changing a role takes effect immediately. Routes and pages declare `access: { permission }`. ## Authentication and authorization — Policies (per record) ```ts export default definePolicy({ name: 'records.document', abilities: { view: () => true, update: (identity, document) => document.owner === identity.subject && document.status !== 'archived', }, }) ``` `policy.authorize('update', document)` throws 403 `records.document.update`; `policy.can(...)` returns a boolean; `policy.abilitiesFor(document)` returns every ability, to send to the page for the UI. The UI only hides actions; the server always decides. ## Multi-tenancy and security Source: https://fellow.run/docs/tenancy Fellow isolates tenants in two layers: the code scopes every query to the tenant of the verified identity, and PostgreSQL enforces it with forced row-level security. This page covers the platform around that core: the tenant registry, audit, quotas, feature flags, retention, export and the checks that keep isolation honest. ## Multi-tenancy and security — Tenant context The tenant always comes from the verified identity (token or session), never from the URL, a header or the body. Routes with `tenant: 'required'` run with that tenant bound to the request context; `sql` and `transaction` set `app.tenant_id` for the transaction, and the RLS policies read it. Background work carries the context explicitly: ```ts import { captureContext, runWithEnvelope } from '@fellowframework/core' const envelope = captureContext() // { tenantId, subject, roles, requestId } // ... later, in a worker: runWithEnvelope(envelope, () => work(), (e) => rebuildIdentity(e)) ``` Permissions are never carried in the envelope: they are rebuilt from the roles with the current definitions. ## Multi-tenancy and security — Tenant registry `fellow_tenants` holds each organization: slug, name, status (`active`/`suspended`), domains, quota limits and settings. ```bash fellow tenant:create city-x --name "City of X" --domain records.city-x.example fellow tenant:suspend city-x fellow tenant:limits city-x --set records.documents=5000 ``` The registry is a policy layer on top of the identity, enabled in `app.ts`: ```ts export default defineApp({ tenancy: { verifyStatus: true, requireRegistered: true, verifyDomain: true }, }) ``` | Option | Effect | |---|---| | `verifyStatus` | Suspended tenants get 403 `tenant.suspended` (default in new applications) | | `requireRegistered` | Tenants missing from the registry get 403 `tenant.unknown` (recommended in production) | | `verifyDomain` | When the request host is a registered tenant domain, the identity must belong to that tenant (`tenant.domain_mismatch`) | The registry fails closed: if it cannot be read, tenant-scoped requests get 503 `tenant.registry_unavailable`. Status is cached for 30 seconds per process. ## Multi-tenancy and security — Audit log ```ts import { audit } from '@fellowframework/core' await audit('records.document.archived', { resource: { type: 'records.document', id }, data: { reason } }) ``` - Entries are per tenant (RLS), redacted (passwords, tokens, cookies), and **append-only**: a database trigger rejects updates and deletes. - Each entry is **hash-chained** to the previous one of the same tenant. `fellow audit --verify` recomputes the chain and reports the first altered entry (FW-AUDIT-001), even when someone bypassed the trigger. - `audit()` writes in its own transaction (an audited denial survives the rollback of the operation) and never throws. - Routes audit declaratively: `audit: true` records successful executions with the route id as the action; every 403 of a tenant identity is recorded as `access.denied` (turn off with `auditDenials: false` in `app.ts`). - The `accounts` module records `accounts.login` successes and failures. ## Multi-tenancy and security — Contextual authorization Permissions say what a role may do; `authorize` decides about this record, after input validation: ```ts defineRoute({ // ... access: { permission: 'records.document.update' }, authorize: ({ input, identity }) => isAssignee(input.params.id, identity!.subject), }) ``` Returning false answers 403 and is audited. Policies (`definePolicy`) remain the place for reusable rules. ## Multi-tenancy and security — Quotas ```ts import { consumeQuota, defineQuota } from '@fellowframework/core' export const documents = defineQuota({ name: 'records.documents', description: 'Documents per month', limit: 1000, period: 'month' }) await consumeQuota(documents) // 429 quota.exceeded when the limit would be passed ``` Consumption is atomic (concurrent requests cannot overshoot) and joins the caller's transaction, so a rolled-back operation does not consume. Per-tenant limits override the default (`fellow tenant:limits`). `period: 'total'` never resets; give units back with `releaseQuota`. Rate limits per tenant: `rateLimit({ limit, window, by: 'tenant' })`. ## Multi-tenancy and security — Feature flags ```ts import { defineFlag, isEnabled } from '@fellowframework/core' export const signature = defineFlag({ name: 'records.digital_signature', description: 'Digital signature', default: false }) if (await isEnabled(signature.name)) { /* ... */ } ``` Precedence: tenant setting, then the global setting (with an optional percentage rollout, deterministic per tenant), then the declared default. A route or page with `flag: 'records.digital_signature'` answers 404 while the flag is off. ```bash fellow flag:set records.digital_signature --on --rollout 10 fellow flag:set records.digital_signature --off --tenant city-x ``` ## Multi-tenancy and security — Retention Modules declare how long their data lives, in the manifest: ```ts retention: [{ table: 'records_access_logs', days: 365, column: 'created_at', description: 'Access logs' }], ``` `fellow retention:run [--dry-run]` applies the policies per registered tenant, inside its context, and audits each deletion. A module can only expire its own tables (FW-MOD-009). `FELLOW_AUDIT_RETENTION_DAYS` also prunes the audit log. ## Multi-tenancy and security — Export `fellow tenant:export ` writes one NDJSON file per table with tenant data, plus `manifest.json` with row counts and SHA-256 of each file. It reads cross-tenant data, so it requires a human approval bound to that tenant: `fellow approve tenant.cross `. Session hashes are never exported. The export is audited. ## Multi-tenancy and security — Verifying isolation - `fellow doctor` checks the database catalog: every table with a `tenant_id` column must have row-level security enabled, forced and a tenant policy, unless a migration marks it `-- fellow:global `. It also refuses roles that bypass RLS. - `fellow make:isolation ` creates a test that seeds data as tenant A and calls every tenant-scoped route as tenant B with every permission (`app.checkIsolation`). Any 2xx on A's resource, or A's data in B's response, is a leak. ## Multi-tenancy and security — Outbound requests Use `safeFetch` for any URL a user or tenant can influence (webhooks, imports): only http(s), only public addresses (no localhost, private networks or cloud metadata), redirects validated at every hop, and a timeout. The webhook notification channel uses it; internal gateways are allowed with `allowHosts`. ## Multi-tenancy and security — Secret rotation Set the new secret in `FELLOW_SECRET` and the old one in `FELLOW_SECRET_PREVIOUS`. Tokens signed with the old secret stay valid until they expire; new tokens use the new one. Remove `FELLOW_SECRET_PREVIOUS` afterwards. ## Multi-tenancy and security — Logging `log.info(event, fields)` writes JSON lines with request id, tenant and subject, and redacts secrets by key (password, token, cookie, authorization...) and by value (bearer tokens, JWTs, credentials in URLs). `FELLOW_LOG_LEVEL` sets the minimum level; `configureLogger` sends entries elsewhere. ## Knowledge and Ask Source: https://fellow.run/docs/knowledge A Fellow application can say what it knows about itself: the Markdown files of its `docs/` folder and, from the contracts, every route and page with who may use it. That text has one format and three readers: - **agents**, through the CLI (`fellow knowledge`), the MCP tool `fellow_knowledge`, and in the browser through WebMCP; - **people**, through ``: a question box answered on their own device; - **anything else** that reads Markdown, at `GET /__fellow/knowledge.txt`. Nothing is sent to an AI service. The question is answered by the model built into the browser, from sections found by a search that also runs in the browser. Where there is no built-in model, the person gets the sections themselves, word for word. ## Knowledge and Ask — The two sources | Source | Comes from | Good for | |---|---|---| | `docs` | `docs/**/*.md` at the project root. `README.md` or `index.md` comes first | Help inside the system: how the work is done, in the words of the business | | `contracts` | `defineRoute`, `definePage` and the module manifests: method and path, who may use it, tenant, inputs, outputs, error codes, permissions and roles | Agents, and questions like "who can approve this?" | Every `## ` heading starts one section. A document's title is carried into its headings (`## Review — Deciding`), so a section still says where it comes from when it is read alone. One section is written per module, per route and per page. Write `docs/` with that in mind: short sections, one subject each. ```bash fellow knowledge # both sources, as Markdown fellow knowledge --source docs # only one fellow knowledge --json # { title, sources, sections: [{ title, body }] } ``` ## Knowledge and Ask — Serving it Off by default. Turn it on in `app.ts`: ```ts import { defineApp } from '@fellowframework/core' export default defineApp({ knowledge: { sources: ['docs', 'contracts'], access: { permission: 'records.document.read' } }, }) ``` | Option | Values | Default | |---|---|---| | `sources` | `'docs'`, `'contracts'` | both | | `access` | `'public'`, `'authenticated'`, `{ permission }` | `'authenticated'` | `GET /__fellow/knowledge.txt` then answers `text/markdown` to whoever `access` allows (session cookie or bearer token), 401 or 403 to the rest, and 404 while `knowledge` is not set. The text is generated when the server is built, so a change in `docs/` reaches production with the next build (and the dev server with a restart). **`contracts` lists every route of the application**, with its permission. That is not secret (the pipeline enforces access whatever a reader knows), but it is a map: keep `access` at `'authenticated'` or a permission unless the application is public. For public help, serve only `docs`: `{ sources: ['docs'], access: 'public' }`. ## Knowledge and Ask — `` `@fellowframework/ask` is a browser package with no dependencies. It ships compiled JavaScript, so it works in any front end and bundler, or straight from a ` ``` | Attribute | Meaning | Default | |---|---|---| | `source` | URL of the Markdown text | `/__fellow/knowledge.txt` | | `subject` | What the text is about, told to the model | "this application" | | `lang` | Language of the text and of the element's own words (`en`, `pt`, `es` built in) | `` | | `suggestions` | Questions offered as buttons, separated by `\|` | none | | `placeholder`, `button` | Text of the field and of the button | from `lang` | | `limit` | Sections used per answer | 3 | | `tools` | `off` keeps the search from being offered to browser agents | on | | `tool-name` | Name of the WebMCP tool | `search_knowledge` | Children of the element are shown in the answer area until the first question. Properties, set from JavaScript: `labels` (any text of the element) and `options` (search synonyms and stop words, the instruction given to the model, and `fetch` for a source that needs a bearer token; by default the request carries the session cookie). Events: `fellow-ask-question`, `fellow-ask-answer` (`detail.mode` is `model`, `passages`, `none` or `unavailable`, with the sections used) and `fellow-ask-tool` (an agent used the search). Style it with `::part(input)`, `::part(button)`, `::part(answer)`, `::part(suggestion)` and the custom properties `--fellow-ask-accent`, `--fellow-ask-accent-text`, `--fellow-ask-border`, `--fellow-ask-field`, `--fellow-ask-radius`. In a Fellow page (Vue), import the element once and use the tag; the Fellow build leaves `fellow-*` tags to the browser: ```vue ``` In Astro, import it from a ` ``` ## Vue — Help inside the application `` answers questions from the application's own `docs/` and contracts, on the user's device. Import `@fellowframework/ask/element` in the page and use the tag; the build leaves `fellow-*` tags to the browser. See [`fellow docs knowledge`](/docs/knowledge). ## Vue — Rules the validator enforces - Components import schemas from `@fellowframework/core/contracts` (browser-safe) or from entity files, never server code (FW-ARCH-004). - `src/fellow.gen.ts` matches the contracts (FW-GEN-003): run `fellow types`, or let `dev`/`build` do it. ## Vue — Rendering Pages render in the browser. For content that must be readable without JavaScript (documentation, landing pages), a page declares `document` and can be exported as static files with `fellow build --preset static`: see [`fellow docs pages`](/docs/pages) and [`fellow docs adr/0018-document-and-static-export`](/docs/adr/0018-document-and-static-export). Server-side rendering of Vue components with hydration is not available yet. Read next: [`fellow docs pages`](/docs/pages), [`fellow docs routes`](/docs/routes), [`fellow docs auth`](/docs/auth). ## React Source: https://fellow.run/docs/react **Status: there is no `@fellowframework/react` package yet.** Fellow's pages, build pipeline and generated client are Vue only today (see [`fellow docs vue`](/docs/vue); for Astro sites there is [`fellow docs astro`](/docs/astro)). This page says what works for a React front end now and what is needed for a first-class adapter, so nobody builds on something that does not exist. ## React — What works today: Fellow as the API A React application (Vite, Next.js, React Router) can use a Fellow application as its backend. Everything on the server side is the same: `defineRoute` contracts, tenant isolation, permissions, validation. | Need | How | |---|---| | Types for the API | `fellow openapi > openapi.json`, then any OpenAPI 3.1 generator (for example `openapi-typescript`) | | Shared validation | Import Zod schemas from `@fellowframework/core/contracts`: it is browser-safe and has no Vue dependency | | Sign-in from the browser | Session cookie (`POST /api/accounts/session` from `fellow make:auth`), same origin | | Mutations with the session | Send the session's CSRF token in `x-csrf-token` (see [`fellow docs auth`](/docs/auth)) | | Server-to-server calls | `Authorization: Bearer ` from `signToken`; bearer requests are exempt from CSRF | | Errors | JSON body with a stable `code`, `message`, `requestId` and field issues on 422 (see [`fellow docs routes`](/docs/routes)) | `` from `@fellowframework/ask` is a custom element, so it works in React as it is: import `@fellowframework/ask/element` in a client component and write the tag ([`fellow docs knowledge`](/docs/knowledge)). Constraints to plan for: - **Same origin.** Fellow ships no CORS middleware, and the session cookie is `SameSite=Lax`. Serve the React build and the API under one origin (a reverse proxy, or copy the React build into the Fellow app's `public/`). - **No generated React client.** `src/fellow.gen.ts` and the `api` object target `@fellowframework/vue`. - **No React pages.** `definePage` renders Vue components; `fellow dev` and `fellow build` do not compile JSX pages. ## React — What a first-class adapter needs The server side is ready for it: pages already speak the Inertia protocol, which `@inertiajs/react` implements. A React adapter keeps `definePage` contracts unchanged and adds three things: the component named by `component` resolved to a `.tsx` file, JSX pages in `@fellowframework/build`, and a generated client with the form and query helpers as hooks. It is not available yet; the changelog will say when it is. ## Astro Source: https://fellow.run/docs/astro `@fellowframework/astro` connects an [Astro](https://astro.build) site to Fellow: the framework documentation becomes a content collection, and Fellow routes can be served from Astro endpoints. Astro renders the pages; Fellow keeps the contracts. ```bash bun add @fellowframework/astro @fellowframework/core ``` Run Astro on Bun (`bunx --bun astro dev`, `bunx --bun astro build`): the Fellow packages ship TypeScript and do not run on Node.js. **The reference example is https://fellow.run itself** (source: https://github.com/FellowFramework/fellow.run): an Astro site whose `/docs` pages come from the `docs/` directory of the installed `@fellowframework/core`, deployed as static files on Cloudflare Workers. ## Astro — The integration ```ts // astro.config.ts import fellowAstro from '@fellowframework/astro' import { defineConfig } from 'astro/config' export default defineConfig({ integrations: [fellowAstro()] }) ``` It adds the virtual module `virtual:fellow`, which exports `version`: the installed `@fellowframework/core`. For its types, add `/// ` to `src/env.d.ts`. ## Astro — The documentation as a content collection ```ts // src/content.config.ts import { fellowDocs } from '@fellowframework/astro' import { defineCollection } from 'astro:content' export const collections = { docs: defineCollection({ loader: fellowDocs() }) } ``` Each entry is one document of the installed version: | Field | Content | |---|---| | `id` | The topic: `routes`, `adr/0017-bun-nitro-without-vite` | | `data.title`, `data.description` | From the document's heading and first paragraph | | `data.group`, `data.order` | Navigation group (`Start`, `Build`, ..., `Decisions`) and reading order | | `body` | The Markdown, with links between documents and `fellow docs ` mentions pointing at site pages | | rendered HTML | Through Astro's Markdown pipeline: `render(entry)` gives `Content` and `headings` | `fellowDocs({ base, repository, root })`: `base` is the URL prefix of the pages (default `/docs`), `repository` is where links to files outside `docs/` point, `root` is where `node_modules` is looked up (default: the Astro project). Upgrading `@fellowframework/core` is what updates the pages; a new document appears without any change in the site. `@fellowframework/astro/docs` exports the same data without Astro (`docsTopics`, `docsNavigation`, `readTopic`, `linkTopic`, `frameworkVersion`) for scripts. ## Astro — Fellow routes as Astro endpoints ```ts // src/pages/api/documents.ts import { fellowEndpoint } from '@fellowframework/astro' import listDocuments from '~/modules/records/routes/documents.list' export const prerender = false export const GET = fellowEndpoint(listDocuments) ``` The route runs through the whole Fellow pipeline: identity, permission, tenant, input and output validation (see [`fellow docs routes`](/docs/routes)). Path parameters come from Astro's `params`; the file name decides the URL, so keep it equal to the contract's `path`. ## Astro — Ask and search on the site `` from `@fellowframework/ask` works in an Astro page: import `@fellowframework/ask/element` from a `