Architecture Micro Frontendsのロゴ

Architecture Micro Frontends

コミュニティ
j4flmao
architecture-micro-frontends

Use this skill when the user says 'micro-frontends', 'MFE', 'Module Federation', 'split the frontend monolith', 'independent frontend deploys', 'single-spa', 'import maps', 'app shell with remotes'. Decides whether micro-frontends are justified and designs the split, composition technique (build-time, Module Federation, Web Components, server/edge composition, iframes), shared dependencies, routing, communication, and styling isolation. Do NOT use for: component library/design system work (frontend/universal/design-system), framework-specific architecture (frontend/<framework>), or bundler tuning unrelated to federation (frontend/universal/bundler-tools).

概要

公開者j4flmao
リポジトリagent-skills
スキル名architecture-micro-frontends
スター
41
フォーク
6
同梱ファイル
指示のみ
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    j4flmaoがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「Architecture Micro Frontends」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/micro-frontends
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/j4flmao/agent-skills.git /tmp/agent-skills
mkdir -p .claude/skills
cp -r /tmp/agent-skills/skills/architecture/micro-frontends .claude/skills/architecture-micro-frontends
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでArchitecture Micro Frontendsを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にArchitecture Micro Frontendsを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Architecture Micro Frontendsは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Micro-Frontends

Purpose

Micro-frontends let independent teams build, test, and deploy parts of one web UI separately. They solve an organizational scaling problem (many teams blocking each other on one release), not a technical performance problem, and they add runtime complexity, duplication risk, and consistency work. Use them when team autonomy is the bottleneck; otherwise a well-structured modular monolith is cheaper.

Agent Protocol

Trigger

"micro-frontends", "MFE", "Module Federation", "remoteEntry", "single-spa", "import maps", "app shell", "independent UI deployments".

Input Context

  • Number of teams and how they map to product areas.
  • Current frontend stack(s), build tooling (webpack, Rspack, Vite), deployment pipeline.
  • Pain points: release coordination, build times, ownership conflicts.
  • SEO/SSR requirements and performance budgets.

Output Artifact

Go/no-go decision, domain split, composition approach, shared-dependency policy, contracts (routes, events), and governance rules.

Response Format

Decision: {MFE|modular monolith} because {reason}
Split: {MFE: owning team, routes}
Composition: {build-time|module federation|web components|server/edge|iframe}
Shared: {react@x singleton, design-system@y} policy={versions}
Comms: {URL/state params|CustomEvent|shared minimal store}
Styling isolation: {CSS Modules|Shadow DOM|prefix}
Perf budget: {JS KB per route}

Completion Criteria

  • MFEs split by business domain/route, not by technical layer.
  • One framework major version enforced for shared singletons.
  • Contracts between host and remotes versioned and tested.
  • Remote failures degrade gracefully (error boundary/fallback).
  • Performance budget measured per route.

Should You?

SignalPoints to
1-3 teams, one product areaModular monolith (monorepo packages, enforced boundaries)
Many teams blocked on one release trainMicro-frontends
Need to embed legacy app during migrationMFE (strangler pattern)
Mixed frameworks as a goal in itselfRed flag: cost without benefit

Composition Techniques

