Skip to content
Skills Library
Programming · Analysis

agilab-code-statistics

/agilab-code-statistics

Generate fast, reproducible AGILAB code statistics. Use when the user asks for code stats, LOC, file counts, language breakdowns, test/docs/source ratios, churn summaries, or a concise repository size/code footprint report without running builds.

Repository
agilab ↗
Licence
BSD-3-Clause
Last repository change
20.10.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
2
Scripts
0
HTML comments
0
URLs in SKILL.md
0
Deprecation

No signals detected. Repository changed on 20.10.2026, without references to retired models or APIs.

Licence

BSD-3-Clause, otwarta.

What it does and when to use it

Generate fast, reproducible AGILAB code statistics. Use when the user asks for code stats, LOC, file counts, language breakdowns, test/docs/source ratios, churn summaries, or a concise repository size/code footprint report without running builds.

Original author description

Generate fast, reproducible AGILAB code statistics. Use when the user asks for code stats, LOC, file counts, language breakdowns, test/docs/source ratios, churn summaries, or a concise repository size/code footprint report without running builds.

How it works

  1. Defaults
  2. Preferred fast path: tokki loc
  3. Quick Commands
  4. Portable Python Fallback
  5. Churn And Diff Stats
  6. Reporting Format
Original SKILL.md headings · 149 lines, 590 words
SKILL.md preview
---
name: agilab-code-statistics
description: Generate fast, reproducible AGILAB code statistics. Use when the user asks for code stats, LOC, file counts, language breakdowns, test/docs/source ratios, churn summaries, or a concise repository size/code footprint report without running builds.
license: BSD-3-Clause (see repo LICENSE)
metadata:
  updated: 2026-06-11
---

# AGILAB Code Statistics

Use this skill to answer code-statistics questions quickly and reproducibly.
Default to tracked files only, so ignored caches, virtualenvs, local datasets,
generated docs output, and untracked scratch files do not distort the numbers.

## Defaults

- Start with `git status --short --branch` and say whether the tree is dirty.
- Use `git ls-files` for file lists unless the user explicitly asks for
  untracked/local files too.
- Report the counting boundary: tracked files, selected extensions, and any
  excluded generated/vendor paths.
- Prefer fast local commands. Do not run tests, installers, docs builds, or
  package builds for statistics.
- If a tool is missing (`tokei`, `cloc`), fall back to the Python snippet below
  instead of installing dependencies.

## Preferred fast path: tokki loc

When the installed `tokki` CLI is available (0.3.10+), use it first — it counts
tracked files only and prints a markdown table with a TOTAL row and KLOC summary:

```bash
tokki loc ~/PycharmProjects/agilab ~/PycharmProjects/thales_agilab
# or with no arguments, reads repo paths from .tokki/loc in the current dir
```

Columns: python files, raw lines, effective (non-blank, non-comment) lines,
sh+toml, docs (md+rst). Fall back to the commands below for language
breakdowns beyond those buckets or when tokki is unavailable.

## Quick Commands

Tracked file count and extension breakdown:

```bash
git ls-files | awk '
  {
    n=$0
    sub(/^.*\//, "", n)
    ext=n
    if (ext !~ /\./) ext="[no extension]"
    else { sub(/^.*\./, ".", ext) }
    count[ext] += 1
  }
  END { for (ext in count) print count[ext], ext }
' | sort -nr
```

Tracked LOC by common AGILAB source/doc/config extensions:

```bash
git ls-files \
  | rg '\.(py|toml|md|rst|yml|yaml|sh|json|css|html|svg)$' \
  | xargs wc -l
```

If available, use one of these for language-aware stats:

```bash
git ls-files -z | xargs -0 tokei
cloc --vcs=git
```

Use `tools/repo_footprint.py audit` for storage footprint, not LOC:

```bash
uv --preview-features extra-build-dependencies run python tools/repo_footprint.py audit
```

## Portable Python Fallback

Use this when shell tooling is missing or when you need grouped AGILAB counts:

