← Browse

@huangjia2019/code-health-check

B

Perform a comprehensive code health check on a directory. Use when the user asks to analyze code quality, find issues, or get a health report.

skillclaude

Install

agr install @huangjia2019/code-health-check --target claude

Writes 1 file into .claude/skills/, pinned to git-4d2b9e15.

  • .claude/skills/code-health-check/SKILL.md

Document


name: code-health-check description: Perform a comprehensive code health check on a directory. Use when the user asks to analyze code quality, find issues, or get a health report. context: fork agent: general-purpose allowed-tools:

  • Read
  • Grep
  • Glob

Code Health Check

Analyze the codebase at $ARGUMENTS and produce a structured health report.

Checks to Perform

1. File Organization

  • Are files reasonably sized? (Flag files > 200 lines)
  • Is the directory structure logical?
  • Any files that look misplaced?

2. Error Handling

  • Are async operations wrapped in try/catch?
  • Are errors propagated correctly (not swallowed)?
  • Is there a global error handler?

3. Security Basics

  • Any hardcoded secrets, API keys, or passwords?
  • Any use of eval() or similar dangerous functions?
  • Are user inputs validated before use?

4. Code Quality

  • Any obvious code duplication (similar blocks in multiple files)?
  • Any unused variables or imports?
  • Are function signatures reasonable (not too many parameters)?

5. Dependency Hygiene

  • Are all imported modules actually used?
  • Any circular dependencies?

Severity Levels

Use these to categorize issues:

SeverityMeaningExample
CRITICALMust fix immediatelyHardcoded secrets, SQL injection
WARNINGShould fix soonMissing error handling, large files
INFONice to improveMinor duplication, naming conventions

Output Format

Return a structured report in this exact format:

# Code Health Report: {directory}

## Overall Score: {A/B/C/D/F}

## Summary
- Files analyzed: {count}
- Issues found: {critical} critical, {warning} warnings, {info} info

## Critical Issues
{list each with file:line and description}

## Warnings
{list each with file:line and description}

## Info
{list each with file:line and description}

## Recommendations
{top 3 actionable recommendations}

Trustgrade B

  • passBody integrity

    Whether the stored document is plausibly the kind of file the artifact declares, rather than something fetched by mistake.

  • passType matchnot applicable to this artifact type

    Whether the artifact is really the kind of thing its metadata claims it is.

  • passFreshness

    How long since the source repository was last pushed to.

  • passPrompt injection

    Scans the artifact's own text for instructions aimed at your agent rather than at you.

  • warnLicenseno SPDX license detected

    Whether the source repository declares an SPDX license permissive enough to redistribute.

How the grade is calculated

Each check contributes 0 points when it passes, 1 when it warns, and 2 when it fails. The total maps to a letter:

  • Aevery check passed
  • Bone warning
  • Ctwo warnings
  • Dprompt injection or body integrity failed, or three warnings
  • Fone of those failed, and something else is wrong

These are automated hygiene checks, not a security audit, and not a dependency or vulnerability scan. A grade of A means nothing was flagged — not that the artifact is safe.

Versions

  • git-4d2b9e15b0d52026-07-31