Code Stats for Openclaw

Provides comprehensive insights into repository size, complexity, and language distribution.

douduandou
v1.0.0
Mar 4, 2026
0
1.6k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install openclaw-code-stats

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install openclaw-code-stats using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Code Stats?

The Code Stats skill is a powerful diagnostic tool designed for the Openclaw Skills ecosystem to provide developers with deep, data-driven insights into their codebase. It automates the process of scanning workspaces to calculate total file counts, lines of code (LOC), and the specific breakdown of programming languages used within a project. By providing a clear snapshot of project volume and complexity, it helps developers and project managers make informed decisions about refactoring, resource allocation, and technical debt management.

This skill is particularly useful for gaining a bird's-eye view of large-scale repositories where manual auditing is impractical. It supports a wide array of modern programming languages and configuration formats, ensuring that your Openclaw Skills workspace analysis is both accurate and comprehensive.

Code Stats Use Cases

  • Assessing the scale and complexity of a new or existing repository.
  • Evaluating the ratio of different programming languages used across the workspace.
  • Tracking code volume growth and changes over time for project management.
  • Providing quick technical overviews for stakeholders or team onboarding.

How Code Stats Works

  1. The skill scans the current workspace or designated directory for supported file types.
  2. It parses individual files to count lines of code and identifies the programming language based on file extensions.
  3. Data is aggregated into total counts and percentage distributions.
  4. A formatted report is generated, displaying file counts, total lines, and a per-language breakdown.

Code Stats Setup

To use the Code Stats skill within the Openclaw Skills environment, you can execute the following command in your terminal:

node skills/code-stats/index.js

Ensure that the skill is correctly indexed in your local workspace and that you have Node.js installed to run the analysis script.

Code Stats Data Schema & Taxonomy

The skill processes filesystem metadata and file contents to produce a structured output. The internal data structure includes:

Attribute Description
Total Files The count of all identified code and configuration files.
Total Lines The cumulative sum of lines across all analyzed files.
Language Distribution A map of language names to file counts and line counts.
Percentages The relative share of each language compared to the total LOC.

Code Stats Advanced Features

  • Automated workspace scanning for diverse language ecosystems including Python, JavaScript, and TypeScript.
  • Support for documentation and configuration formats like Markdown, JSON, and YAML.
  • Real-time percentage calculation for precise language ratio analysis.
  • CLI-ready output format for easy integration into automated reports or developer summaries.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*