Micro Frontend Architect logo

Micro Frontend Architect

Community
roedyrustam
micro-frontend-architect

Micro-frontends with Webpack & Vite Module Federation / Arsitektur micro-frontend dengan Webpack & Vite Module Federation.

Overview

Publisherroedyrustam
Repositoryvibes-plug
Skill namemicro-frontend-architect
Stars
117
Forks
27
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by roedyrustam on GitHub. Read the source before you install it.

Installation

Install the Micro Frontend Architect AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/roedyrustam/vibes-plug/tree/main/skills/micro-frontend-architect
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/roedyrustam/vibes-plug.git /tmp/vibes-plug
mkdir -p .claude/skills
cp -r /tmp/vibes-plug/skills/micro-frontend-architect .claude/skills/micro-frontend-architect
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Micro Frontend Architect in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Micro Frontend Architect on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Micro Frontend Architect is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Micro-Frontend Architect (Module Federation 2.0 & Islands Edition)

English | Bahasa Indonesia


English

Orchestration & Integration

Connects and orchestrates with relevant domain skills:

  • design-system-architect — Shared versioned design systems, design tokens, and UI component libraries across host and remotes.
  • composable-mach-architect — Composable enterprise frontend shell orchestration and Backend-for-Frontend (BFF) routing.
  • ui-ux-pro-max — Seamless navigation consistency, layout coherence, and style harmonization across micro-apps.
  • visual-ui-auditor — Multimodal vision auditing of cross-MFE visual integration and CSS encapsulation leaks.
  • anti-slop — Anti-slop MFE architecture, strict singleton dependency contracts, and zero styling bleed.
  • senior-frontend & vue-frontend-expert — React 19 and Vue 3 host/remote implementations.
  • monorepo-architect — Managing multiple MFEs within a unified Turborepo/pnpm workspace.

Description

Production-grade guidance for decomposing large enterprise frontend monoliths into independently deployable Micro-Frontends (MFE). Covers Module Federation 2.0 (@module-federation/enhanced & Vite plugin) with dynamic TypeScript remote types, isolated Error & Suspense Boundaries per remote, typed cross-MFE communication via the browser CustomEvent bus, and CSS Cascade Layers (@layer) isolation.

Trigger Conditions

  • Splitting a large frontend codebase into independent domain verticals (Host Shell + Checkout/Analytics/Admin Remotes).
  • Configuring Module Federation 2.0 in Vite, Rspack, or Webpack.
  • Enforcing singleton framework sharing (react, react-dom, vue, pinia, @tanstack/react-query).
  • Preventing a crashed remote micro-app from taking down the entire host application shell.

Micro-Frontend Composition Matrix