```bash
python3 - <<'PY'
from collections import Counter, defaultdict
from pathlib import Path
import subprocess

paths = subprocess.check_output(["git", "ls-files"], text=True).splitlines()
skip_prefixes = ("docs/html/",)
code_exts = {".py", ".pyi", ".sh"}
doc_exts = {".md", ".rst"}
config_exts = {".toml", ".yaml", ".yml", ".json"}

files = [Path(p) for p in paths if not p.startswith(skip_prefixes)]
by_ext = Counter(p.suffix or "[no extension]" for p in files)
groups = defaultdict(lambda: {"files": 0, "lines": 0})

for path in files:
    ext = path.suffix
    if ext in code_exts:
        group = "code"
    elif ext in doc_exts:
        group = "docs"
    elif ext in config_exts:
        group = "config"
    elif "/test/" in f"/{path.as_posix()}" or path.name.startswith("test_"):
        group = "tests"
    else:
        group = "other"
    groups[group]["files"] += 1
    try:
        groups[group]["lines"] += len(path.read_text(encoding="utf-8", errors="ignore").splitlines())
    except OSError:
        pass

print("Tracked files:", len(files))
print("\nBy group:")
for name, data in sorted(groups.items()):
    print(f"{name:>8}: {data['files']:5d} files {data['lines']:8d} lines")
print("\nTop extensions:")
for ext, count in by_ext.most_common(20):
    print(f"{ext:>12}: {count}")
PY
```

## Churn And Diff Stats

For current changes:

```bash
git diff --stat
git diff --shortstat
git diff --cached --stat
git diff --cached --shortstat
```

For recent history:

```bash
git log --since='30 days ago' --numstat --pretty='%H' -- . \
  | awk 'NF==3 { add+=$1; del+=$2; files[$3]=1 } END { print "added", add, "deleted", del, "files", length(files) }'
```

## Reporting Format

Keep the answer compact:

- `Scope`: tracked files only, plus exclusions.
- `Headline`: total files and total counted lines.
- `Breakdown`: code/docs/config/tests/other or language table.
- `Caveats`: generated files, binary assets, LFS data, dirty tree, or missing tools.
- `Next`: one suggested follow-up only, for example “run cloc/tokei if installed”
  or “separate generated docs from source docs”.
Files in this package (2)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB

Versions

The database has no other skills named agilab-code-statistics.

Identical content appears in 1 other GitHub folders. We show one copy with the highest score.

Database snapshot: 13.11.2026 · package version 90b4f97490e0 (SHA-256 digest of the entire package)

Downloads in the last 30 days: 0 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100agilab-deep-audit
    Produce deep AGILAB audit and code-review artifacts with evidence-backed findings, mandatory architecture-foundation readiness, blast-radius tracing, security/test posture, and prioritized recommendations. Use when the user says "review AGILAB", "audit AGILAB", "code review…
  • 95agilab-release-verification
    Verify AGILAB release readiness and post-release truth across PyPI, GitHub Releases, release proof, docs, coverage badges, and Hugging Face Space sync. Use when the user asks "ready for release?", "release it", "all good?", "HF aligned?", "why badge failed?", or any…
  • 100codebase-inspection
    Inspect and analyze codebases using pygount for LOC counting, language breakdown, and code-vs-comment ratios. Use when asked to check lines of code, repo size, language composition, or codebase stats.
  • 100loc-orchestrate
    Use when the user asks to execute a plan from loc/inbox/ (e.g. "loc-orchestrate 018", "execute plan 018"), or to resume one that has a state file in loc/state/. Builds it milestone by milestone with a proof and a code-review per milestone, then a final review.
  • 100cloc
    Use the open-source free `cloc` tool for line-count, language-mix, and diff statistics in .NET repositories. USE FOR: repeatable LOC reports; language-mix or branch-diff statistics; codebase size and solution-composition measurements. DO NOT USE FOR: judging developer…
  • 100code-stats
    Analyzes code files and reports statistics including line counts, file counts by extension, and total size. Use this skill whenever the user wants to understand the composition of a codebase - asking about "how many lines of code", "what file types exist", "code distribution",…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.