TechniqueWhen composedProsCons
Build-time packages (npm)BuildSimple, type-safeNot independently deployable (host must rebuild)
Module Federation (webpack 5, Rspack, @module-federation/* incl. Vite plugin)Runtime (JS)Independent deploys, shared singletonsTooling coupling, version skew at runtime
single-spa / import mapsRuntimeFramework-agnostic lifecycleMore glue code
Web ComponentsRuntime (DOM)Framework-agnostic, Shadow DOM isolationPassing rich data/callbacks is clunky; SSR limited
Server/edge composition (SSI/ESI, fragments)RequestGood for SEO and first paintInfra complexity, interactivity wiring
iframesRuntimeStrong isolationPoor UX for layout, routing, overlays, a11y

Module Federation Example (webpack 5)

js
// checkout/webpack.config.js  (remote)
const { ModuleFederationPlugin } = require("webpack").container;
const deps = require("./package.json").dependencies;

module.exports = {
  output: { publicPath: "auto", uniqueName: "checkout" },
  plugins: [
    new ModuleFederationPlugin({
      name: "checkout",
      filename: "remoteEntry.js",
      exposes: { "./CheckoutPage": "./src/CheckoutPage" },
      shared: {
        react: { singleton: true, requiredVersion: deps.react },
        "react-dom": { singleton: true, requiredVersion: deps["react-dom"] },
      },
    }),
  ],
};
js
// shell/webpack.config.js  (host)
new ModuleFederationPlugin({
  name: "shell",
  remotes: { checkout: "checkout@https://cdn.example.com/checkout/remoteEntry.js" },
  shared: { react: { singleton: true, requiredVersion: deps.react },
            "react-dom": { singleton: true, requiredVersion: deps["react-dom"] } },
});
tsx
// shell/src/routes.tsx
import { lazy, Suspense } from "react";
import { ErrorBoundary } from "react-error-boundary";

const CheckoutPage = lazy(() => import("checkout/CheckoutPage"));

export function CheckoutRoute() {
  return (
    <ErrorBoundary fallback={<p>Checkout is temporarily unavailable.</p>}>
      <Suspense fallback={<p>Loading checkout…</p>}>
        <CheckoutPage />
      </Suspense>
    </ErrorBoundary>
  );
}

For dynamic remote URLs per environment, load a manifest at runtime (Module Federation 2 runtime APIs or your own config endpoint) instead of hardcoding CDN paths.

Contracts and Communication

  • Routing: the shell owns top-level routes; each MFE owns its sub-routes.
  • Data: pass via URL/route params and props at the mount point; share auth/session via the shell, not via each MFE's own login.
  • Events: window.dispatchEvent(new CustomEvent("cart:item-added", { detail: { sku, qty } })) with a documented, versioned event catalog.
  • Shared state: keep it minimal (user, locale, feature flags), exposed through a small typed API from the shell; never a shared global Redux store whose shape other teams depend on.

Styling and Design Consistency

  • Scope styles: CSS Modules, CSS-in-JS with unique prefixes, or Shadow DOM for Web Components.
  • Share a design system as a versioned package (tokens + components); it is the main lever for consistent UX.
  • Avoid global resets inside remotes.

Performance

  • Share framework singletons; audit bundles per route for duplicated libraries.
  • Preload remoteEntry for likely-next routes; lazy-load the rest.
  • Set a JS budget per route and enforce it in CI.

Governance

  • Compatibility rules: host and remotes agree on React/Vue major version and design-system major version; upgrades are coordinated platform work.
  • Contract tests: shell smoke tests against each remote's deployed remoteEntry before promotion.
  • Independent rollback per remote (versioned remote URLs).

Anti-Patterns

  • Splitting by technical layer (header team, button team).
  • Multiple framework majors loaded on one page.
  • Shared mutable global store across teams.
  • Remote failure crashes the whole shell (no error boundary).
  • MFEs for a single team "for the future".

Checklist

  • Organizational justification recorded.
  • Domain-aligned split with route ownership.
  • Composition technique chosen per SEO/SSR needs.
  • Shared singleton and version policy enforced.
  • Event/prop contracts versioned and tested.
  • Style isolation + shared design system.
  • Per-route performance budget and fallback UI.

References

  • Geers, "Micro Frontends in Action" (Manning, 2020); martinfowler.com, "Micro Frontends" (Cam Jackson, 2019).
  • webpack Module Federation docs; module-federation.io (Module Federation 2, Rspack/Vite plugins); single-spa docs.

よくある質問

AIスキル「Architecture Micro Frontends」では何ができますか?

Use this skill when the user says 'micro-frontends', 'MFE', 'Module Federation', 'split the frontend monolith', 'independent frontend deploys', 'single-spa', 'import maps', 'app shell with remotes'. Decides whether micro-frontends are justified and designs the split, composition technique (build-time, Module Federation, Web Components, server/edge composition, iframes), shared dependencies, routing, communication, and styling isolation. Do NOT use for: component library/design system work (frontend/universal/design-system), framework-specific architecture (frontend/<framework>), or bundler...

TypingMindでArchitecture Micro Frontendsを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Architecture Micro Frontendsはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにArchitecture Micro Frontendsをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/j4flmao/agent-skills/tree/main/skills/architecture/micro-frontendsを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

Architecture Micro Frontendsを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

Architecture Micro Frontendsで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもArchitecture Micro Frontendsを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Architecture Micro Frontends」は無料ですか?

はい。j4flmaoがMITライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