askill
quality-audit

quality-auditSafety --Repository

Code quality analysis including module sizes, cyclomatic complexity, and test coverage gaps.

0 stars
1.2k downloads
Updated 2/13/2026

Package Files

Loading files...
SKILL.md

Quality Audit

Evaluates the health and maintainability of the codebase.

Features

  • Module Size Enforcement: Validates file lengths against configured limits
  • Complexity Analysis: Cyclomatic complexity via ESLint rules
  • Coverage Audit: Highlights critical paths lacking test protection
  • Tech Debt Identification: Scans for TODOs and deprecated patterns
  • Dead Code Detection: Identifies unused exports and unreachable code

Usage

Manual Execution

```bash

Run full audit

./scripts/quality-audit.sh

Specific scope

./scripts/quality-audit.sh --scope frontend

Include coverage analysis

./scripts/quality-audit.sh --coverage ```

AI Invocation

When invoked as a skill, the AI will:

  1. Run ESLint with complexity rules
  2. Check file sizes against limits
  3. Scan for TODO/FIXME/HACK comments
  4. Optionally run tests with coverage
  5. Generate severity-classified report

Checks Performed

1. Module Size Limits

Validates files against configurable limits:

CategorySoft Cap (Warn)Hard Block
Controllers/Pages/Components500 lines750 lines
Hooks/Utils200 lines300 lines
Services300 lines500 lines

Configure in your project's ESLint or custom config.

2. Complexity Analysis

ESLint rules checked:

```javascript { "rules": { "complexity": ["warn", 10], "max-depth": ["warn", 4], "max-lines-per-function": ["warn", 50], "max-nested-callbacks": ["warn", 3] } } ```

3. Test Coverage

Coverage thresholds:

MetricTarget
Statements80%
Branches75%
Functions80%
Lines80%

Focus on critical paths:

  • Authentication/authorization
  • Payment processing
  • Data validation
  • Core business logic

4. Tech Debt Markers

Scans for:

  • `TODO:` - Planned improvements
  • `FIXME:` - Known bugs to fix
  • `HACK:` - Temporary workarounds
  • `XXX:` - Attention needed
  • `@deprecated` - Deprecated code

5. Dead Code Detection

Identifies:

  • Unused exports
  • Unreachable code paths
  • Unused variables (beyond eslint basic checks)
  • Orphaned files

Output Format

```markdown

Quality Audit Report

Scope: all Date: 2025-01-20T10:30:00Z

Module Sizes

FileLinesLimitStatus
src/components/Dashboard.tsx520500⚠️ WARN
src/services/UserService.ts780500❌ BLOCK

Complexity

FileFunctionComplexityLimit
src/utils/parser.tsparseInput1510

Tech Debt

TypeCountFiles
TODO2315
FIXME85
HACK32

Coverage (if enabled)

MetricCurrentTargetStatus
Statements72%80%⚠️
Branches68%75%⚠️
Functions85%80%
Lines73%80%⚠️

Uncovered Critical Paths

  • `src/auth/validateToken.ts` - 0% coverage
  • `src/payments/processCharge.ts` - 45% coverage

Summary

  • Blocking: 1 (file over hard limit)
  • Warnings: 5
  • Tech Debt Items: 34

Recommendations

  1. Split UserService.ts into smaller modules
  2. Add tests for validateToken.ts
  3. Refactor parseInput to reduce complexity ```

Prerequisites

Required

  • Node.js with npm or pnpm
  • ESLint configured in project

Optional

ToolPurposeInstallation
vitest/jestCoverage analysisAlready in most projects
eslint-plugin-unused-importsDead code`npm i -D eslint-plugin-unused-imports`
madgeCircular dependencies`npm i -g madge`

Configuration

ESLint Setup

```javascript // eslint.config.js or .eslintrc { "extends": ["eslint:recommended"], "rules": { "complexity": ["warn", 10], "max-depth": ["warn", 4], "max-lines": ["warn", { "max": 500, "skipBlankLines": true }], "max-lines-per-function": ["warn", 50] } } ```

Coverage Configuration

```javascript // vitest.config.ts export default { test: { coverage: { provider: 'v8', reporter: ['text', 'json', 'html'], thresholds: { statements: 80, branches: 75, functions: 80, lines: 80 } } } } ```

Integration

CI Pipeline

```yaml quality-audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: npm ci - run: npm run lint - run: npm run test -- --coverage - run: ./scripts/quality-audit.sh ```

Pre-commit Hook

```bash

.husky/pre-commit

Check only staged files

FILES=$(git diff --cached --name-only --diff-filter=ACM | grep -E '.(ts|tsx|js|jsx)$') if [ -n "$FILES" ]; then npx eslint $FILES fi ```

Refactoring Guidelines

When files exceed limits, refactor at behavioral seams:

  1. Extract by responsibility - One module, one job
  2. Extract by data type - Group operations on same data
  3. Extract utilities - Pure functions with no side effects
  4. Extract hooks - Reusable React logic

Don't:

  • Split arbitrarily at line counts
  • Create too many tiny modules
  • Over-abstract for hypothetical needs

See Also

Install

Download ZIP
Requires askill CLI v1.0+

AI Quality Score

AI review pending.

Metadata

Licenseunknown
Version-
Updated2/13/2026
Publisherryangaraygay

Tags

ci-cdlintingobservabilitysecuritytesting