Skip to content
Back to skills

Code Quality 11

ASecurity

AI Skill that enables coding agents to automatically learn, understand, and enforce code quality patterns within a codebase. The skill uses a sub-agent architecture for distributed pattern analysis, integrates with existing configuration files (ESLint, Prettier, etc.), and provides interactive MCQ-based confirmation flows for pattern resolution. Includes anti-pattern detection, code smell identification, and complexity metrics.

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

Works with

  • api

Security analysis

A100/100

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

Scanned September 27, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Code Quality 11?

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

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

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
description: AI Skill that enables coding agents to automatically learn, understand, and enforce code quality patterns within a codebase. The skill uses a sub-agent architecture for distributed pattern analysis, integrates with existing configuration files (ESLint, Prettier, etc.), and provides interactive MCQ-based confirmation flows for pattern resolution. Includes anti-pattern detection, code smell identification, and complexity metrics.

---

# Code Quality Skill

## Purpose

Enable coding agents to learn and enforce project-specific code quality patterns via automated scanning, config discovery, conflict resolution, anti-pattern detection, and persisted outputs.

## When to use

- User asks for code quality, coding patterns, style guide, conventions, consistency, linting rules, or code standards.
- Before generating code to align with existing patterns.
- After detecting inconsistent patterns or conflicting configs.
- During greenfield setup to seed best-practice configs.
- When reviewing code for potential issues or technical debt.
- To identify anti-patterns, code smells, or complexity hotspots.

## Inputs

| Parameter | Default | Description |
|-----------|---------|-------------|
| `root` | workspace root | Root directory to analyze |
| `directories` | auto-detect | Specific directories or glob patterns |
| `thoroughness` | medium | Analysis depth: `quick` \| `medium` \| `thorough` |
| `resume_from` | — | Agent ID for resumable runs |
| `include_antipatterns` | true | Enable anti-pattern detection |
| `include_metrics` | true | Enable code metrics collection |

## Outputs

- **patterns.md** — Detailed pattern report
- **.code-quality.json** — Machine-readable patterns and rules
- **Linter suggestions** — ESLint/Prettier config fragments
- **Anti-pattern report** — Code smells and complexity issues
- **Metrics summary** — LOC, function lengths, nesting depths
- **Conflict MCQs** — Interactive resolution for ambiguous patterns

## OS detection (run once per session)

- Unix/macOS: `uname -s` => Linux/Darwin; prefer bash/zsh; use jq for JSON if available.
- Windows: `$env:OS` => Windows_NT; use PowerShell JSON cmdlets.
- If jq is unavailable on Unix, fall back to Node.js one-liner merges.

## Workflow

### Phase 1: Configuration Discovery (config-reader agent)
- Scan for ESLint, Prettier, EditorConfig, TSConfig, pyproject, etc.
- Normalize rules; detect conflicts (indent, semi, quotes, line endings, strictness).
- Build priority-ordered rule set.

### Phase 2: Distributed Pattern Scanning (pattern-scanner agents)
- For each major directory (src, lib, apps, packages, tests): spawn haiku agent.
- **Structure analysis**: File organization, module boundaries, dependency flow.
- **Pattern detection**: Naming, imports, API calls, state management, components, errors, tests, docs.
- **Anti-pattern detection**: Code smells, complexity, coupling, duplication, security issues.
- **Metrics collection**: LOC, function length, nesting depth, import counts.

### Phase 3: Consolidation & Scoring
- Merge pattern data from all agents.
- Compute confidence scores using multi-factor algorithm:
  - Occurrence frequency (25%)
  - Consistency ratio (25%)
  - File coverage (20%)
  - Recency weight (10%)
  - Author distribution (8%)
  - Context consistency (7%)
  - Config alignment (5%)
- Tag confidence tiers: High (85-100), Medium-High (70-84), Medium (50-69), Low (25-49), Very Low (0-24).

### Phase 4: Conflict & Ambiguity Resolution (conflict-resolver agent)
- If conflicts or medium confidence: invoke sonnet agent to craft MCQs.
- Provide pros/cons and recommended option.
- Offer "Dig Deeper" when 5+ variations exist.
- Allow custom responses.

### Phase 5: Output Generation
- Write **patterns.md** using template.
- Write or merge **.code-quality.json** with:
  - Confirmed/detected/custom patterns
  - Custom rules
  - Excluded paths
  - Integration settings
  - Anti-pattern baseline
- Generate recommended linter/formatter rule changes.
- Create anti-pattern report with severity levels and fix suggestions.

## Thoroughness Levels

| Level | Description | Use Case |
|-------|-------------|----------|
| `quick` | Config scan + top-level patterns only | Pre-commit checks, CI gates |
| `medium` | Full pattern scan, sampling for metrics | Regular analysis, code reviews |
| `thorough` | Deep analysis, all files, full metrics | Initial setup, major refactors |

## Resumable sessions

- Each pattern-scanner returns agent_id and optional checkpoint.
- Resume interrupted scans with `resume_from` parameter.
- Checkpoints: `phase_1_complete`, `phase_2_partial`, `phase_3_complete`, etc.

## Best-practice source priority

1. User-defined (.code-quality.json custom_rules)
2. Project configs (EditorConfig > ESLint > Prettier > TSConfig > language-specific)
3. Detected patterns (high confidence)
4. Model inference for stack version
5. Industry standards for detected framework/library

## Interaction rules

- **Read-only** on source files; only write output files.
- **MCQ confirmation** for medium confidence or conflicts.
- **Auto-apply** only for high confidence patterns.
- **Context-aware**: respect boundaries (auth vs public, tests vs prod, components vs utils).
- **Persist decisions** to .code-quality.json for future runs.

## File conventions

- Outputs live at repo root unless user specifies otherwise.
- Default exclusions: node_modules, dist, build, coverage, .git, vendor, __pycache__, tmp.

## Error handling

- If config parse fails: report file and error; continue scanning others.
- If no patterns detected (<100 LOC): switch to greenfield flow with best-practice bundle.
- If agent fails: log checkpoint; allow resume from last known state.
- Surface all errors in final report with suggested remediation.

## Anti-Pattern Severity Levels

| Level | Score | Action Required |
|-------|-------|-----------------|
| Critical | >1.5 | Must fix before merge |
| High | 1.0-1.5 | Should fix, warn in report |
| Medium | 0.5-1.0 | Note in report |
| Low | <0.5 | Informational only |

Files in this skill

  • .gitignore17 B
  • LICENSE1 KB
  • README.md7.8 KB
  • SKILL.md6 KB
  • agents/config-reader.md1.5 KB
  • agents/conflict-resolver.md1.9 KB
  • agents/pattern-scanner.md5.7 KB
  • code-quality/SKILL.md3.4 KB
  • code-quality/agents/config-reader.md1.5 KB
  • code-quality/agents/conflict-resolver.md1.9 KB
  • code-quality/agents/pattern-scanner.md1.6 KB
  • code-quality/references/best-practices/general.md610 B
  • code-quality/references/best-practices/javascript-typescript.md766 B
  • code-quality/references/best-practices/python.md636 B
  • code-quality/references/best-practices/react.md769 B
  • code-quality/references/confidence-scoring.md625 B
  • code-quality/references/config-integrations.md663 B
  • code-quality/references/pattern-categories.md1.4 KB
  • code-quality/references/shell-commands.md3.5 KB
  • code-quality/templates/code-quality-config.json957 B

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…