Chuyển đến nội dung
Skillpedia
Lập trình chung7.1k · #13509

modular-decomposition

Skill này làm gì

Skill này chạy một chuỗi kiểm tra cố định trên một codebase lớn: kiểm kê, logic trùng lặp, vấn đề thư mục, ghép nối và nhóm lĩnh vực. Phù hợp với các nhóm chuẩn bị tách một ứng dụng lớn và muốn có bằng chứng trước.

Khi nào nên dùng

  • ✓Khi bạn muốn biết cách tách một ứng dụng lớn thành các phần nhỏ hơn.
  • ✓Khi bạn cần đo kích thước và liệt kê các phần của hệ thống trước khi tách bất kỳ phần nào.
  • ✓Khi bạn muốn một phân tích kết hợp về trùng lặp, ghép nối và nhóm nghiệp vụ.

Liên kết skill

https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/modular-decomposition/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/modular-decomposition/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Chạy phân tích đầy đủ monolith của chúng tôi để biết phần nào nên tách và chúng nhóm với nhau thế nào.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

AI chạy năm bước phân tích theo thứ tự, nạp hướng dẫn cho từng bước, và kết hợp kết quả thành một cái nhìn về các nhóm ứng viên.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

Modular Decomposition

This skill runs the Patterns 1–5 analysis pipeline before service extraction. Each pattern is plain markdown under references/; load the file for that step and execute it against the user’s codebase.

How to Use

Quick start (what users can say)

  • Full pipeline: “Run modular decomposition Patterns 1 through 5 on this repo,” “Analyze this monolith for splitting—inventory, coupling, and domain grouping.”
  • Single early step: “Identify and size components here,” “Find duplicated domain logic across modules,” “Analyze coupling between our packages.”
  • With DDD lens: “Group components into domains and check bounded contexts,” “Use DDD strategic design on this codebase before we group services.”

If the user only wants extraction order, phases, or migration roadmap after analysis exists, use decomposition-planning-roadmap instead. If they need a full legacy migration plan (strangler fig, research, multi-stack), use legacy-migration-planner as well or instead of this skill when that is the primary ask.

How the agent should run it

  1. Scope: Confirm the task is structural analysis (inventory → coupling → grouping), not roadmap authoring. If unclear, ask once whether they want the full ordered pipeline or a subset.
  2. Order: Run patterns 1 → 2 → 3 → 4 → 5 in that order. Do not skip a step unless the user explicitly limits scope; if they do, state which patterns were skipped and how that limits later conclusions.
  3. Load references: For each pattern, open the matching references/pattern-NN-*.md file and follow its instructions. Use the optional *-quick-reference.md for the same number when a short checklist is enough.
  4. Carry context forward: Reuse outputs from earlier patterns in later ones (e.g. component inventory from Pattern 1 informs coupling in 4 and grouping in 5). Reference concrete paths, modules, or tables from previous steps.
  5. Domain language (Pattern 5): If subdomains or bounded contexts need grounding beyond structure, read references/domain-analysis.md before or alongside Pattern 5. Optionally open references/domain-analysis-quick-reference.md or references/domain-analysis-examples.md for condensed rules or illustrations.
  6. Deliver: Produce clear, actionable findings per pattern or one consolidated report—always tied to evidence from the repository (files, dependencies, metrics), not generic advice.

Usage examples

Example 1 — Full pipeline

User: "We're going to split this monolith—run the full decomposition analysis (Patterns 1–5)."

Agent: Execute patterns 1→5 in order, loading each references/pattern-NN-*.md, preserving outputs between steps, then summarize cross-cutting recommendations.

Example 2 — Coupling after inventory

User: "We already have a rough module list—focus on coupling (Pattern 4) and then domain grouping (Pattern 5)."

Agent: If no prior inventory exists in the thread, either run Pattern 1 briefly or derive an explicit module list from the repo before 4 and 5. State any assumptions.

Example 3 — DDD before grouping

User: "Map bounded contexts and language, then group components into domains."

Agent: Read references/domain-analysis.md (and optional quick reference/examples) in parallel with or immediately before Pattern 5; align Pattern 5 groupings with linguistic boundaries where evidence supports it.

Prerequisites

  • Complete Pattern N before starting Pattern N+1 unless the user explicitly narrows scope. Later patterns depend on earlier results (for example, inventory and structure inform coupling and grouping).
  • If business vocabulary, subdomains, or bounded contexts are uncertain, use references/domain-analysis.md before or alongside Pattern 5 (see Bounded contexts below).

Ordered workflow (Patterns 1–5)

Step Pattern Primary reference
1 Identify and size components references/pattern-01-identify-and-size.md (optional: pattern-01-identify-and-size-quick-reference.md)
2 Common domain detection references/pattern-02-common-domain.md (optional: pattern-02-common-domain-quick-reference.md)
Câu hỏi thường gặp

Nó có tạo lộ trình di chuyển không?

Không. Thứ tự tách và các giai đoạn do skill lộ trình riêng đảm nhận.

Tôi có thể chỉ chạy một bước không?

Có. Bạn có thể yêu cầu một phân tích riêng lẻ, như đo kích thước component hoặc kiểm tra ghép nối.

Nó có bao gồm phân tích lĩnh vực không?

Nó có thể thêm góc nhìn lĩnh vực nghiệp vụ khi bạn yêu cầu.

Chi tiết

Mô tả gốc của tác giả

Runs a sequenced monolith-to-modular pipeline that sizes and inventories components, finds shared domain duplication, addresses flattening and hierarchy issues, analyzes coupling, then groups components into candidate domain-aligned units, with optional embedded DDD strategic analysis for bounded contexts. Use when asking how to split a monolith, size components before extraction, find duplicated domain logic, clean up module hierarchy, measure coupling between modules, or group components into services. Do NOT use for phased extraction roadmaps or prioritization without the prior analysis ste

repo: tech-leads-club/agent-skills

Độ phổ biến

Sao GitHub
7.1k
Vị trí xếp hạng
#13509
Giấy phép
—
Cập nhật
2/11/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự