Перейти к содержанию
Skillpedia
Код в целом7.1k · #13501

component-identification-sizing

Что он делает

Этот скилл заставляет ИИ перечислить структурные блоки кодовой базы и измерить размер каждого. Он нужен командам, которые планируют разбить большое приложение и должны понять, с чего начать.

Когда использовать

  • ✓Когда вы хотите знать, насколько велик каждый модуль или сервис в вашей кодовой базе.
  • ✓Когда вы подозреваете, что одна часть приложения слишком большая и её нужно разделить.
  • ✓Когда вы планируете разбиение большого приложения и сначала нужна опись.

Ссылка на скилл

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

Скопируйте и вставьте её в ваш ИИ (Claude, ChatGPT или Cursor) с просьбой следовать инструкциям.

Как использовать

Самый простой способ: скопируйте сообщение и вставьте его в свой ИИ. Он прочитает скилл и выполнит инструкции.

Готовое сообщение для вставки

Используй этот скилл, чтобы помочь мне: https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/component-identification-sizing/SKILL.md Прочитай файл SKILL.md по этой ссылке и следуй его инструкциям в моей задаче.
Хотите, чтобы ваш ИИ сам находил такие скиллы?Установите бесплатный MCP Skillpedia: одна строка, и перед каждой задачей он ищет среди 15 000+ скиллов.Установить за 1 минуту →

Пример запроса к вашему ИИ

“Покажи компоненты нашей кодовой базы, их размеры и тот, который кажется слишком большим, чтобы оставить как есть.”

5 новых скиллов в неделю. 1 минута чтения.

Как это работает

ИИ сопоставляет папки и пространства имён, считает инструкции и файлы в каждом компоненте и отмечает размеры, которые сильно выше остальных.

Технический текст (оригинальный SKILL.md)

Оригинальный текст автора на английском, прямо с GitHub.

Component Identification and Sizing

This skill identifies architectural components (logical building blocks) in a codebase and calculates size metrics to assess decomposition feasibility and identify oversized components.

How to Use

Quick Start

Request analysis of your codebase:

  • "Identify and size all components in this codebase"
  • "Find oversized components that need splitting"
  • "Create a component inventory for decomposition planning"
  • "Analyze component size distribution"

Usage Examples

Example 1: Complete Analysis

User: "Identify and size all components in this codebase"

The skill will:
1. Map directory/namespace structures
2. Identify all components (leaf nodes)
3. Calculate size metrics (statements, files, percentages)
4. Generate component inventory table
5. Flag oversized/undersized components
6. Provide recommendations

Example 2: Find Oversized Components

User: "Which components are too large?"

The skill will:
1. Calculate mean and standard deviation
2. Identify components >2 std dev or >10% threshold
3. Analyze functional areas within large components
4. Suggest specific splits with estimated sizes

Example 3: Component Size Analysis

User: "Analyze component sizes and distribution"

The skill will:
1. Calculate all size metrics
2. Generate size distribution summary
3. Identify outliers
4. Provide statistics and recommendations

Step-by-Step Process

  1. Initial Analysis: Start with complete component inventory
  2. Identify Issues: Find components that need attention
  3. Get Recommendations: Request actionable split/consolidation suggestions
  4. Monitor Progress: Track component growth over time

When to Use

Apply this skill when:

  • Starting a monolithic decomposition effort
  • Assessing codebase structure and organization
  • Identifying components that are too large or too small
  • Creating component inventory for migration planning
  • Analyzing code distribution across components
  • Preparing for component-based decomposition patterns

Core Concepts

Component Definition

A component is an architectural building block that:

  • Has a well-defined role and responsibility
  • Is identified by a namespace, package structure, or directory path
  • Contains source code files (classes, functions, modules) grouped together
  • Performs specific business or infrastructure functionality

Key Rule: Components are identified by leaf nodes in directory/namespace structures. If a namespace is extended (e.g., services/billing extended to services/billing/payment), the parent becomes a subdomain, not a component.

Size Metrics

Statements (not lines of code):

  • Count executable statements terminated by semicolons or newlines
  • More accurate than lines of code for size comparison
  • Accounts for code complexity, not formatting

Component Size Indicators:

  • Percent of codebase: Component statements / Total statements
  • File count: Number of source files in component
  • Standard deviation: Distance from mean component size

Analysis Process

Phase 1: Identify Components

Scan the codebase directory structure:

  1. Map directory/namespace structure

    • For Node.js: services/, routes/, models/, utils/
    • For Java: Package structure (e.g., com.company.domain.service)
    • For Python: Module paths (e.g., app/billing/payment)
  2. Identify leaf nodes

    • Components are the deepest directories containing source files
    • Example: services/BillingService/ is a component
    • Example: services/BillingService/payment/ extends it, making BillingService a subdomain
  3. Create component inventory

    • List each component with its namespace/path
    • Note any parent namespaces (subdomains)

Phase 2: Calculate Size Metrics

For each component:

  1. Count statements

    • Parse source files in component directory
    • Count executable statements (not comments, blank lines, or declarations alone)
    • Sum across all files in component
  2. Count files

    • Total source files (.js, .ts, .java, .py, etc.)
    • Exclude test files, config files, documentation
  3. Calculate percentage

    component_percent = (component_statements / total_statements) * 100
    
  4. Calculate statistics

    • Mean component size: total_statements / number_of_components
    • Standard deviation: sqrt(sum((size - mean)^2) / (n - 1))
    • Component's d
Частые вопросы

Измеряет ли он скорость работы приложения?

Нет. Он измеряет размер кода, а не производительность во время работы или мощность сервера.

Как он решает, что что-то слишком большое?

Он сравнивает каждый компонент со средним и отмечает выбросы.

Может ли он подсказать, где разделить?

Да. Он предлагает конкретные разбиения с примерными размерами.

Подробности

Оригинальное описание автора

Maps architectural components in a codebase and measures their size to identify what should be extracted first. Use when asking "how big is each module?", "what components do I have?", "which service is too large?", "analyze codebase structure", "size my monolith", or planning where to start decomposing. Do NOT use for runtime performance sizing or infrastructure capacity planning.

repo: tech-leads-club/agent-skills

Популярность

Звёзды на GitHub
7.1k
Место в рейтинге
#13501
Лицензия
—
Обновлён
02.11.2026

Полезен ли этот скилл?

0

Войдите , чтобы голосовать.

Комментарии

  • …

Другие скиллы из этого репозитория

Похожие скиллы