Langsung ke konten
Skillpedia
Pemrograman umum260k Β· #619

codebase-inspection

Fungsinya

Skill ini membuat AI Anda mengukur proyek perangkat lunak, seperti ukurannya dan campuran bahasa pemrograman yang dipakai. Skill ini ditujukan untuk pengembang dan manajer yang menginginkan gambaran cepat tentang sebuah codebase.

Kapan dipakai

  • βœ“Saat Anda bertanya berapa banyak baris kode yang dimiliki sebuah proyek.
  • βœ“Saat Anda ingin rincian bahasa yang dipakai dalam sebuah repositori.
  • βœ“Saat Anda ingin rasio kode terhadap komentar dalam sebuah proyek.

Link skill

https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/codebase-inspection/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/NousResearch/hermes-agent/blob/main/skills/software-development/codebase-inspection/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBerapa banyak baris kode di repo ini, dan bahasa mana yang paling banyak?”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Skill memasang alat pygount jika belum ada, lalu menjalankannya pada folder proyek. Skill melewati folder seperti node_modules dan keluaran build, sehingga hitungannya tidak membengkak.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

Codebase Inspection with pygount

Analyze repositories for lines of code, language breakdown, file counts, and code-vs-comment ratios using pygount.

When to Use

  • User asks for LOC (lines of code) count
  • User wants a language breakdown of a repo
  • User asks about codebase size or composition
  • User wants code-vs-comment ratios
  • General "how big is this repo" questions

Prerequisites

pip install --break-system-packages pygount 2>/dev/null || pip install pygount

1. Basic Summary (Most Common)

Get a full language breakdown with file counts, code lines, and comment lines:

cd /path/to/repo
pygount --format=summary \
  --folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,.eggs,*.egg-info" \
  .

IMPORTANT: Always use --folders-to-skip to exclude dependency/build directories, otherwise pygount will crawl them and take a very long time or hang.

2. Common Folder Exclusions

Adjust based on the project type:

# Python projects
--folders-to-skip=".git,venv,.venv,__pycache__,.cache,dist,build,.tox,.eggs,.mypy_cache"

# JavaScript/TypeScript projects
--folders-to-skip=".git,node_modules,dist,build,.next,.cache,.turbo,coverage"

# General catch-all
--folders-to-skip=".git,node_modules,venv,.venv,__pycache__,.cache,dist,build,.next,.tox,vendor,third_party"

3. Filter by Specific Language

# Only count Python files
pygount --suffix=py --format=summary .

# Only count Python and YAML
pygount --suffix=py,yaml,yml --format=summary .

4. Detailed File-by-File Output

# Default format shows per-file breakdown
pygount --folders-to-skip=".git,node_modules,venv" .

# Sort by code lines (pipe through sort)
pygount --folders-to-skip=".git,node_modules,venv" . | sort -t$'\t' -k1 -nr | head -20

5. Output Formats

# Summary table (default recommendation)
pygount --format=summary .

# JSON output for programmatic use
pygount --format=json .

# Pipe-friendly: Language, file count, code, docs, empty, string
pygount --format=summary . 2>/dev/null

6. Interpreting Results

The summary table columns:

  • Language β€” detected programming language
  • Files β€” number of files of that language
  • Code β€” lines of actual code (executable/declarative)
  • Comment β€” lines that are comments or documentation
  • % β€” percentage of total

Special pseudo-languages:

  • __empty__ β€” empty files
  • __binary__ β€” binary files (images, compiled, etc.)
  • __generated__ β€” auto-generated files (detected heuristically)
  • __duplicate__ β€” files with identical content
  • __unknown__ β€” unrecognized file types

Pitfalls

  1. Always exclude .git, node_modules, venv β€” without --folders-to-skip, pygount will crawl everything and may take minutes or hang on large dependency trees.
  2. Markdown shows 0 code lines β€” pygount classifies all Markdown content as comments, not code. This is expected behavior.
  3. JSON files show low code counts β€” pygount may count JSON lines conservatively. For accurate JSON line counts, use wc -l directly.
  4. Large monorepos β€” for very large repos, consider using --suffix to target specific languages rather than scanning everything.
Pertanyaan umum

Apakah perlu perangkat lunak khusus?

Skill memerlukan pygount, yang akan dipasang skill dengan pip jika belum ada.

Mengapa beberapa folder dilewati?

Skill menyatakan folder dependensi dan build sebaiknya dilewati, karena memindainya bisa memakan waktu sangat lama.

Bisakah menghitung hanya satu bahasa?

Bisa. Skill memiliki bagian untuk memfilter hasil ke bahasa tertentu.

Detail

Deskripsi asli dari pembuat

Inspect codebases w/ pygount: LOC, languages, ratios.

repo: NousResearch/hermes-agent

Popularitas

Bintang GitHub
260k
Peringkat
#619
Lisensi
MIT
Diperbarui
2/11/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa