Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Um comando direto ignora o prompt de revisão. Verifique a origem antes de executá-lo.
Worker that checks DRY/KISS/YAGNI/architecture compliance with quantitative Code Quality Score. Validates architectural decisions via MCP Ref: (1) Optimality (2) Compliance (3) Performance. Reports issues with SEC-, PERF-, MNT-, ARCH-, BP-, OPT- prefixes.
Paths: File paths (shared/, references/, ../ln-*) are relative to skills repo root. If not found at CWD, locate this SKILL.md directory and go up one level for repo root.
Code Quality Checker
Analyzes Done implementation tasks with quantitative Code Quality Score based on metrics, MCP Ref validation, and issue penalties.
Purpose & Scope
Load Story and Done implementation tasks (exclude test tasks)
Calculate Code Quality Score using metrics and issue penalties
MCP Ref validation: Verify optimality, best practices, and performance via external sources
Check for DRY/KISS/YAGNI violations, architecture boundary breaks, security issues
Produce quantitative verdict with structured issue list; never edits Linear or kanban
Error Contract inconsistency: mixed raise + return None in same service
medium
When to Use
Invoked by ln-510-quality-coordinator Phase 2
All implementation tasks in Story status = Done
Before ln-512 tech debt cleanup and ln-513 agent review
Workflow (concise)
Load Story (full) and Done implementation tasks (full descriptions) via Linear; skip tasks with label "tests".
Collect affected files from tasks (Affected Components/Existing Code Impact) and recent commits/diffs if noted.
Calculate code metrics:
Cyclomatic Complexity per function (target ≤10)
Function size (target ≤50 lines)
File size (target ≤500 lines)
Nesting depth (target ≤3)
Parameter count (target ≤4)
MCP Ref Validation (MANDATORY for code changes — SKIP if --skip-mcp-ref flag passed):
Fast-track mode: When invoked with --skip-mcp-ref, skip this entire step (no OPT-, BP-, PERF- checks). Proceed directly to step 5 (static analysis). This reduces cost from ~5000 to ~800 tokens while preserving metrics + static analysis coverage.
MNT-: DRY violations (MNT-DRY-: duplicate logic), dead code (MNT-DC-: per checklist), complex conditionals, poor naming
MNT-DRY- cross-story hotspot scan: Grep for common pattern signatures (error handlers: catch.*Error|handleError, validators: validate|isValid, config access: getSettings|getConfig) across ALL src/ files (count mode). If any pattern appears in 5+ files, sample 3 files (Read 50 lines each) and check structural similarity. If >80% similar → MNT-DRY-CROSS (medium, -10 points): Pattern X duplicated in N files — extract to shared module.
MNT-DC- cross-story unused export scan: For each file modified by Story, count export declarations. Then Grep across ALL src/ for import references to those exports. Exports with 0 import references → MNT-DC-CROSS (medium, -10 points): {export} in {file} exported but never imported — remove or mark internal.
OPT-OSS- cross-reference ln-645 (static, fast-track safe): IF docs/project/.audit/ln-640/*/645-open-source-replacer*.md exists (glob across dates, take latest), check if any HIGH-confidence replacement matches files changed in current Story. IF match found → create OPT-OSS-{N} issue with module path, goal, recommended package, confidence, stars, license from ln-645 report. Severity: high if >200 LOC, medium otherwise. This check reads local files only — no MCP calls — runs even with --skip-mcp-ref.