SuperAPI AI Directory

file-line-audit

Coding & development

View repository

Updated 10-15 20:08

About this skill

File Line Audit

Use this skill to audit oversized source files in a repository and return only files that meet or exceed the specified line-count threshold.

When to use:

  • From the scripts/ directory, select the packaged binary that matches the current operating system and CPU architecture.
  • Always run from the target repository root so that .gitignore takes effect correctly.
  • First inspect the repository structure and language stack, then decide the scan scope.
  • Pass scan parameters explicitly via the command line; there is no default config file.
  • First apply the repository .gitignore, then apply additional exclude rules.
  • Use one or more include globs to limit the scan scope.
  • Output only files whose physical line count is greater than or equal to the threshold.

Install

npx skills add bosens-China/my-skills/skills/file-line-audit

Binary selection

From scripts/ select the executable for the corresponding platform:

  • Windows amd64: scripts/line-audit-windows-amd64.exe
  • Linux amd64: scripts/line-audit-linux-amd64
  • Linux arm64: scripts/line-audit-linux-arm64
  • macOS amd64: scripts/line-audit-darwin-amd64
  • macOS arm64: scripts/line-audit-darwin-arm64

Steps

  1. Confirm that you are currently in the target repository root.
  2. Inspect the repository structure and decide what to scan:
    • Identify source directories, for example src、app、apps、pkg、packages、lib、internal、cmd、backend、frontend、client、server、service、services、api、web。
    • Identify relevant source extensions, for example js、ts、tsx、vue、py、go、rs、java、kt、rb、php、cs、swift。
    • Only when .gitignore is insufficient, add additional exclude, for example dist/、build/、coverage/ or generated directories.
  3. According to the current platform, select the correct scripts/line-audit-* binary.
  4. On Linux/macOS, ensure the binary is executable:
    chmod +x <binary_path>
    
  5. Use explicit --include, optional --exclude , and optional --threshold to run.
  6. Return the list of files above the threshold to the user.

Command

In the following examples,<skill_root> is the absolute path of the current skill directory.

Run with the include parameter

Unix-like systems:

chmod +x <skill_root>/scripts/line-audit-<target>
<skill_root>/scripts/line-audit-<target> \
  --threshold 400 \
  --include "src/**/*.{ts,tsx,js,jsx,vue}" \
  --include "apps/**/*.{ts,tsx,js,jsx,vue}" \
  --exclude "dist/" \
  --exclude "build/"

Windows:

& <skill_root>\scripts\line-audit-windows-amd64.exe `
  --threshold 400 `
  --include "src/**/*.{ts,tsx,js,jsx,vue}" `
  --include "apps/**/*.{ts,tsx,js,jsx,vue}" `
  --exclude "dist/" `
  --exclude "build/"

Run with JSON parameters

If a full parameter object is more convenient, use --json:

<skill_root>/scripts/line-audit-<target> --json '{
  "threshold": 400,
  "include": [
    "src/**/*.{ts,tsx,js,jsx,vue}",
    "apps/**/*.{ts,tsx,js,jsx,vue}"
  ],
  "exclude": [
    "dist/",
    "build/"
  ]
}'

Parameters

  • --include / -i: Required glob pattern; multiple source roots or extension scopes can be passed repeatedly.
  • --exclude / -e: Optional additional ignore rules, with the same syntax as .gitignore ; can be passed repeatedly.
  • --threshold / -t: Output threshold, default 400。
  • --json / -j: Optional JSON object, containing threshold、include、exclude。
  • --help / -h: Show CLI help.

Output format

Return the tool output directly. Expected format:

# File Line Audit

## Files Over Threshold (>= 400 lines)

- src/example.ts 512
- apps/web/pages/home.tsx 438

Limitations

  • Only physical line counts are counted: code, comments, and blank lines are not distinguished.
  • Binary files are skipped automatically.
  • Depends on a Git environment to resolve .gitignore。
  • Optimized for source scanning; avoid scanning large data directories or build artifacts that are not covered by .gitignore .

Notes

  • Repository .gitignore always takes effect, even if no additional exclude。
  • Supports nested .gitignore。
  • Each run requires at least one --include pattern.