agentleFS
lepinkainenlepinkainen/skills/code-health/SKILL.md

code-health

Skill1 starsChanged 11 months agoCC0-1.0View on GitHub

Analyze codebase health - large files, test coverage gaps, duplicate code, dead/legacy code, and documentation issues. Use when asked to scan, audit, or assess code quality, find refactoring targets, or identify technical debt.

10 other projects use a version of this.

Adopted by

Most recently taken up by

Used with

Projects with it also use dependency-watch, perform-task and 3 more.

Other files people use alongside this one.

Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
  • telegramdesktopSkill

    dependency-watch

    Audit Telegram Desktop dependencies on freshly fetched origin/dev for releases and security fixes, including upstream lag and backport candidates in patched forks. Use for the scheduled dependency monitor or an explicitly requested dependency report.

    Also in 3 projects that use this

  • telegramdesktopSkill

    perform-task

    Resolve, start or resume, implement, review, test, and publish exactly one existing ai-tdesktop task by short slug or full dated id, including rare blocked retries and split-required results. Use when the user invokes $perform-task or /perform-task with a known task name, or when the continue scheduler delegates one selected task. Runs standard review lenses with fast applicability bailouts and selects task-specific domain and evidence instruments without selecting additional work.

    Also in 3 projects that use this

  • JerovinoSkill

    process-inbox

    Processes tasks.md inbox items by triaging each one to its proper location in the vault

    Also in 3 projects that use this

  • Trejon-888Skill

    continue

    Load project context, alignment audit, status check, suggest next action. Auto-invoke at session start, after context switches, or when user says 'continue', 'pick up where we left off', 'resume', 'what's next', 'status check', 'what now'.

    Also in 3 projects that use this

  • raineSkill

    rebase

    Rebase the current branch with smart conflict resolution.

    Also in 3 projects that use this

The file

We split this skill into the rules it gives an agent

1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.

  • 0

    Common

    Most of the 10 edited versions we read keep these.

  • 0

    Distinctive

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Run scripts/health.py to analyze codebase health.

    line 8

“Common” is measured: kept by at least 6 in 10 of the 10 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Code Health Analysis

Run scripts/health.py to analyze codebase health. The script auto-detects project type (Go, Python, JS/TS) and runs appropriate checks.

Usage

Primary (LLM/programmatic use):

# Full scan with JSON output (recommended for LLM consumption)
python /path/to/skill/scripts/health.py --json [directory]

# Specific checks with JSON output
python /path/to/skill/scripts/health.py --check size --json [directory]
python /path/to/skill/scripts/health.py --check tests --json [directory]
python /path/to/skill/scripts/health.py --check dupes --json [directory]
python /path/to/skill/scripts/health.py --check dead --json [directory]
python /path/to/skill/scripts/health.py --check docs --json [directory]

Secondary (human debugging):

# Human-readable output with emojis (for manual inspection)
python /path/to/skill/scripts/health.py [directory]
python /path/to/skill/scripts/health.py --check size [directory]

Checks

CheckDescription
sizeLarge files, function counts, git churn
testsCoverage gaps, missing test files, test quality
dupesDuplicate function names, similar patterns
deadLegacy markers, unused exports, stale code
docsUndocumented exports, missing READMEs

Output

JSON format (recommended): Structured output for LLM/programmatic parsing with severity levels:

  • "critical": Immediate attention needed
  • "warning": Should address soon
  • "info": Nice to fix

Each finding includes file path, line number (when applicable), message, and suggested action.

Human-readable format (debugging only): Pretty-printed output with emoji severity indicators (🔴 critical, 🟡 warning, 🟢 info) for manual inspection.

AST-Based Function Analysis

For more accurate function analysis, use the included AST parsers:

gofuncs - Go Function Analyzer

go run scripts/gofuncs.go -dir /path/to/project

Output format: file:line:type:exported:name:receiver:signature

  • type: f=function, m=method
  • exported: y=public, n=private

Example:

api.go:15:f:n:fetchItems:()[]Item
config.go:144:m:y:GetCategory:*Mapper:(string)string

pyfuncs - Python Function Analyzer

python scripts/pyfuncs.py --dir /path/to/project

Output format: file:line:type:exported:name:class:signature:decorators

  • type: f=function, m=method, s=staticmethod, c=classmethod, p=property
  • exported: y=public, n=private (underscore prefix)

Example:

main.py:15:f:y:process_data::(data:List[str])->Dict[str,int]:
api.py:45:m:y:fetch:APIClient:async (url:str)->Response:cache,retry

jsfuncs - JavaScript/TypeScript Function Analyzer

node scripts/jsfuncs.js --dir /path/to/project

Output format: file:line:type:exported:name:class:signature:decorators

  • type: f=function, m=method, a=arrow, c=constructor, g=getter, s=setter
  • exported: y=public, n=private

Example:

main.js:15:f:y:processData::(data:string[])=>Promise<Object>:
api.ts:45:m:y:fetch:APIClient:async (url:string)=>Response:

Use Cases for AST Tools

These tools provide accurate function-level analysis for:

  • Complexity analysis: Count functions per file, analyze parameter complexity
  • Test coverage: Identify which specific functions lack tests
  • Duplicate detection: Find similar function signatures across the codebase
  • API surface analysis: List all public vs private functions
  • Documentation gaps: Cross-reference with doc comments

Combine with health.py for comprehensive codebase health analysis.

Requirements

Required: python3 Optional (for better results): rg (ripgrep), fd, git, go (for Go projects), staticcheck, node (for JS/TS projects)

Missing tools are reported but don't block execution.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.