tech-leads-club/agent-skills/component-identification-sizing
Claude Code and agent skill by tech-leads-club/agent-skills
- community
Checking that the SKILL.md file is still in the repository.
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.
Install
npx vskill@latest install tech-leads-club/agent-skills/component-identification-sizingSKILL.md
The same SKILL.md was published earlier as tech-leads-club/agent-skills/component-identification-sizing.
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
Example 2: Find Oversized Components
Example 3: Component Size Analysis
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)
- 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
- Calculate percentage
`` component_percent = (component_statements / total_statements) * 100 ``
- Calculate statistics
- Mean component size:
total_statements / number_of_components - Standard deviation:
sqrt(sum((size - mean)^2) / (n - 1)) - Component's deviation:
(component_size - mean) / std_dev
Phase 3: Identify Size Issues
Oversized Components (candidates for splitting):
- Exceeds 30% of total codebase (for small apps with <10 components)
- Exceeds 10% of total codebase (for large apps with >20 components)
- More than 2 standard deviations above mean
- Contains multiple distinct functional areas
Undersized Components (candidates for consolidation):
- Less than 1% of codebase (may be too granular)
- Less than 1 standard deviation below mean
- Contains only a few files with minimal functionality
Well-Sized Components:
- Between 1-2 standard deviations from mean
- Represents a single, cohesive functional area
- Appropriate percentage for application size
Output Format
Component Inventory Table
Status Legend:
- ✅ OK: Well-sized (within 1-2 std dev from mean)
- ⚠️ Too Large: Exceeds size threshold or >2 std dev above mean
- 🔍 Too Small: <1% of codebase or <1 std dev below mean
Size Analysis Summary
Component Size Distribution
Component Size Distribution (by percent of codebase)
[Visual representation or histogram if possible]
Largest: ████████████████████████████████████ 33% (Reporting) ████████ 9% (Ticket Assign) ██████ 8% (Ticket) ██████ 6% (Expert Profile) █████ 5% (Billing Payment) ████ 4% (Billing History) ...
Recommendations
High Priority: Split Large Components
Reporting Component (33% of codebase):
- Current: Single component with 27,765 statements
- Issue: Too large, contains multiple functional areas
- Recommendation: Split into:
- Reporting Shared (common utilities)
- Ticket Reports (ticket-related reports)
- Expert Reports (expert-related reports)
- Financial Reports (financial reports)
- Expected Result: Each component ~7-9% of codebase
Medium Priority: Review Small Components
Login Component (2% of codebase):
- Current: 1,865 statements, 3 files
- Consideration: May be too granular if related to broader authentication
- Recommendation: Evaluate if should be consolidated with Authentication/User components
Low Priority: Monitor Well-Sized Components
Most components are appropriately sized. Continue monitoring during decomposition.
services/ ├── BillingService/ ← Component (leaf node) │ ├── index.js │ └── BillingService.js ├── CustomerService/ ← Component (leaf node) │ └── CustomerService.js └── NotificationService/ ← Component (leaf node) └── NotificationService.js
com.company.billing.payment ← Component (leaf package) com.company.billing.history ← Component (leaf package) com.company.billing ← Subdomain (parent of payment/history)
// Alert if any component exceeds 10% of codebase function checkComponentSize(components, threshold = 0.1) { const totalStatements = components.reduce((sum, c) => sum + c.statements, 0) return components .filter((c) => c.statements / totalStatements > threshold) .map((c) => ({ component: c.name, percent: ((c.statements / totalStatements) * 100).toFixed(1), issue: 'Exceeds size threshold', })) }
// Alert if component is >2 standard deviations from mean function checkStandardDeviation(components) { const sizes = components.map((c) => c.statements) const mean = sizes.reduce((a, b) => a + b, 0) / sizes.length const stdDev = Math.sqrt(sizes.reduce((sum, size) => sum + Math.pow(size - mean, 2), 0) / (sizes.length - 1))
return components .filter((c) => Math.abs(c.statements - mean) > 2 * stdDev) .map((c) => ({ component: c.name, deviation: ((c.statements - mean) / stdDev).toFixed(2), issue: 'More than 2 standard deviations from mean', })) }
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/skills-catalog/skills/(architecture)/component-identification-sizing/SKILL.md
Popularity
- Repository stars
- 4,626
- Repository forks
- 415
- 7-day trend score
- 42
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tech-leads-club/agent-skills/component-identification-sizing)