ln-624-code-maintainability-hotspot-auditor — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited ln-624-code-maintainability-hotspot-auditor (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
Paths: File paths (references/,../ln-*) are relative to this skill directory.
Type: L3 Worker
Specialized worker auditing local code hotspots that are hard to read, change, or reason about.
REFACTOR_HOTSPOT, SIMPLIFY_SIGNATURE, EXTRACT_CONSTANT, or UNIFY_IDENTIFIERMANDATORY READ: Load references/audit_worker_core_contract.md. Tool policy: follow host AGENTS.md MCP preferences; load references/mcp_tool_preferences.md and references/mcp_integration_patterns.md only when host policy is absent or MCP behavior is unclear.
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).
Detection policy: use two-layer detection (candidate scan, then context verification); load references/two_layer_detection.md only when the verification method is ambiguous.
1) Parse context -- extract fields, determine scan_path (domain-aware if specified), extract output_dir 2) Scan codebase for violations (Layer 1)
scan_path (not codebase_root)contextStore.graph_indexed OR .hex-skills/codegraph/index.db exists:audit_workspace(path=scan_path, verbosity="minimal", limit=5) -- use returned hotspots to pre-identify complex functions and god classes. Raise limit only for deliberate drill-down.analyze_architecture(path=scan_path, verbosity="full") -- use returned coupling metrics for cascade depth and coupling analysis.outline(file_path) before reading large source files -- understand function/class structure for complexity analysis.Grep(pattern="if.*if.*if", path=scan_path) for nesting detection3) Analyze context per candidate (Layer 2 -- MANDATORY) Layer 1 finding without Layer 2 = NOT a valid finding. Before reporting, ask: "Is this violation intentional or justified by design?"
@JsonProperty, alias_generator, @SerializedName) or an ORM column mapping (@Column(name=...))? If yes -> downgrade or skip4) Collect findings with severity, location, effort, recommendation
domain: domain_name (if domain-aware)5) Calculate score using penalty algorithm 6) Write Report: Build full markdown report in memory per references/templates/audit_worker_report_template.md, write to {output_dir}/ln-624--{domain}.md (or 624-quality.md in global mode) in single Write call 7) Return Summary: Return minimal summary (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: 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: Same concept uses different identifiers across API contracts, DTOs, services, repositories, DB columns, or internal modules
Detection:
| Issue | Pattern | Example |
|---|---|---|
| External contract drift | API/OpenAPI/external-schema field name differs from DTO/service/repo/DB column | user_id in OpenAPI but uid in DTO, userId in service, user column in DB |
| Synonym drift (internal) | Same entity referenced by competing names across modules | customer vs client vs account vs user for one concept |
| Unmediated casing/translation | snake/camel/kebab swap without an explicit serializer alias | created_at API field assigned to creationTime with no alias declared |
| Abbreviation drift | Full and abbreviated forms coexist for one concept | organization vs org vs orgId vs organizationId |
Severity:
customer / client / account)Layer 2 requirement: Synonym drift detection relies on a curated project glossary or on reading usage context. Grep alone is insufficient -- always confirm the two identifiers refer to the same concept before reporting.
Recommendation:
@JsonProperty, alias_generator, @SerializedName) rather than renaming the field inside the codeEffort: S-M (rename + serializer config). L when a DB column rename plus migration is required
MANDATORY READ: Load references/audit_scoring.md.
MANDATORY READ: Load references/templates/audit_worker_report_template.md.
Write JSON summary per references/audit_summary_contract.md. In managed mode the caller passes both runId and summaryArtifactPath; in standalone mode the worker generates its own run-scoped artifact path per shared contract.
Write report to {output_dir}/ln-624--{domain}.md (or 624-quality.md in global mode) with category: "Code Maintainability Hotspots" and checks: cyclomatic_complexity, deep_nesting, long_methods, god_classes, too_many_params, quadratic_algorithms, magic_numbers, method_signatures, identifier_consistency.
When summaryArtifactPath is absent, write the standalone runtime summary under .hex-skills/runtime-artifacts/runs/{run_id}/evaluation-worker/{worker}--{identifier}.json and optionally echo the same summary in structured output.
Report written: .hex-skills/runtime-artifacts/runs/{run_id}/audit-report/ln-624--orders.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)Apply the already-loaded references/audit_worker_core_contract.md.
domain_mode="domain-aware", scan ONLY scan_path (not entire codebase)domain field in each finding when domain-awareREFACTOR_HOTSPOT, SIMPLIFY_SIGNATURE, EXTRACT_CONSTANT, or UNIFY_IDENTIFIER.Apply the already-loaded references/audit_worker_core_contract.md.
{output_dir}/ln-624--{domain}.md (atomic single Write call)references/audit_output_schema.mdVersion: 3.0.0 Last Updated: 2025-12-23
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.