agentleFS
onlook-devonlook-dev/onlook/AGENTS.md

onlook

AGENTS.md27k starsChanged 2 years agoApache-2.0View on GitHub

Actionable rules for repo agents—keep diffs minimal, safe, token‑efficient. - Monorepo managed by Bun workspaces (see root package.json). - App: apps/web/client (Next.js App Router + TailwindCSS). - API routes: apps/web/client/src/server/api/routers/*, aggregated in apps/web/client/src/server/api/root.ts. - Shared utilities: packages/* (e.g., packages/utility). - UI: Next.js App Router, TailwindCSS. - API: tRPC + Zod (apps/web/client/src/server/api/*). - Package manager: Bun only — use Bun for all installs and scripts; do not use npm, yarn, or pnpm. - Default to Server Components. Add use client when…

  • Reads credentials

Adopted by

Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data

Week of Sep 27: 0 new projectsWeek of Oct 4: 0 new projectsWeek of Oct 11: 0 new projectsWeek of Oct 18: 0 new projectsWeek of Oct 25: 0 new projectsWeek of Nov 1: 0 new projectsWeek of Nov 8: 0 new projectsWeek of Nov 15: 0 new projects
Sep 2026Oct 2026Nov 2026
New projects taking a version of this file each week, over the 8 weeks our latest run read: only 0 in all, so this is a hint, not a trend.

Who's talking about onlook-dev/onlook

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

See all 56

Talked about on Bluesky, GitHub and Hacker News (56 times).

On Bluesky · 39

34 more on Bluesky

On GitHub · 13

8 more on GitHub
  • 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 repositoryOne other file it gives its agents.

The file

Show its rules and text

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

23 rules. About 0 are common, 9 are distinctive, and 14 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.

  • 14

    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. Distinctive:

    Prefer local patterns and existing abstractions.

    line 30
  2. Distinctive:

    Do not modify build outputs, generated files, or lockfiles.

    line 31
  3. Distinctive:

    Use Bun for all scripts; do not introduce npm/yarn.

    line 32
  4. Distinctive:

    Avoid running the local dev server in automation contexts.

    line 33
  5. Very specific:

    Default to Server Components.

    line 38
  6. Very specific:

    Use publicProcedure/protectedProcedure from apps/web/client/src/server/api/trpc.ts.

    line 53
  7. Distinctive:

    Never pass server-only clients into client code.

    line 65
  8. Very specific:

    Prefer env from @/env. In server-only helpers (e.g., base URL in src/trpc/helpers.ts), read process.env only for deployment vars like …

    line 72
  9. Very specific:

    Import ./src/env in apps/web/client/next.config.ts to enforce validation.

    line 76
  10. Very specific:

    Use path aliases: @/* and ~/* map to apps/web/client/src/* (see apps/web/client/tsconfig.json).

    line 80
  11. Very specific:

    Do not import server-only modules into client components.

    line 82
  12. Very specific:

    Create store instances with useState(() => new Store()) for stability across renders.

    line 89
  13. Very specific:

    Keep active store in useRef.

    line 91
  14. Very specific:

    Avoid useMemo for store instances.

    line 93
  15. Distinctive:

    Avoid putting the store instance in effect deps if it loops.

    line 95
  16. Very specific:

    Prefer existing UI components from @onlook/ui and local patterns.

    line 107
  17. Distinctive:

    Keep keys stable; prefer additions over breaking renames.

    line 116
  18. Very specific:

    Avoid useMemo to create MobX stores (risk of lost references).

    line 130
  19. Distinctive:

    Search narrowly with ripgrep.

    line 135
  20. Very specific:

    Read small sections; avoid node_modules, .next, large assets.

    line 136
  21. Very specific:

    Run type checking with bun run typecheck

    line 142
  22. Very specific:

    DO NOT run db:gen. This is reserved for the maintainer.

    line 145
  23. Distinctive:

    DO NOT use any type unless necessary

    line 146

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

Onlook Agents Guide

Actionable rules for repo agents—keep diffs minimal, safe, token‑efficient.

Purpose & Scope

  • Audience: automated coding agents working within this repository.
  • Goal: small, correct diffs aligned with the project’s architecture.
  • Non-goals: editing generated artifacts, lockfiles, or node_modules.

Repo Map

  • Monorepo managed by Bun workspaces (see root package.json).
  • App: apps/web/client (Next.js App Router + TailwindCSS).
  • API routes: apps/web/client/src/server/api/routers/*, aggregated in apps/web/client/src/server/api/root.ts.
  • Shared utilities: packages/* (e.g., packages/utility).

Stack & Runtimes

  • UI: Next.js App Router, TailwindCSS.
  • API: tRPC + Zod (apps/web/client/src/server/api/*).
  • Package manager: Bun only — use Bun for all installs and scripts; do not use npm, yarn, or pnpm.

Agent Priorities

  • Correctness first: minimal scope and targeted edits.
  • Respect client/server boundaries in App Router.
  • Prefer local patterns and existing abstractions; avoid one-off frameworks.
  • Do not modify build outputs, generated files, or lockfiles.
  • Use Bun for all scripts; do not introduce npm/yarn.
  • Avoid running the local dev server in automation contexts.
  • Respect type safety and

Next.js App Router

  • Default to Server Components. Add use client when using events, state/effects, browser APIs, or client-only libs.
  • App structure: apps/web/client/src/app/** (page.tsx, layout.tsx, route.ts).
  • Client providers live behind a client boundary (e.g., apps/web/client/src/trpc/react.tsx).
  • Example roots: apps/web/client/src/app/layout.tsx (RSC shell, providers wired, scripts gated by env).
  • Components using mobx-react-lite's observer must be client components (include use client).

tRPC API

  • Routers live in apps/web/client/src/server/api/routers/** and must be exported from apps/web/client/src/server/api/root.ts.
  • Use publicProcedure/protectedProcedure from apps/web/client/src/server/api/trpc.ts; validate inputs with Zod.
  • Serialization handled by SuperJSON; return plain objects/arrays.
  • Client usage via apps/web/client/src/trpc/react.tsx (React Query + tRPC links).

Auth & Supabase

  • Server-side client: apps/web/client/src/utils/supabase/server.ts (uses Next headers/cookies). Use in server components, actions, and routes.
  • Browser client: apps/web/client/src/utils/supabase/client/index.ts for client components.
  • Never pass server-only clients into client code.

Env & Config

  • Define/validate env vars in apps/web/client/src/env.ts via @t3-oss/env-nextjs.
  • Expose browser vars with NEXT_PUBLIC_* and declare in the client schema.
  • Prefer env from @/env. In server-only helpers (e.g., base URL in src/trpc/helpers.ts), read process.env only for deployment vars like VERCEL_URL/PORT. Never use process.env in client code; in shared modules, guard with typeof window === 'undefined'.
  • Import ./src/env in apps/web/client/next.config.ts to enforce validation.

Imports & Paths

  • Use path aliases: @/* and ~/* map to apps/web/client/src/* (see apps/web/client/tsconfig.json).
  • Do not import server-only modules into client components. Limited exception: editor modules that already use path; reuse only there. Never import process in client code.
  • Split code by environment if needed (server file vs client file).

MobX + React Stores

  • Create store instances with useState(() => new Store()) for stability across renders.
  • Keep active store in useRef; clean up async with setTimeout(() => storeRef.current?.clear(), 0) to avoid route-change races.
  • Avoid useMemo for store instances; React may drop memoized values leading to data loss.
  • Avoid putting the store instance in effect deps if it loops; split concerns (e.g., project vs branch).
  • observer components are client-only. Place one client boundary at the feature entry; child observers need not include use client (e.g., apps/web/client/src/app/project/[id]/_components/main.tsx).
  • Example store: apps/web/client/src/components/store/editor/engine.ts:1 (uses makeAutoObservable).

Styling & UI

  • TailwindCSS-first styling; global styles are already imported in apps/web/client/src/app/layout.tsx.
  • Prefer existing UI components from @onlook/ui and local patterns.
  • Preserve dark theme defaults via ThemeProvider usage in layout.

Internationalization

  • next-intl is configured; provider lives in apps/web/client/src/app/layout.tsx.
  • Strings live in apps/web/client/messages/*. Add/modify keys there; avoid hardcoded user-facing text.
  • Keep keys stable; prefer additions over breaking renames.

Common Pitfalls

  • Missing use client where needed (events/browser APIs) causes unbound events; a single boundary at the feature root is sufficient.
  • New tRPC routers not exported in src/server/api/root.ts (endpoints unreachable).
  • Env vars not typed/exposed in src/env.ts cause runtime/edge failures. Prefer env; avoid new process.env reads in client code.
  • Importing server-only code into client components (bundling/runtime errors). Note: path is already used in specific client code-editor modules; avoid expanding Node API usage beyond those areas.
  • Bypassing i18n by hardcoding strings instead of using message files/hooks.
  • Avoid useMemo to create MobX stores (risk of lost references); avoid synchronous cleanup on route change (race conditions).

Context Discipline (for Agents)

  • Search narrowly with ripgrep; open only files you need.
  • Read small sections; avoid node_modules, .next, large assets.
  • Propose minimal diffs aligned with existing conventions; avoid wide refactors.

Notes

  • Unit tests can be run with bun test
  • Run type checking with bun run typecheck
  • Apply database updates to local dev with bun run db:push
  • Refrain from running the dev server
  • DO NOT run db:gen. This is reserved for the maintainer.
  • DO NOT use any type unless necessary

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.