agentleFS
lucamezzaliralucamezzalira/mfe-skills/AGENTS.md

mfe-skills

AGENTS.md53 starsChanged 2 months agoMITView on GitHub

Micro-frontend architecture skills by Luca Mezzalira (mfe-skills v1.0.0). Full reference: https://github.com/lucamezzalira/mfe-skills Apply these rules when reviewing or generating code that crosses a team deployment boundary: shell mounting, cross-MFE communication, remote loading, or contract design. Essential: Pair this file with project-specific facts in the same AGENTS.md (which team owns which MFE, toolchain, routes.json location, known exceptions). Without that context, advice stays generic. Before generating MFE code, verify: If any answer is no, the boundary needs to be revisited before implementation. Install:…

The file

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

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

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

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

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Before generating MFE code, verify:

    line 13
  2. Distinctive:

    If any answer is no, the boundary needs to be revisited before implementation.

    line 23
  3. Distinctive:

    No shared stores across boundaries.

    line 51

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

MFE Boundary Governance

Micro-frontend architecture skills by Luca Mezzalira (mfe-skills v1.0.0). Full reference: https://github.com/lucamezzalira/mfe-skills

Apply these rules when reviewing or generating code that crosses a team deployment boundary: shell mounting, cross-MFE communication, remote loading, or contract design.

Essential: Pair this file with project-specific facts in the same AGENTS.md (which team owns which MFE, toolchain, routes.json location, known exceptions). Without that context, advice stays generic.

Boundary health check

Before generating MFE code, verify:

  1. Is the API surface minimal, fewer than 5 props to the container?
  2. Is the MFE context-aware, does it retrieve its own data given minimal input?
  3. Is it less extensible than a component, not designed for reuse across domains?
  4. Is it coarse-grained, not fine enough to require constant coordination?
  5. Can it deploy without coordinating with other teams?
  6. Does it have a graceful fallback if it fails to load?
  7. Does a single team own it end-to-end?

If any answer is no, the boundary needs to be revisited before implementation.

The eight boundary rules

RulePrincipleViolation signals
1 - Business subdomainOne MFE = one business capability owned by one teamNamed after UI elements (Header, Sidebar), used across unrelated domains
2 - Minimal API surfaceMax ~5 props, identifiers only, no domain objectsProps like user, cart, order; shell fetching data for the MFE
3 - Hides implementationNo cross-MFE imports; each MFE owns its data layerimport { x } from '@org/other-mfe/...'; path aliases masking cross-boundary imports
4 - Events not shared statePlatform bus to shell; domain events peer-to-peer only; no shared storesShared Redux/Zustand; window.__mfe_*; shell listening to catalog:* / checkout:*
5 - Independent deploymentNo versioned remote URLs; no CI couplingremotes: { checkout: '...@/v3.2.1/remoteEntry.js' }; CI needs: across MFE pipelines
6 - Isolates failureErrorBoundary in shell at every mount; fallbacks in shellNo boundary; fallback only inside MFE; unhandled loadRemoteModule rejection
7 - Coarse-grainedShell first URL segment via manifest; MFE owns sub-routesShell routes like /catalog/product/:id; shell domain event handlers
8 - Single team ownershipOne team in CODEOWNERS per MFEMultiple teams per MFE; no deployment owner

Severity levels

  • Critical (Rules 3, 4): Cross-boundary imports, shared state, shell domain event handlers.
  • High (Rules 2, 5, 6): API surface, deployment coupling, missing error boundaries.
  • Medium (Rules 1, 7, 8): Domain alignment, granularity, ownership.

Code generation defaults

  • Props: identifiers only (userId, cartId), never domain objects
  • Error handling: ErrorBoundary in the shell wrapping every remote mount
  • Routing: shell loads only the first path segment from routes.json; MFE owns deeper paths
  • Shell platform events: shell:alert, shell:modal:* — never catalog:*, checkout:* in the shell
  • Cross-area navigation: URL (change first segment); MFE-to-MFE domain events only on the same page (horizontal split)
  • No shared stores across boundaries; use URL, storage, or peer events
  • Loading: runtime remote URLs, never version-pinned remotes in the shell build
  • Auth: sessionStorage or fetch wrapper, never cross-MFE auth imports

Skills and Canvas

  • Architecture and adoption: understanding-mfe-architecture skill
  • Code review and shell generation: reviewing-mfe-boundaries skill
  • Canvas facilitation: separate micro-frontend-canvas skill

Install: https://github.com/lucamezzalira/mfe-skills

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.