Line Count
Count lines of Python code in the project using cloc. Three predefined scopes are available.
Scopes
| Scope |
Argument |
Directories |
Command |
| Source only |
src |
happysimulator/ |
cloc happysimulator/ --exclude-dir=__pycache__,.egg-info |
| Source + Tests |
src+tests |
happysimulator/, tests/ |
cloc happysimulator/ tests/ --exclude-dir=__pycache__,.egg-info |
| All |
all |
happysimulator/, tests/, examples/ |
cloc happysimulator/ tests/ examples/ --exclude-dir=__pycache__,.egg-info |
Instructions
- If the user provides a scope argument (
src, src+tests, or all), run that scope directly
- If no argument is provided, ask the user which scope they want using these three options
- Run the appropriate
cloc command from the project root
- Present the results in a summary table showing files, blank lines, comments, and code lines
- If multiple directories are included, also run each directory individually so the user can see a per-directory breakdown
- At the end, display a concise summary like:
Library (happysimulator/): X,XXX lines
Tests (tests/): X,XXX lines
Examples (examples/): X,XXX lines
──────────────────────────────────────
Total: X,XXX lines
Notes
- Requires
cloc to be installed and available on PATH
- If
cloc is not found, inform the user to install it (choco install cloc, scoop install cloc, or pip install cloc)
Converted and distributed by TomeVault — claim your Tome and manage your conversions.
1---2name: line-count3description: Count lines of code using cloc with predefined scopes (source, tests, examples) Use when this capability is needed.4---56# Line Count78Count lines of Python code in the project using `cloc`. Three predefined scopes are available.910## Scopes1112| Scope | Argument | Directories | Command |13|-------|----------|-------------|---------|14| **Source only** | `src` | `happysimulator/` | `cloc happysimulator/ --exclude-dir=__pycache__,.egg-info` |15| **Source + Tests** | `src+tests` | `happysimulator/`, `tests/` | `cloc happysimulator/ tests/ --exclude-dir=__pycache__,.egg-info` |16| **All** | `all` | `happysimulator/`, `tests/`, `examples/` | `cloc happysimulator/ tests/ examples/ --exclude-dir=__pycache__,.egg-info` |1718## Instructions19201. If the user provides a scope argument (`src`, `src+tests`, or `all`), run that scope directly212. If no argument is provided, ask the user which scope they want using these three options223. Run the appropriate `cloc` command from the project root234. Present the results in a summary table showing files, blank lines, comments, and code lines245. If multiple directories are included, also run each directory individually so the user can see a per-directory breakdown256. At the end, display a concise summary like:2627```28Library (happysimulator/): X,XXX lines29Tests (tests/): X,XXX lines30Examples (examples/): X,XXX lines31──────────────────────────────────────32Total: X,XXX lines33```3435## Notes3637- Requires `cloc` to be installed and available on PATH38- If `cloc` is not found, inform the user to install it (`choco install cloc`, `scoop install cloc`, or `pip install cloc`)3940---41> Converted and distributed by [TomeVault](https://tomevault.io/claim/adamfilli) — claim your Tome and manage your conversions.42<!-- tomevault:4.0:skill_md:2026-04-11 -->