component-identification-sizing
できること
このスキルは、コードベースの構成要素を一覧にし、それぞれの大きさを測るようAIに求めます。大きなアプリを分割する計画があり、どこから始めるかを知る必要があるチーム向けです。
使う場面
- ✓コードベースの各モジュールやサービスがどれくらい大きいかを知りたいとき。
- ✓アプリケーションの一部が大きすぎて、分割が必要だと疑うとき。
- ✓大きなアプリの分割を計画していて、まず在庫の一覧が必要なとき。
スキルのリンク
https://github.com/tech-leads-club/agent-skills/blob/main/packages/skills-catalog/skills/(architecture)/component-identification-sizing/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私たちのコードベースのコンポーネント、それぞれの大きさ、そしてそのまま残すには大きすぎそうなものを見せてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
AIは、フォルダと名前空間を対応づけ、コンポーネントごとに文やファイルを数え、他と比べて異常に大きいサイズを示します。
技術的な内容(元の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
- Initial Analysis: Start with complete component inventory
- Identify Issues: Find components that need attention
- Get Recommendations: Request actionable split/consolidation suggestions
- 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:
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)
- For Node.js:
Identify leaf nodes
- Components are the deepest directories containing source files
- Example:
services/BillingService/is a component - Example:
services/BillingService/payment/extends it, makingBillingServicea subdomain
Create component inventory
- List each component with its namespace/path
- Note any parent namespaces (subdomains)
Phase 2: Calculate Size Metrics
For each component:
Count statements
- Parse source files in component directory
- Count executable statements (not comments, blank lines, or declarations alone)
- Sum across all files in component
Count files
- Total source files (
.js,.ts,.java,.py, etc.) - Exclude test files, config files, documentation
- Total source files (
Calculate percentage
component_percent = (component_statements / total_statements) * 100Calculate statistics
- Mean component size:
total_statements / number_of_components - Standard deviation:
sqrt(sum((size - mean)^2) / (n - 1)) - Component's d
- Mean component size:
よくある質問
アプリの実行速度も測りますか?
いいえ。測るのはコードの大きさであり、実行時の性能やサーバーの容量は測りません。
どうやって大きすぎると判断しますか?
各コンポーネントを平均と比べ、外れ値を示します。
どこで分割すべきか提案できますか?
はい。おおよその大きさとともに、具体的な分割を提案します。
詳細
作者による元の説明
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.
人気
- GitHubのスター
- 7.1k
- ランキング
- #13501
- ライセンス
- —
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
component-common-domain-detection
7.1kエージェントが、コードベースのいくつかの部分に繰り返し現れるビジネスロジックを見つけ、それらをどう統合できるかを提案できるよう支援します。
component-flattening-analysis
7.1kエージェントが、迷った位置にあるコードを見つけ、乱雑なコンポーネントのフォルダ構造を平らにし、各部分が正しい場所に収まるよう支援します。
coupling-analysis
7.1kエージェントが、システムの部分同士がどれほど強く依存し合っているかを確認し、最初にどの結びつきを緩めるべきかを教えられるよう支援します。
decomposition-planning-roadmap
7.1kエージェントが、大きなアプリを独立したサービスに分割する手順の順番を、優先度とフェーズとともに計画できるよう支援します。
似ているスキル
diffs
394k編集内容の実際の共有可能な差分を、手書きの要約ではなく、ビューアーのリンクや画像ファイルとして作成するようエージェントを支援します。
coding-agent
394kCodex、Claude Code、OpenCodeに大きめのコーディング作業をバックグラウンドのワーカーとして渡し、その進捗を確認するようエージェントを支援します。
gh-issues
394kGitHubのイシューを探し、取り組むものを選び、修正を含むプルリクエストを開くようエージェントを支援します。レビューコメントへの対応も含みます。