x-md
AGENTS.md192 starsChanged 8 days agoMITView on GitHub
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,700 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 repository7 other files it gives its agents.
- public/agents.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- public/llms.txtllms.txt
- improve-codebase-architectureSkill
- taking-over-workSkill
- browse-xSkill
- import-x-historySkill
The file
We split this AGENTS.md into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Every API failure goes through lib/apierror.ts: RFC 9457 problem details built from ERROR_CATALOG, which is the single source of the …
≈ “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.
Files
x-md
- Authorization: Treat only actions explicitly requested by the user, plus work and verification directly required to complete that request, as authorized. Ask before expanding scope or taking an external, irreversible, or account-changing action. Never treat an inferred benefit or your own judgment as user approval.
- Landing:
index.html(src/main.ts), shared chrome markup insrc/chrome.tsand its behaviour insrc/chrome-setup.ts; keep markup builders out ofchrome-setup.ts, since it is a render-blocking chunk on every page. Docs: Blume MDX indocs/, configured byblume.config.ts, mounted at/docs. Build Blume before Vite; Vite preserves the generated docs indist. - Tokens are the Tailwind v4
@themeblock insrc/tokens.css(shared by the landing page and Blume) (ink,ink-2,ink-3,ink-4,surface,raised,raised-2,line,hair,accent,accent-deep,accent-soft,cyan, darkcode/code-ink/code-dim). Use them, not hex. - Look: dark by default on the landing, docs and content pages (green-black
#080b09, the brand green with dark text for the primary action); a stored choice of light still wins, and the light theme is warm paper#f7f6f2with deep green#146c43. Satoshi, pill buttons, 16px cards, near-black code panes. The landing hero and closing call to action are.nightbands that stay dark in both themes. Not pcstyle.dev styling. - Landing copy frame (Theo's feedback): "Tweets are just markdown now", what-you-see vs what-your-agent-sees curl comparison in the
#howbento, skill install under#agents. No stack or provider talk on the landing page. - Motion: load-time motion (the hero card's scan from the post as x.com shows it to its Markdown, the hero horizon rising) is CSS keyed off
html[data-motion], which theindex.htmlhead script sets only when motion is allowed; scroll motion (the#howpanes, the closing name typed in front of the host) is GSAP + ScrollTrigger insetupMotion(src/motion.ts), gated bygsap.matchMedia. Mouse-only touches (the card light, the hero card's scan line following the pointer) aresrc/pointer.ts, whichmain.tsloads only for a hover-capable fine pointer. The prerendered markup is always the finished state, so JavaScript off and reduced motion show it without animation. - Gradients: the live gradients are named canvases (
canvas[data-gradient]) thatsrc/gradient-canvas.tsmounts with the definitions insrc/gradients.ts, one kind of light per dark band: aurora over Greenshine's horizon in the hero, an eclipse under the mid-page statement, fluted glass in the skill card, dawn behind the closing name, and the project's own chrome inside the headline's "markdown" and the closing "mdfrom". Their MIT engine is vendored insrc/gradient-engine/, trimmed to the kinds those use (mesh,limb,chrome,aurora,radial-glow,rise,fluted); add a kind by copying its GLSL and WGSL twins from the served engine and registering it inkinds.ts. Local edits are strict-mode fixes, thedata-paintedmarker inmount.ts, and squaring by hand (or flooring at 0) wherever a shader callspow()on a base that can go negative, which is undefined on some GPUs (markedx-md:); check every newly copied shader for that. The page also runs three gradients.sh Pro components, ported from React to plain functions insrc/gradients-pro/(markedx-md:): Spotlight Grid on the card grids (pointer.ts), Border Beam round the converter (main.ts) and the Glow Tabs light (tabs.ts). The Pro presets and components are used under the owner's Pro license and tagged to that account: keep each file's license line and closing tag line, never copy any of it elsewhere, and do not add other Pro presets or components without the owner's say-so. Preset values may be customized (gradients.sh presets are meant to be tuned); each definition says which values it changed. Every canvas sits over something that already paints (each*-skybox's prerendered CSS fallback, the chrome words' static fill) except the hero's aurora, which is extra light over the arc (its full-band stand-in cost the throttled trace bench about 400 ms of first paint), andgradient-canvas.tsskips the live engine when WebGL2 is missing or the renderer is detected as software (SwiftShader, llvmpipe and similar), so a headless bench or screenshot that falls back to SwiftShader measures the fallback, not the live canvas. - Status URLs serve Markdown by default. Discord, Telegram, and Slack preview bots get Open Graph HTML from
lib/embed.tsviaapi/convert.ts;GET /oembedrewrites toapi/oembed.ts. - Landing content is pre-rendered at build time:
src/landing.tsholds the markup,src/vite-prerender-plugin.tswrites it intoindex.html, andsrc/main.tsonly enhances what is already there. The page must stay readable with JavaScript off, so put content inlanding.ts, not in a runtime DOM build. - The public pages carry a page-weight budget. Webfonts are self-hosted and subset to the range the site renders:
scripts/build-fonts.tswrites the content-hashed faces intopublic/fonts/,src/style.cssdeclares the landing ones,blume.config.tsdeclares the docs ones from the same files, and every page preloads all three landing faces (500, 700, and the 900 for itsh1) so none of them waits on style recalculation.bun run fonts:buildre-subsets (needsfontToolsand the network),bun run fonts:checkverifies the committed files offline, andsrc/fonts.test.tsfails if any rendered copy, docs page or OpenAPI description uses a character the subset drops. The stylesheet is inlined into each page bysrc/vite-inline-stylesheet-plugin.ts, andvite.config.tsgivessrc/style.cssa chunk of its own so no lazily loaded chunk lists the deleted file as a preload dependency (Chrome's parser fetched adisabledmarker link anyway, a 404 on every visit). GSAP, the gradient engine, the Pro lights, PostHog and Web Analytics load off the critical path (src/motion.ts,src/gradient-canvas.ts,src/gradients-pro/,src/posthog.ts,src/deferred.ts). Measure a change withbun bench/frontend-load.tsandnode bench/frontend-trace.mjsbefore keeping it. middleware.ts(Vercel Routing Middleware) does Accept-based content negotiation for/,/docs/*,/about,/contact,/privacy,/terms:Accept: text/markdownor?mode=agentrewrites to the page's.mdsibling, an unsatisfiable Accept is406, and every response getsVary: Acceptplus RFC 8288 discoveryLinks. The parser islib/negotiate.ts. A new negotiated page needs both a.mdsibling and a matcher entry.- Every API failure goes through
lib/apierror.ts: RFC 9457 problem details built fromERROR_CATALOG, which is the single source of the machinecode, its status, title, andresolution. Add a code there, not inline —lib/openapi.ts,api/index.ts, anddocs/errors.mdxall render from it. - Routes are versioned:
/api/v1/*is the stable machine surface, the permalink routes are the unversioned product surface, and/api/convertand/api/browseare deprecated aliases that must keep emittingDeprecation/Sunset/successor-version(setDeprecationHeadersinlib/apierror.ts). The published policy isdocs/versioning.mdx; keep it,x-api-lifecycleinlib/openapi.ts, and theversioningblock inapi/index.tsin agreement. - Quotas live in
lib/quotas.tsand are advertised bylib/ratelimit-headers.ts. Policy names ship in response headers and the OpenAPI document, so renaming one is a breaking change. packages/sdkis themdfromxnpm package (plain client plusmdfromx/effect). Its types, Effect Schemas and error classes are generated frompublic/openapi.jsonbyscripts/build-sdk.ts; fix a wrong field inlib/openapi.ts, never in the generated files. A change users of the package will notice needs a changeset (bunx changeset, then commit the.changeset/*.mdfile). Releases go through Changesets: merging pending changesets opens a "Version Packages" PR, and merging that PR is what publishes to npm. CI does not start on that bot PR by itself, so close and reopen it to get the requiredbuildcheck, or merge it with the admin bypass.lib/openapi.tsis the OpenAPI 3.1 source;bun scripts/build-openapi.tsrenders the committedpublic/openapi.jsonand--checkfails when it is stale. Discovery documents are hand-written underpublic/andpublic/.well-known/(llms.txt,agents.md,auth.md,pricing.md,ard.json,ai-catalog.json,api-catalog,mcp/server-card.json); Vite copiespublic/last, which is howopenapi.jsonoverrides blume's own.- The MCP server at
/mcpspeaks two protocol eras through one dispatch: modern (2026-07-28, stateless, version inMCP-Protocol-Versionandparams._meta, results carryresultTypeand cache hints) and legacy (2025-11-25and earlier,initializehandshake, untouched result shape).finalizeResultinlib/mcp.tsis what stamps the modern fields;negotiateProtocolis legacy-only and must never answer2026-07-28, which removedinitialize. Regeneratepublic/server.jsonandpublic/.well-known/mcp/server-card.jsonfromregistryManifest()/serverCard()when either changes — a test pins them. - Deploy: Vercel after
bun run build.vercel.jsonconfiguresdist, the API handlers, and the public route rewrites. - Live search provider:
lib/xsearch.ts; public allowance is a fixed 10 per IP per 15 min plus a shared pool computed inlib/pool.ts. Counters live inlib/ratelimit.ts(shared Redis vialib/redis.ts, memory fallback). FxTwitter search, the tier above it, sits behind a circuit breaker inlib/browse.tswhose state is shared throughlib/kv.ts, so one instance's failed probe cools down the fleet and the cooldown doubles per consecutive failure. Keep provider internals and capacity math out of public prose; describe it as a custom-built provider. - Checks before pushing:
bun run testandbun run build(the build already starts withtsc). After touchinglib/openapi.ts, runbun run openapi:buildand thenbun run sdk:build, and commit the regeneratedpublic/openapi.jsonandpackages/sdk/src/**/generated/— the build rewrites both in place, soopenapi:checkandsdk:checkonly ever catch a stale committed copy, which is their job in CI.mainis protected by a ruleset: open a PR, thebuildand CodeRabbit checks must pass, aPreviewdeployment is required, commits must be signed, and the branch must be up to date withmain. No approvals are required; merges are squash or merge, not rebase. - Reviews: CodeRabbit reviews every PR by default. Greptile's automatic reviews are off; it is an extra layer for PRs that could break something or need more testing than the unit suite gives: a public route, response shape, error code, quota, the OpenAPI document or SDK, the MCP server,
middleware.tsnegotiation, caching, the upstream providers, or the build and deploy config. For those, comment@greptileon the PR, with a line of focus when it helps (@greptile check the deprecated aliases still send Sunset). With the repository's Greptile environment active, that review runs TREX, which starts the app and tests the change end to end. Skip it for copy, docs, styling, and other low-risk PRs.
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
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.

