# Improve Code Readability and Maintainability

Unclear code slows reviews and increases maintenance effort. This skill applies practical principles to naming, functions, comments, error handling, formatting, and common code smells.

## Install

```bash
npx skillstore add benny9193/clean-code
```

## Metadata

- Status: approved
- Slug: benny9193-clean-code
- Skillstore revision: r2
- Version status: missing
- Tree hash: 4038c524912f24e0842c7140d1f62321c4021e07159648e2ac1b5e5117c82a3f
- Author: Benny9193
- GitHub username: Benny9193
- License: MIT
- Repository: https://github.com/Benny9193/devflow/tree/master/skills/clean-code
- Ref: 8c3e20bba512c392d9b02ee748b18e0b09d4982c
- Supported tools: Claude, Codex, Claude Code
- Audit status: complete
- Agent install advisory: allowed
- Manual install advisory: allowed
- Artifact signature: available
- Audit attestation: unavailable
- Human verification: not\_verified
- Risk factors: external\_commands, filesystem
- Quality score: 78
- Quality tier: bronze
- Public page: https://skillstore.pages.dev/skills/benny9193-clean-code
- Manifest: https://skillstore.pages.dev/api/skills/benny9193-clean-code/manifest

## Capabilities

- Reviews variable, function, and boolean names for clarity.
- Suggests focused functions, parameter objects, and early returns.
- Identifies comments that hide unclear code or provide useful context.
- Recommends explicit error handling and reduced null usage.
- Highlights common code smells and practical refactoring options.
- Promotes consistent formatting and logical grouping of related code.

## Use Cases

- Review a First Codebase: Find unclear names, large functions, deep nesting, and weak comments before requesting a team review.
- Standardize Pull Request Feedback: Apply consistent maintainability criteria when reviewing changes across a shared repository.
- Plan Legacy Refactoring: Identify code smells and organize small refactoring steps that preserve existing interfaces.

## Prompt Templates

### Improve Names

```
Review this [language] code for unclear names. Suggest descriptive names and explain each change: [code]
```

### Simplify Functions

```
Review [code] for mixed responsibilities, excessive parameters, flag arguments, or deep nesting. Propose focused refactoring steps.
```

### Assess Maintainability

```
Assess [code] for misleading comments, weak error handling, null usage, formatting issues, and code smells. Prioritize findings by maintenance impact.
```

### Plan Incremental Refactoring

```
Perform a clean code review of [module]. Preserve behavior and public interfaces. Propose an incremental plan with risks, validation steps, and tradeoffs.
```

## Limitations

- It provides guidance but does not run formatters, linters, or tests.
- It does not verify that refactoring preserves behavior.
- Examples use TypeScript, although most principles apply across languages.
- It does not cover architecture, performance, or security in depth.

## Best Practices

- Provide the language, surrounding context, and intended behavior with each review.
- Apply refactoring in small steps and validate behavior after each change.
- Prioritize clarity for future maintainers over personal style preferences.

## Anti Patterns

- Do not request broad rewrites without behavior constraints or tests.
- Do not apply every principle mechanically when domain context requires a tradeoff.
- Do not treat formatting preferences as substitutes for maintainability improvements.

## Security Audit

- Audited at: 2026-07-23T11:18:06.571\+00:00
- Summary: All 34 static findings are false positives caused by Markdown fences, TypeScript template literals, and illustrative file-path examples. SKILL.md contains guidance only, with no executable scripts, command invocation, reconnaissance, prompt injection, or malicious intent. No remediation is required.

## Stats

- Views: 239
- Downloads: 14
- Favorites: 0
- Popularity score: 0
