agentleFS
brianwestphalbrianwestphal/glassbox/.claude/skills/check-code-hygiene/SKILL.md

check-code-hygiene

Skill34 starsChanged 4 months agoMITView on GitHub

Check code for standardization, readability, maintenance complexity, and defensive coding

The file

Files
SKILL.md

Analyze the codebase for code hygiene issues. Generate a report highlighting problems with standardization, human readability, maintenance complexity, and defensive coding.

Process

  1. Read CLAUDE.md to understand the project's documented conventions and architecture.
  2. Scan the source code (src/) for these categories of issues:

Standardization

  • Inconsistent naming conventions (camelCase vs snake_case, abbreviations)
  • Inconsistent patterns for similar operations (e.g., error handling done differently in similar contexts)
  • Inconsistent import ordering or module organization
  • Mixed paradigms without clear justification

Human Readability

  • Functions that are too long or do too many things (>50 lines of logic)
  • Deeply nested code (>3 levels of nesting)
  • Unclear variable/function names that require reading the implementation to understand
  • Missing or misleading comments on complex logic
  • Magic numbers or strings without named constants
  • Complex boolean expressions that should be extracted to named variables

Maintenance Complexity

  • Tight coupling between modules that should be independent
  • Circular dependencies
  • God objects or functions that know too much about other modules
  • Duplicated logic that should be shared
  • Files that mix multiple unrelated concerns (check against the "one primary export per file" convention in CLAUDE.md)

Defensive Coding

  • Unvalidated external input (API request bodies, query params, file contents)
  • Missing error handling on I/O operations (file reads, network calls, database queries)
  • Unsafe type assertions (as any, as unknown as T) that bypass type safety
  • Non-null assertions (!) on values that could legitimately be null
  • Race conditions in async code (missing await, unhandled promise rejections)
  1. Generate the report organized by category. For each finding:
    • File path and line number(s)
    • Description of the issue
    • Severity: high (likely to cause bugs), medium (maintenance burden), low (style/consistency)
    • Suggested fix (brief)
  2. Summary at the end with:
    • Total findings by severity
    • Top 5 files that need the most attention
    • Overall assessment

Present the report directly to the user. Focus on genuine issues — don't flag things that are intentional patterns documented in CLAUDE.md.

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.