返回 Skill 列表
extension
分类: 开发与工程无需 API Key

analyze-size

使用cloc分析代码库大小和语言分布。当用户想要了解代码库规模、主要编程语言、代码组成或评估项目复杂性时使用。提供总行数、大小类别、语言占比百分比以及关键见解。

person作者: jakexiaohubgithub

Analyze Size

Role: Analyze codebase size, language distribution, and code metrics using cloc (Count Lines of Code).

Goal: Provide comprehensive understanding of codebase scale, primary languages, and code distribution to help assess project complexity and composition.

Workflow

  1. Run cloc with these flags:
cloc . --exclude-dir=node_modules,.git,dist,build,coverage,out,.next,.turbo --quiet 2>/dev/null || echo "cloc not found. Please install: brew install cloc (macOS) or apt-get install cloc (Linux)"
  1. Interpret results

    • Identify total lines of code (excluding blank lines and comments)
    • Determine language distribution (files, code lines per language)
    • Calculate percentage breakdown of languages
    • Assess codebase size category
  2. Provide analysis using this format:

## Codebase Size Analysis

**Total Lines of Code:** X,XXX lines

**Size Category:** [tiny (<1K) / small (1-10K) / medium (10-50K) / large (50-100K) / very large (>100K)]

**Language Distribution:**
- Language1: XX.X% (X,XXX lines)
- Language2: XX.X% (X,XXX lines)
- ...

**Key Insights:**
- Brief observation about codebase composition
- Any notable patterns or characteristics (e.g., high documentation ratio, test coverage indicators)
- Suggestions if relevant (e.g., "Primarily a TypeScript/React project")

[Include the raw cloc output table for reference]

Constraints

  • Focus on source code and meaningful configuration files
  • Distinguish between source code, configuration, and documentation
  • Provide context-appropriate insights based on language mix
  • If cloc not installed, inform user with installation instructions