Get the FREE Ultimate OpenClaw Setup Guide →
a

Code Stats

Scanned

@autogame-17

npx machina-cli add skill @autogame-17/code-stats --openclaw
Files (1)
SKILL.md
511 B

Code Stats

Analyzes the current workspace to provide development metrics.

Usage

node skills/code-stats/index.js [path]

Defaults to current working directory if path is omitted.

Output

JSON object with:

  • files: Total file count.
  • lines: Total line count (approximate).
  • byExt: Breakdown by file extension.

Source

git clone https://clawhub.ai/autogame-17/code-statsView on GitHub

Overview

Code Stats analyzes the current workspace to provide development metrics. It counts files, totals an approximate lines-of-code count, and groups results by file extension to help gauge project size and growth.

How This Skill Works

The tool scans the target path (defaulting to the current working directory), tallies the number of files, and sums lines of code per file. It then outputs a JSON summary with files, lines, and byExt (a breakdown by extension).

When to Use It

  • Run a quick size check of a repository before starting a major feature
  • Assess growth between branches or over time to spot scope changes
  • Identify dominant languages to prioritize tooling or refactoring
  • Onboard new contributors with a snapshot of repo complexity
  • Feed into CI dashboards to monitor repository health and complexity

Quick Start

  1. Step 1: Run the script with an optional path, e.g., node skills/code-stats/index.js [path]
  2. Step 2: If path is omitted, the current working directory is analyzed
  3. Step 3: Review the JSON output (files, lines, byExt) and export results to reports or dashboards

Best Practices

  • Run from the repo root or a targeted subfolder to focus results
  • Use the byExt breakdown to prioritize language-specific optimizations
  • Treat lines as approximate for very large codebases
  • Combine with Git history to track trends in size and complexity
  • Validate the path you provide and ensure proper permissions when automating

Example Use Cases

  • Snapshot a JavaScript/TypeScript monorepo to estimate total files and LOC before a major refactor
  • Identify the dominant language in a Python project to guide tooling choices
  • Provide onboarding with a compact repo size report for new contributors
  • Add to CI dashboards to surface repository complexity alongside builds
  • Compare growth between tags to quantify the impact of a feature set

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers