Przejdź do treści
Biblioteka skilli
Programowanie · Analiza

agilab-code-statistics

/agilab-code-statistics

Generuje szybkie, powtarzalne statystyki kodu AGILAB: LOC, liczby plików, podział na języki, proporcje testów, dokumentacji i źródeł oraz podsumowania churnu, bez uruchamiania buildów.

Repozytorium
agilab ↗
Licencja
BSD-3-Clause
Ostatnia zmiana repozytorium
20.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 20.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

BSD-3-Clause, otwarta.

Co robi i kiedy

Generuje szybkie, powtarzalne statystyki kodu AGILAB: LOC, liczby plików, podział na języki, proporcje testów, dokumentacji i źródeł oraz podsumowania churnu, bez uruchamiania buildów.

Oryginalny opis (EN)

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.

Jak działa

  1. Defaults
  2. Preferred fast path: tokki loc
  3. Quick Commands
  4. Portable Python Fallback
  5. Churn And Diff Stats
  6. Reporting Format
Sekcje z nagłówków SKILL.md, w oryginale · 149 linii, 590 słów
Podgląd SKILL.md
---
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”.
Pliki w paczce (2)
  • SKILL.md 5 KB
  • agents/openai.yaml 1 KB

Wersje

W bazie nie ma innych skilli o nazwie agilab-code-statistics.

Identyczna treść występuje jeszcze w 1 innych folderach na GitHubie. Tu pokazujemy jedną, najlepiej ocenioną kopię.

Migawka bazy z 13.11.2026 · wersja paczki 90b4f97490e0 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100agilab-deep-audit
    Tworzy głębokie artefakty audytu i code review AGILAB z ustaleniami popartymi dowodami, gotowością fundamentów architektury, śledzeniem blast radius, oceną bezpieczeństwa i testów oraz priorytetyzowanymi rekomendacjami.
  • 95agilab-release-verification
    Weryfikuje gotowość wydania AGILAB i stan po publikacji w PyPI, GitHub Releases, dowodzie wydania, dokumentacji, odznakach pokrycia i synchronizacji Hugging Face Space.
  • 100codebase-inspection
    Analizuje bazy kodu za pomocą pygount: liczy linie kodu, pokazuje podział na języki i stosunek kodu do komentarzy oraz rozmiar repozytorium.
  • 100loc-orchestrate
    Wykonuje plan z katalogu inbox milestone po milestonie, z dowodem i przeglądem kodu po każdym etapie oraz końcowym.
  • 100cloc
    Liczy linie kodu, mieszankę języków i statystyki różnic w repozytoriach .NET za pomocą otwartego narzędzia cloc, do powtarzalnych raportów o rozmiarze bazy kodu.
  • 100code-stats
    Analizuje pliki kodu i podaje statystyki: liczbę linii, liczbę plików według rozszerzeń i łączny rozmiar, dla szybkiego audytu rozmiaru i struktury projektu.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.