.claude/skills/ln-624-code-quality-auditor/SKILL.md
Code quality audit worker (L3). Checks cyclomatic complexity, deep nesting, long methods, god classes, method signature quality, O(n²) algorithms, N+1 queries, magic numbers/constants. Returns findings with severity, location, effort, recommendations.
npx skillsauth add cbbkrd-tech/jl-finishes ln-624-code-quality-auditorInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Specialized worker auditing code complexity, method signatures, algorithms, and constants management.
MANDATORY READ: Load shared/references/task_delegation_pattern.md#audit-coordinator--worker-contract for contextStore structure.
Receives contextStore with: tech_stack, best_practices, principles, codebase_root, output_dir.
Domain-aware: Supports domain_mode + current_domain (see audit_output_schema.md#domain-aware-worker-output).
Parse context — extract fields, determine scan_path (domain-aware if specified), extract output_dir
Scan codebase for violations
scan_path (not codebase_root)Grep(pattern="if.*if.*if", path=scan_path) for nesting detectionCollect findings with severity, location, effort, recommendation
domain: domain_name (if domain-aware)Calculate score using penalty algorithm
Write Report: Build full markdown report in memory per shared/templates/audit_worker_report_template.md, write to {output_dir}/624-quality-{domain}.md (or 624-quality.md in global mode) in single Write call
Return Summary: Return minimal summary to coordinator (see Output Format)
What: Too many decision points in single function (> 10)
Detection:
eslint-plugin-complexity, radon (Python), gocyclo (Go)Severity:
Recommendation: Split function, extract helper methods, use early returns
Effort: M-L (depends on complexity)
What: Nested if/for/while blocks too deep
Detection:
Severity:
Recommendation: Extract functions, use guard clauses, invert conditions
Effort: M (refactor structure)
What: Functions too long, doing too much
Detection:
Severity:
Recommendation: Split into smaller functions, apply Single Responsibility
Effort: M (extract logic)
What: Files with too many responsibilities
Detection:
Severity:
Recommendation: Split into multiple files, apply separation of concerns
Effort: L (major refactor)
What: Functions with excessive parameters
Detection:
Severity:
Recommendation: Use parameter object, builder pattern, default parameters
Effort: S-M (refactor signature + calls)
What: Inefficient nested loops over collections
Detection:
for (i) { for (j) { ... } }arr.map(x => arr.filter(...))Severity:
Recommendation: Use hash maps, optimize with single pass, use better data structures
Effort: M (algorithm redesign)
What: ORM lazy loading causing N+1 queries
Detection:
users.forEach(u => u.getPosts())Severity:
Recommendation: Use eager loading, batch queries, JOIN
Effort: M (change ORM query)
What: Magic numbers/strings, decentralized constants, duplicates
Detection:
| Issue | Pattern | Example |
|-------|---------|---------|
| Magic numbers | Hardcoded numbers in conditions/calculations | if (status === 2) |
| Magic strings | Hardcoded strings in comparisons | if (role === 'admin') |
| Decentralized | Constants scattered across files | MAX_SIZE = 100 in 5 files |
| Duplicates | Same value multiple times | STATUS_ACTIVE = 1 in 3 places |
| No central file | Missing constants.ts or config.py | No single source of truth |
Severity:
Recommendation:
constants.ts, config.py, constants.go)const STATUS_ACTIVE = 1Effort: M (extract constants, update imports, consolidate)
What: Poor method contracts reducing readability and maintainability
Detection:
| Issue | Pattern | Example |
|-------|---------|---------|
| Boolean flag params | >=2 boolean params in signature | def process(data, is_async: bool, skip_validation: bool) |
| Too many optional params | >=3 optional params with defaults | def query(db, limit=10, offset=0, sort="id", order="asc") |
| Inconsistent verb naming | Different verbs for same operation type in one module | get_user() vs fetch_account() vs load_profile() |
| Unclear return type | -> dict, -> Any, -> tuple without TypedDict/NamedTuple | def get_stats() -> dict instead of -> StatsResponse |
Severity:
Recommendation:
get_ for sync, fetch_ for async, etc.)Effort: S-M (refactor signatures + callers)
What: Functions triggering cascading chains of external side-effects (DB writes → notifications → metrics → limits).
Detection:
MANDATORY READ: shared/references/ai_ready_architecture.md for side-effect markers, false positive exclusions, and opaque sink rules.
**/services/**/*.{py,ts,js,cs,java} to find service filesSeverity:
Recommendation: Refactor to flat orchestration — extract side-effects into independent sink functions. See reference.
Effort: M-L
Output: Also generate summary Pipe/Sink table per module:
| Module | Sinks (0-1) | Shallow Pipes (2) | Deep Pipes (3+) | Sink Ratio | |--------|-------------|-------------------|-----------------|------------|
MANDATORY READ: Load shared/references/audit_scoring.md for unified scoring formula.
MANDATORY READ: Load shared/templates/audit_worker_report_template.md for file format.
Write report to {output_dir}/624-quality-{domain}.md (or 624-quality.md in global mode) with category: "Code Quality" and checks: cyclomatic_complexity, deep_nesting, long_methods, god_classes, too_many_params, quadratic_algorithms, n_plus_one, magic_numbers, method_signatures, cascade_depth.
Return summary to coordinator:
Report written: docs/project/.audit/624-quality-orders.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)
domain_mode="domain-aware", scan ONLY scan_path (not entire codebase)domain field in each finding when domain-aware{output_dir}/624-quality-{domain}.md (atomic single Write call)shared/templates/audit_worker_report_template.mdshared/references/audit_scoring.mdshared/references/audit_output_schema.mdVersion: 3.0.0 Last Updated: 2025-12-23
testing
When the user wants to plan a content strategy, decide what content to create, or figure out what topics to cover. Also use when the user mentions "content strategy," "what should I write about," "content ideas," "blog strategy," "topic clusters," or "content planning." For writing individual pieces, see copywriting. For SEO-specific audits, see seo-audit.
development
When the user wants to create competitor comparison or alternative pages for SEO and sales enablement. Also use when the user mentions 'alternative page,' 'vs page,' 'competitor comparison,' 'comparison page,' '[Product] vs [Product],' '[Product] alternative,' or 'competitive landing pages.' Covers four formats: singular alternative, plural alternatives, you vs competitor, and competitor vs competitor. Emphasizes deep research, modular content architecture, and varied section types beyond feature tables.
development
Write B2B cold emails and follow-up sequences that get replies. Use when the user wants to write cold outreach emails, prospecting emails, cold email campaigns, sales development emails, or SDR emails. Covers subject lines, opening lines, body copy, CTAs, personalization, and multi-touch follow-up sequences.
development
When the user wants to reduce churn, build cancellation flows, set up save offers, recover failed payments, or implement retention strategies. Also use when the user mentions 'churn,' 'cancel flow,' 'offboarding,' 'save offer,' 'dunning,' 'failed payment recovery,' 'win-back,' 'retention,' 'exit survey,' 'pause subscription,' or 'involuntary churn.' This skill covers voluntary churn (cancel flows, save offers, exit surveys) and involuntary churn (dunning, payment recovery). For post-cancel win-back email sequences, see email-sequence. For in-app upgrade paywalls, see paywall-upgrade-cro.