mfe-angular-build
Build, orchestrate, benchmark, and audit Angular 18 Micro-Frontend with Rsbuild & Module Federation 2.0 via multi-agent workflow.
- License 许可
- MIT
- 最近更新
- 2026-11-06
- Stars
- ★ 0
- Forks
- 0
01 前言 Front Matter
- name
- mfe-angular-build
- author
- Supervisor SLPC
- license
- MIT
- version
- 1.0.0
- metadata
- { "tags": [ "angular18", "rsbuild", "micro-frontend", "module-federation-v2", "benchmark", "bundle-audit", "workflow" ] }
- platforms
- [ "linux", "macos", "windows" ]
- description
- Build, orchestrate, benchmark, and audit Angular 18 Micro-Frontend with Rsbuild & Module Federation 2.0 via multi-agent workflow.
03 SKILL.md 正文
MFE Angular Build Skill (mfe-angular-build)
Kỹ năng điều phối vòng đời build, benchmark tốc độ và audit dung lượng bundle cho hệ thống Angular 18+ Micro-Frontend sử dụng engine Rsbuild (Rspack Rust) và Module Federation 2.0.
1. When to Use
Kích hoạt skill này khi:
- Build toàn bộ Workspace: Cần biên dịch đồng thời Host Shell và các Remote MFEs (CRM, CDP) ở chế độ song song thực sự (
scripts/build-parallel.mjs). - Benchmark Tốc Độ Build: Cần so sánh chính xác Cold Build, Warm Cache Build và HMR latency giữa Rsbuild và Webpack / Native Angular CLI.
- Audit Kích Thước Bundle: Đo đạc Raw Size, Gzip Size, phân tích các chunk nặng (>3MB), và xuất báo cáo tự động cho GitHub Actions (
GITHUB_STEP_SUMMARY) hoặc Jenkins. - Kiểm tra Chuẩn Kiến trúc MF v2: Rà soát các lỗi kinh điển như cấu hình sai URL manifest (
mf-manifest.json), thiếuassetPrefix: 'auto', hoặc rò rỉ singleton@angular/core.
2. Quy Trình Vận Hành 4 Giai Đoạn (4-Stage Pipeline)
[Stage 1: Pre-flight Validation]
• Rà soát module-federation.shared.ts & port mapping (4200, 4204, 4205)
• Xác nhận cấu hình manifest-first (mf-manifest.json)
│
▼
[Stage 2: Parallel Compilation]
• Kích hoạt scripts/build-parallel.mjs (Promise.all đa tiến trình)
• Biên dịch đồng thời: app-shell (Host) + mfe-crm + mfe-cdp (<25s cho gói 51MB)
│
▼
[Stage 3: Bundle Sizing Audit]
• Chạy scripts/bundle-size.mjs
• Trích xuất Raw Size, Gzip Transfer Size, Top 5 heaviest chunks
│
▼
[Stage 4: Verification & Smoke Test]
• Smoke test HTTP endpoints (/healthz, /, /crm, /cdp)
• Xác nhận không có cảnh báo CORS hoặc duplicate Angular instance
3. Danh Mục Lệnh Thực Thi Nhanh
A. Khởi chạy toàn bộ hệ thống
npm run start:all
# Host Shell: http://localhost:4200/
# MFE CRM : http://localhost:4204/
# MFE CDP : http://localhost:4205/
B. Biên dịch song song đa luồng (Rsbuild Engine)
# Biên dịch môi trường Staging
npm run build:staging
# Hoặc chạy trực tiếp script song song
node scripts/build-parallel.mjs
C. Đo kiểm tốc độ Benchmark
npm run benchmark
D. Kiểm tra và Audit kích thước Bundle
npm run bundle:size
E. Đóng gói và chạy Docker Container
npm run docker:build
npm run docker:run
# Kiểm tra: curl http://localhost:4200/healthz
4. Các Quy Chuẩn Bắt Buộc Cần Ghi Nhớ
- Manifest-First: Luôn dùng
mf-manifest.jsontrongremotes: {}thay vìremoteEntry.mjs. - Asset Prefix: Remote bắt buộc đặt
assetPrefix: 'auto'trong môi trường staging/production để không bị lỗi 404 hình ảnh/assets khi chạy qua Host. - Singleton Enforcement:
@angular/*,rxjs,zone.jsbắt buộc đặtsingleton: truetrongmodule-federation.shared.ts.
04 同仓库更多 Skills
workflow-launch-exec
Launch, orchestrate, and drive end-to-end multi-agent pipelines (BA -> DESIGN -> DEV -> VERIFY) for any task.
paseo-handoff
Hand off the current task to another agent with full context. Use when the user says "handoff", "hand off", "hand this to", or wants to pass work to another agent.
loop-me
Grill me about specs for the workflows I want to build, within this workspace.
loop-engineering
Use when the user wants Claude Code to keep working on its own until a goal is met — a self-running loop instead of write→wait→review→re-prompt. Helps decide if a loop is even worth building, picks manual vs automatic and open vs closed, distinguishes /goal vs /loop vs routines (/schedule), and wires up a CLOSED loop with a real verification gate (Stop hook running tests, or an LLM-judge + rubric when output isn't testable) plus a turn/budget ceiling so it never spins forever. Triggers on "loop", "döngü", "loop engineering", "auto mode", "run until tests pass", "self-running / autonomous agent", "/goal", "Stop hook", "ralph wiggum".
handoff
Compact the current conversation into a handoff document for another agent to pick up.
claude-handoff
Hand the current conversation off to a fresh background agent that picks up the work immediately.