Composition PatternIntegration LayerFramework AgnosticBest For
Module Federation 2.0Client/SSR Runtime (mf-manifest.json)✅Dynamic runtime composition with shared singleton libraries
Astro Server IslandsHTML Edge / Server Assembly✅Mixing React, Vue, and Svelte islands with zero client baseline JS
Multi-Zone RoutingReverse Proxy / Edge Path Rewrite✅Hard isolation between /app/*, /docs/*, and /checkout/*
Web Components (Shadow DOM)Custom Elements (customElements.define)✅Strict CSS & DOM encapsulation for embedded widgets

Core Implementation Patterns

1. Vite / Module Federation 2.0 Config with Strict Singletons

Always configure singleton: true on stateful libraries (react, react-dom, react-router, @tanstack/react-query) so two runtime copies never collide:

typescript
// apps/host-shell/vite.config.ts
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import { federation } from '@module-federation/vite';

export default defineConfig({
  plugins: [
    react(),
    federation({
      name: 'host_shell',
      remotes: {
        billing_remote: {
          type: 'module',
          name: 'billing_remote',
          entry: process.env.VITE_BILLING_REMOTE_URL ?? 'http://localhost:5001/mf-manifest.json',
        },
      },
      shared: {
        react: { singleton: true, requiredVersion: '^19.0.0' },
        'react-dom': { singleton: true, requiredVersion: '^19.0.0' },
        '@tanstack/react-query': { singleton: true, requiredVersion: '^5.0.0' },
      },
    }),
  ],
  build: {
    target: 'chrome115',
  },
});

2. Resilient Remote Loader with Fault-Isolated Error Boundary

A remote micro-frontend deployment or CDN outage must never crash the Host Shell. Wrap every remote import in a dedicated Error Boundary + Suspense fallback:

tsx
// apps/host-shell/src/components/RemoteSlot.tsx
import React, { Component, Suspense, type ReactNode } from 'react';

interface RemoteSlotProps {
  remoteName: string;
  children: ReactNode;
}

interface RemoteSlotState {
  hasError: boolean;
  errorMessage: string | null;
}

export class RemoteSlot extends Component<RemoteSlotProps, RemoteSlotState> {
  state: RemoteSlotState = { hasError: false, errorMessage: null };

  static getDerivedStateFromError(error: Error): RemoteSlotState {
    return { hasError: true, errorMessage: error.message };
  }

  private handleRetry = () => {
    this.setState({ hasError: false, errorMessage: null });
  };

  render() {
    if (this.state.hasError) {
      return (
        <section
          role="alert"
          className="rounded-xl border border-neutral-800 bg-neutral-950 p-6 text-neutral-200"
        >
          <p className="text-xs font-mono uppercase tracking-wider text-amber-400">
            Module Unavailable: {this.props.remoteName}
          </p>
          <p className="mt-1 text-sm text-neutral-400">
            This micro-application failed to load ({this.state.errorMessage}). Other workspace modules remain active.
          </p>
          <button
            type="button"
            onClick={this.handleRetry}
            className="mt-4 rounded-lg border border-neutral-700 bg-neutral-900 px-3.5 py-1.5 text-xs font-medium text-neutral-100 hover:bg-neutral-800 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-amber-400"
          >
            Reload Module
          </button>
        </section>
      );
    }

    return (
      <Suspense
        fallback={
          <div className="h-48 w-full animate-pulse rounded-xl border border-neutral-800 bg-neutral-900/50" />
        }
      >
        {this.props.children}
      </Suspense>
    );
  }
}

3. Typed Cross-MFE Event Bus (Zero Coupled State)

Avoid sharing global Redux/Zustand stores across team boundaries. Use a typed contract over native DOM CustomEvent:

typescript
// packages/mfe-contracts/src/event-bus.ts
export interface MfeEventMap {
  'mfe:cart:item-added': { sku: string; quantity: number; priceMinor: number };
  'mfe:auth:tenant-switched': { tenantId: string; role: 'admin' | 'member' };
}

export function emitMfeEvent<K extends keyof MfeEventMap>(
  eventName: K,
  payload: MfeEventMap[K]
): void {
  window.dispatchEvent(new CustomEvent(eventName, { detail: payload }));
}

export function onMfeEvent<K extends keyof MfeEventMap>(
  eventName: K,
  handler: (payload: MfeEventMap[K]) => void
): () => void {
  const listener = (event: Event) => {
    const customEvent = event as CustomEvent<MfeEventMap[K]>;
    handler(customEvent.detail);
  };
  window.addEventListener(eventName, listener);
  return () => window.removeEventListener(eventName, listener);
}

Verification Checklist

  • Core framework packages (react, react-dom, vue) are configured with singleton: true in Module Federation.
  • Every remote MFE mount point is wrapped in a fault-isolated ErrorBoundary and <Suspense> skeleton.
  • Cross-MFE communication uses URL search params or a typed CustomEvent contract rather than coupled global state.
  • CSS rules are scoped via CSS Modules, Tailwind prefix/layers (@layer mfe-billing), or Shadow DOM to prevent style bleed.

Sovereign Execution, Token Efficiency & Invariants

DimensionSovereign Mandate & Deterministic Contract
Frontier Model CascadeMedium / High (Gemini 4 Argon, Claude Sonnet 5.5 High, Muse Wonder High, Composer 2.5 Fast)
Availability FallbackGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Zero unhandled missing-model errors)
KV-Cache & Token ProtocolPin static instructions & schemas at prompt prefix (kv-cache-prefix-optimizer); pass surgical CONTEXT_MAP.md slices (<250 tokens/call) during Swarm Fan-Out
SaaT CLI & MCP DispatchCLI: vibes skill exec micro-frontend-architect <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_visual_audit, vibes_ast_query, vibes_verify_gate
NFR & Anti-Slop InvariantsLCP < 1.8s, INP < 100ms, CLS < 0.05, 1px crisp borders, 3-tier radius (6px/8px/12px), tabular-nums, 5-state interactive contract; 100% complete zero-placeholder output verified via node scripts/check-anti-slop.js --strict


Bahasa Indonesia

Integrasi Orkestrasi

Terhubung dan mengorkestrasi skill domain yang relevan:

  • design-system-architect — Sistem desain terversi bersama, token desain, dan pustaka komponen UI lintas host dan remote.
  • composable-mach-architect — Orkestrasi shell frontend enterprise komposabel dan routing BFF.
  • ui-ux-pro-max — Konsistensi navigasi mulus, koherensi tata letak, dan harmonisasi gaya antar aplikasi mikro.
  • visual-ui-auditor — Audit visual multimodal untuk integrasi visual lintas MFE dan kebocoran enkapsulasi CSS.
  • anti-slop — Arsitektur MFE anti-slop, kontrak dependensi singleton yang ketat, dan nol kebocoran styling.
  • senior-frontend & vue-frontend-expert — Implementasi host/remote React 19 dan Vue 3.
  • monorepo-architect — Pengelolaan multi-MFE dalam workspace Turborepo/pnpm terpadu.

Deskripsi

Panduan kelas produksi untuk memecah aplikasi frontend monolitik berskala besar menjadi Micro-Frontends (MFE) yang dapat di-deploy secara independen menggunakan Module Federation 2.0, lengkap dengan isolasi Error Boundary per modul, Event Bus bertipe kuat, dan enkapsulasi CSS.

Panduan Arsitektur Inti

  1. Singleton Dependency Sharing: Wajib tandai react, react-dom, vue, dan @tanstack/react-query dengan singleton: true agar browser tidak memuat dua instance runtime yang saling bertabrakan.
  2. Isolasi Kegagalan (Fault Isolation): Bungkus setiap komponen Remote di dalam ErrorBoundary dan <Suspense> khusus agar gangguan pada satu MFE tidak mematikan Host Shell utama.
  3. Komunikasi Terdekopel: Gunakan kontrak CustomEvent bertipe di window atau parameter URL, hindari berbagi global store secara langsung antar tim.

Daftar Periksa Verifikasi (Checklist)

  • Pustaka utama (react, react-dom, vue) ditandai sebagai singleton: true.
  • Setiap titik muat Remote dibungkus dengan ErrorBoundary dan skeleton <Suspense>.
  • Komunikasi lintas MFE menggunakan CustomEvent bertipe kuat.
  • CSS dienkapsulasi dengan CSS @layer atau CSS Modules agar tidak bocor antar aplikasi.

Matriks Eksekusi Berdaulat, Efisiensi Token & Invarian

DimensiMandat Berdaulat & Kontrak Deterministik
Kaskade Model FrontierMedium / High (Gemini 4 Argon, Claude Sonnet 5.5 High, Muse Wonder High, Composer 2.5 Fast)
Invarian Fallback KetersediaanGemini 4 Argon/Pro -> Gemini 3.8 Flash; Claude Opus 5.5 -> Claude Opus 4.6 (Bebas gagal saat model belum tersedia/kuota penuh)
Protokol Hemat Token & KV-CacheKunci instruksi & skema statis di prefix awal (kv-cache-prefix-optimizer); kirim potongan CONTEXT_MAP.md (<250 token/panggilan) saat Fan-Out
Eksekusi SaaT CLI & MCPCLI: vibes skill exec micro-frontend-architect <audit|eval|verify|generate|blueprint> / MCP: vibes_skill_dispatch, vibes_visual_audit, vibes_ast_query, vibes_verify_gate
Invarian NFR & Anti-SlopLCP < 1.8s, INP < 100ms, CLS < 0.05, border tegas 1px, radius 3-tier (6px/8px/12px), tabular-nums, kontrak interaktif 5-state; kode 100% tuntas tanpa placeholder diverifikasi melalui node scripts/check-anti-slop.js --strict

Frequently asked questions

What does the Micro Frontend Architect AI skill do?

Micro-frontends with Webpack & Vite Module Federation / Arsitektur micro-frontend dengan Webpack & Vite Module Federation.

Why use Micro Frontend Architect on TypingMind?

Because you install it once and use it with any model. Micro Frontend Architect is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Micro Frontend Architect in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/roedyrustam/vibes-plug/tree/main/skills/micro-frontend-architect. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Micro Frontend Architect?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Micro Frontend Architect?

As many as you like. As long as a model supports skills, you can use Micro Frontend Architect with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Micro Frontend Architect AI skill free?

Yes. It is published on GitHub by roedyrustam under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