Skip to content
Back to skills

Code Quality

ASecurity

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

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmentgoshellbashnodetestinggitapidocumentation

Works with

  • api

Security analysis

A100/100

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

Scanned September 27, 2026

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

Installs into .claude/skills of the current project.

Are you the author of Code Quality?

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

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

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
# Code Quality Skill

## Purpose
Enable coding agents to learn and enforce project-specific code quality patterns via automated scanning, config discovery, conflict resolution, 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.

## Inputs
- Root directory (default: workspace root).
- Optional: directories or glob patterns to scan; resume_from agentId for resumable runs; thoroughness (quick|medium|thorough).

## Outputs
- Pattern report (patterns.md)
- Generated/merged .code-quality.json
- Optional linter rule suggestions (e.g., ESLint flat config fragment)
- Conflict MCQs when confidence is medium or conflicting

## 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
1) Configuration discovery (config-reader)
   - Scan for ESLint, Prettier, EditorConfig, TSConfig, pyproject, etc.
   - Normalize rules; detect conflicts (indent, semi, quotes, line endings, strictness).
2) Distributed pattern scanning (pattern-scanner)
   - For each major directory (src, lib, apps, packages, tests): spawn haiku agent.
   - Collect occurrences, locations, examples by category (naming, imports, api_calls, state_management, component_structure, error_handling, testing, documentation).
3) Consolidation
   - Merge pattern data; compute scores (frequency, consistency_ratio, recency_weight, author_distribution).
   - Tag confidence tier: High (>=5 and >90%), Medium (>=5 and 70-90%), Low (<5 or <70%), Conflicting (multiple patterns with 5+ each).
4) Conflict handling
   - If conflicts or medium confidence: invoke conflict-resolver (sonnet) to craft MCQs with pros/cons and recommended option.
   - Offer Dig Deeper when 5+ variations exist.
5) Output generation
   - Write patterns.md using template.
   - Write or merge .code-quality.json (version 1.0) with confirmed/detected/custom patterns, custom_rules, excluded_paths, integrations.
   - Surface recommended linter/formatter rules aligned to configs and patterns.

## Resumable sessions
- Each pattern-scanner returns agent_id and optional checkpoint. Resume with resume_from.

## 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) (Future) remote curated libraries

## Interaction rules
- Do not modify source files; operate read-only except when writing outputs.
- Prefer MCQ when confidence is medium or conflicts detected; auto-apply only for high confidence.
- Respect contextual boundaries (auth vs public, tests vs prod, components vs utils).
- Persist user decisions into .code-quality.json.

## File conventions
- Outputs live at repo root unless user specifies otherwise.
- Exclude node_modules, dist, build, coverage, .git by default.

## Error handling
- If config parse fails, report file and rule; continue scanning others.
- If no patterns detected (<100 LOC), switch to greenfield flow and propose best-practice bundle.

Files in this skill

  • SKILL.md3.4 KB
  • agents/config-reader.md1.5 KB
  • agents/conflict-resolver.md1.9 KB
  • agents/pattern-scanner.md1.6 KB
  • references/best-practices/general.md610 B
  • references/best-practices/javascript-typescript.md766 B
  • references/best-practices/python.md636 B
  • references/best-practices/react.md769 B
  • references/confidence-scoring.md625 B
  • references/config-integrations.md663 B
  • references/pattern-categories.md1.4 KB
  • references/shell-commands.md3.5 KB
  • templates/code-quality-config.json957 B
  • templates/mcq-confirmation.md939 B
  • templates/pattern-report.md552 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…