一键导入
migrate-architecture
Use when transforming a project's architecture pattern - e.g., Flat to Modular, MVC to Clean Architecture, Monolith to Modular Monolith.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use when transforming a project's architecture pattern - e.g., Flat to Modular, MVC to Clean Architecture, Monolith to Modular Monolith.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when you need a comprehensive code audit covering security, performance, architecture, and dependencies before a release, major refactor, or compliance review.
Use when you want to iteratively build a feature using a PRD as source of truth, with progress tracking and fresh-context iterations - the Autopilot technique for autonomous development.
Use when starting a complex feature, exploring unclear requirements, or needing to challenge assumptions before committing to a design - before /plan.
Use when you need a comprehensive code review combining architecture, security, and test perspectives - especially before merging, releasing, or after major changes.
Use when creating marketing copy for landing pages, email campaigns, product descriptions, or social media - with A/B variants and conversion-focused frameworks.
Use when optimizing landing pages, signup flows, checkout processes, or any user-facing page for higher conversion rates - before A/B testing.
| name | migrate-architecture |
| description | Use when transforming a project's architecture pattern - e.g., Flat to Modular, MVC to Clean Architecture, Monolith to Modular Monolith. |
| user-invocable | true |
| argument-hint | [current-architecture] to [target-architecture] [variant: full|lite] [scope: file|module|project] |
| allowed-tools | Read, Write, Edit, Bash, Glob, Grep |
Migrate a project's architecture from one pattern to another while preserving all functionality.
Arguments: $ARGUMENTS (e.g., "flat to modular full project", "mvc to clean lite src/modules/auth")
| Pattern | Description |
|---|---|
| Flat / Component-Driven | Single components/ dir, minimal structure |
| Modular (Feature-Based) | Vertical slicing by feature with services/adapters/types |
| Feature-Sliced Design (FSD) | Strict layered: app > pages > features > entities > shared |
| Atomic Design | Components by granularity: atoms > molecules > organisms |
| Clean Architecture | Domain > Use Cases > Adapters > Frameworks |
| Hexagonal (Ports & Adapters) | Core with ports, infrastructure in adapters |
| Pattern | Description |
|---|---|
| MVC / Layered | Horizontal: controllers, services, repositories |
| Modular Monolith | Single deployment, strict module boundaries |
| Clean Architecture | Concentric layers, dependency rule inward |
| Hexagonal | Ports & Adapters, domain isolated |
| DDD | Bounded contexts, aggregates, domain events |
| CQRS | Separate command/query paths |
| Event-Driven | Async communication via events |
| Microservices | Independent services, own databases |
| Variant | Description |
|---|---|
| Full | Complete implementation with all layers and patterns |
| Lite (Simplified) | Fewer layers, same principles. For smaller teams |
docs/ARCHITECTURE.md if it existssrc/ (or root if no src/)── Architecture Assessment ──
Current: [detected pattern] (confidence: high/medium/low)
Target: [requested pattern] ([variant])
Scope: [project | specific module/path]
Estimated files to move: X
Estimated files to create: X
Risk: low/medium/high
Execute the migration plan step by step:
docs/ARCHITECTURE.md for the target patternnpx tsc --noEmit 2>&1 | head -50
npm test 2>&1 | tail -20
── Architecture Migration Complete ──
From: [source pattern]
To: [target pattern] ([variant])
Files moved: X
Files created: X
Imports updated: X
Barrel exports created: X
Validation:
TypeScript: ✓ compiles
Import rules: ✓ no violations
Tests: ✓ passing (or N/A)
docs/ARCHITECTURE.md: ✓ generated
modules/[feature]/components/ for each groupshared/components/| Mistake | Correct Approach |
|---|---|
| Moving files without updating imports | Use TypeScript compiler to verify after each move |
| Creating empty architectural layers | Only create layers with actual content |
| Migrating everything at once | One module at a time, least coupled first |
| Skipping barrel exports | Always create index.ts - it enforces boundaries |
| Copying patterns blindly | Adapt to the project's actual needs (Full vs Lite) |
| Ignoring existing tests | Move tests alongside their source files |