agentleFS
VercelKnown publishervercel/microfrontends/AGENTS.md

microfrontends

AGENTS.md45 starsChanged 7 months agoMITView on GitHub

This is a monorepo for @vercel/microfrontends, a library that enables splitting large applications into independently developed and deployed microfrontends on Vercel. The package provides generic platform support for microfrontends in multiple frameworks, such as Next.js, SvelteKit, React Router, Vite, and React. When running commands for a specific application, do not cd into the directory. Run commands from the root. The above commands can be run for a particular package by using a filter option: pnpm checks -F <package name>. Use…

  • 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 repository2 other files it gives its agents.

The file

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

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use pnpm for package management

    line 17
  2. Very specific:

    Follow Vercel style guide (configured via @vercel/style-guide)

    line 20
  3. Very specific:

    When running commands for a specific application, do not cd into the directory.

    line 32
  4. Very specific:

    Make sure that pnpm checks is successful for the entire repository when verifying a change.

    line 34
  5. Distinctive:

    When testing a change, make sure that these dev commands all start up the server successfully.

    line 44

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

CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

Project Overview

This is a monorepo for @vercel/microfrontends, a library that enables splitting large applications into independently developed and deployed microfrontends on Vercel. The package provides generic platform support for microfrontends in multiple frameworks, such as Next.js, SvelteKit, React Router, Vite, and React.

Repository Structure

  • packages/microfrontends/ - The main @vercel/microfrontends package (the only publishable package)
  • examples/ - Working examples of microfrontend implementations (nextjs-app, nextjs-pages, react-router, single-spa, sveltekit, etc.)

Technologies

  • This is a TypeScript codebase
  • Use pnpm for package management
  • Turbo manages the monorepo build pipeline
  • The package uses dual ESM/CJS exports via tsup
  • Follow Vercel style guide (configured via @vercel/style-guide)
  • Be familiar with Module Federation, single-spa, and Next.js Multi-Zones

Common Commands

  • pnpm build - Build all packages using Turbo
  • pnpm test - Run unit tests for all packages
  • pnpm lint - Run ESLint on all packages
  • pnpm format - Format all files with Prettier
  • pnpm typecheck - Run TypeScript type checking
  • pnpm checks - Run build, lint, test, and typecheck on all packages (run before submitting PRs)

When running commands for a specific application, do not cd into the directory. Run commands from the root. The above commands can be run for a particular package by using a filter option: pnpm checks -F <package name>. Use this.

Make sure that pnpm checks is successful for the entire repository when verifying a change.

Dev examples

  • pnpm dev:nextjs-app - Run the Next.js App Router example
  • pnpm dev:nextjs-pages - Run the Next.js Pages Router example
  • pnpm dev:react-router - Run the React Router example
  • pnpm dev:single-spa - Run the single-spa example
  • pnpm dev:sveltekit - Run the SvelteKit example

When testing a change, make sure that these dev commands all start up the server successfully. If the server is running and there are no errors after 30 seconds, consider that successful.

NPM Package Management

  • pnpm changeset - Create a changeset for releasing
  • pnpm version-packages - Version packages based on changesets

Architecture

Configuration

The microfrontends configuration is defined in microfrontends.json (or .jsonc) files that live in each application. The schema is at packages/microfrontends/schema/schema.json.

Key configuration concepts:

  • Applications: Named microfrontends that map to Vercel project names
  • Routing: Path patterns that determine which microfrontend handles which routes
  • Development: Local and fallback URLs for development
  • Asset Prefix: Unique identifiers for static assets per microfrontend
  • Flags: Feature flags that conditionally route requests to different microfrontends

Core Components

  1. Config Layer (src/config/)

    • microfrontends-config/ - Configuration parsing and validation
    • microfrontends/server/ - Server-side configuration utilities
    • overrides/ - Routing overrides
    • well-known/ - Well-known endpoints for client-side
  2. Next.js Integration (src/next/)

    • config/ - withMicrofrontends() wrapper that transforms Next.js config
    • middleware/ - Routing middleware for Next.js that handles path matching and zone routing when using feature flags
    • client/ - Client-side utilities (Link component, prefetch)
    • testing/ - Testing utilities for Next.js microfrontends
  3. Other Framework Support (src/)

    • sveltekit/ - SvelteKit integration
    • vite/ - Vite integration
  4. CLI & Local Proxy (src/bin/)
    • local-proxy.ts - HTTP proxy for local development that routes requests between locally running microfrontends or falls back to production
    • index.ts - CLI commands (microfrontends proxy, microfrontends port)

Mirrored files

AGENTS.md and packages/microfrontends/README.md are copies of CLAUDE.md and README.md respectively, regenerated on pnpm install via the prepare script. Do not edit them directly — changes will be overwritten. Edit the source files instead:

  • To update AI agent instructions: edit CLAUDE.md
  • To update the README: edit the root README.md (copied to packages/microfrontends/README.md on pnpm install)

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.