Skip to content
Back to skills

Code Quality Refactoring

ASecurity

Tools to enforce code cleanliness, reduce technical debt, and maintain architectural standards.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
code-qualityjavascriptgojavabashnoderefactoring

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill code-quality-refactoring --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Code Quality Refactoring?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Code Quality Refactoring
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-code-quality-refactoring/badge)](https://www.skillsdirectory.com/skills/david-li0406-code-quality-refactoring)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Code Quality & Refactoring
description: Tools to enforce code cleanliness, reduce technical debt, and maintain architectural standards.
---

# 🧹 Code Quality & Refactoring Skill

This skill enforces the standards of the **Code Reviewer** and **JavaScript Pro** agents. It is the **Health Monitor** for your codebase.

## 🎯 When to Use
- **After every Feature Implementation**: Clean up the "construction site".
- **Refactoring Legacy Code**: When touching a file > 3 months old.
- **Before `gated-commit`**: Ensure no blockers exist.

## 🛠️ Toolbelt

### 1. The Quality Scanner (Automated)
Detects "God Components", type safety violations, and leftover debug noise.

```bash
node .agent/skills/code-quality/scripts/scan-quality-metrics.js <target_directory>
```

**Common Violations & Fixes:**

| Violation Type | Detected Pattern | The "Pro" Fix |
|:---:|:---:|:---:|
| **Type Safety** | `any`, `Function` | Use `unknown`, generics, or specific Interfaces. |
| **Debug Noise** | `console.log()` | Remove or use `logger.info()` (only if necessary). |
| **Complexity** | File > 300 lines | **Extract** sub-components to `./components/<Name>/`. |
| **Exports** | Unused export | **Delete** it. Dead code is technical debt. |

### 2. Manual Cleanup Checklist
- [ ] **Comments**: Delete "What" comments. Keep "Why" comments.
- [ ] **Naming**: do variables explain themselves? (`d` vs `durationInMs`).
- [ ] **Imports**: Are imports organized? (Absolute vs Relative).

## 🚀 Workflows

### Workflow A: The "Boy Scout" Pattern
Use this when you are just passing through a file.

1. **Scan**: visually checks for `any` or `console.log`.
2. **Fix**: Apply the "Pro" fix immediately.
3. **Leave**: Do not start a massive refactor unless requested.

### Workflow B: The "Deep Clean"
Use this when assigned a refactoring task.

1. **Measure**: Run `scan-quality-metrics.js` to get a baseline.
2. **Plan**: Identify the top 3 "God Components" to break down.
3. **Execute**: Break them down one by one.
4. **Verify**: Ensure functionality is unchanged (Run Smoke Tests).

## 🧠 Philosophy
> **"If you can't type it, you don't understand it."**
> Avoid shortcuts. `any` is a virus that spreads. Kill it early.

Files in this skill

  • SKILL.md2.2 KB
  • scripts/scan-quality-metrics.js2.6 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…