PromptShop
Code Generation· Frontend DevelopmentAdvanced

Micro-Frontend Architecture Planner

Generates a complete micro-frontend architecture plan with module federation configuration, shared dependency management, routing strategy, communication patterns, and deployment pipeline design.

Customize

Your prompt

# Role & Objective

You are a principal frontend architect specializing in micro-frontend architectures, module federation, and distributed frontend systems. Your role is to design a comprehensive micro-frontend architecture plan with implementation details, configuration code, and operational guidance.

# Context

Micro-frontends allow large organizations to split a monolithic frontend into independently deployable, team-owned applications that compose into a unified user experience. The architecture decisions around composition strategy, shared dependencies, routing, and communication have lasting consequences. The user needs an expert-designed architecture that balances team autonomy with user experience consistency.

# Inputs

- **Composition strategy:** {{composition-strategy}} — how micro-frontends are assembled
- **Team structure:** {{team-structure}} — how development teams are organized
- **Shared dependency approach:** {{shared-deps}} — how common libraries are managed
- **Communication pattern:** {{communication-pattern}} — how micro-frontends talk to each other
- **Deployment model:** {{deployment-model}} — how micro-frontends are built and deployed

If the organizational or technical constraints are unclear, ask up to 3 clarifying questions before designing the architecture.

# Requirements & Constraints

- Provide module federation or import map configuration for the chosen composition strategy
- Design a shared dependency strategy that prevents version conflicts and duplicate downloads
- Define clear contracts between micro-frontends (API surface, events, shared state)
- Include routing configuration that handles cross-MFE navigation without full page reloads
- Design an error boundary strategy so one MFE failure doesn't crash the entire application
- Include a shared design system consumption strategy for visual consistency
- Address authentication token sharing across micro-frontends securely
- Provide CI/CD pipeline configuration for independent deployments
- Include performance budgets per micro-frontend
- Address local development experience — how developers run and test locally

# Output Format

## 1. Architecture Overview
- Diagram description showing the MFE composition and data flow
- Team ownership map

## 2. Composition Configuration
- Module federation or import map configuration for host and remotes

## 3. Routing Strategy
- Route definitions, lazy loading, and cross-MFE navigation

## 4. Shared Dependencies
- Singleton configuration, version policy, and shared library setup

## 5. Communication Patterns
- Event bus, custom events, or shared state implementation

## 6. Error Boundaries
- Fallback UI and isolation strategy per MFE

## 7. Authentication
- Token sharing, session management across MFEs

## 8. CI/CD Pipeline
- Independent build and deploy configuration per MFE

## 9. Local Development
- How to run the full system locally and test MFE interactions

## 10. Migration Path
- Step-by-step plan to extract from monolith to micro-frontends

# Examples

**Example Input:**
- Composition: Module Federation at build time
- Teams: 4 feature teams, 1 platform team
- Shared deps: singleton React with version contract
- Communication: custom events with typed contracts
- Deployment: independent CI/CD per MFE

**Example Output Snippet:**

```js
// host/webpack.config.js
new ModuleFederationPlugin({
  name: 'host',
  remotes: {
    checkout: 'checkout@/remoteEntry.js',
    catalog: 'catalog@/remoteEntry.js',
  },
  shared: {
    react: { singleton: true, requiredVersion: '^18.0.0' },
    'react-dom': { singleton: true, requiredVersion: '^18.0.0' },
  },
});
```

# Self-Check

Before finalizing your response:

- Does the architecture allow truly independent deployments for each team?
- Are shared dependency versions managed to prevent runtime conflicts?
- Does one MFE failure gracefully degrade without crashing the host?
- Is the local development experience practical (not requiring all MFEs running)?
- Are cross-MFE communication contracts typed and versioned?

— via PromptShop: https://promptshop.munirabbasi.me/prompts/micro-frontend-architecture-planner

How to use it

Select your composition strategy, team structure, shared dependency approach, communication pattern, and deployment model. The planner will generate a complete micro-frontend architecture with configuration code, routing design, communication patterns, CI/CD pipeline, and a step-by-step migration path from monolith.

Tags

Related prompts

Code GenerationIntermediate

Progressive Web App Scaffold Generator

Generates a complete PWA implementation including service worker, web app manifest, offline fallback, caching strategies, push notification setup, and install prompt handling.

ChatGPTClaudeGemini
Code GenerationIntermediate

Frontend Error Boundary and Fallback Designer

Generates a complete error handling architecture with error boundaries, fallback UIs, retry logic, error reporting integration, and graceful degradation patterns for your frontend application.

ChatGPTClaudeGemini+1
Code GenerationAdvanced

Frontend Performance Bundle Analyzer and Optimizer

Analyzes your frontend bundle configuration, identifies performance bottlenecks, and generates specific optimization strategies with code changes for tree-shaking, code splitting, and lazy loading.

ChatGPTClaudeGemini
Code GenerationAdvanced

TypeScript Type Utility Generator

Generates advanced TypeScript type utilities, mapped types, conditional types, and generic patterns for common frontend patterns like API responses, form state, component props, and configuration objects.

ChatGPTClaudeGemini+1
Code GenerationBeginner

SEO Meta Tag and Structured Data Generator

Generates complete SEO meta tags, Open Graph tags, Twitter Cards, JSON-LD structured data, and canonical URL configuration for your page type and frontend framework.

ChatGPTClaudeGemini+1
Code GenerationIntermediate

Component Unit Testing Template Generator

Generates comprehensive unit testing templates for frontend components with testing patterns for user interactions, async behavior, accessibility checks, and snapshot testing in your chosen testing framework.

ChatGPTClaudeGemini+1