AGENT SKILL

ln-613-code-comments-auditor

Checks inline code documentation quality: WHY-not-WHAT, density, forbidden content, docstrings quality, actuality, legacy cleanup. Use when auditing comments and docstrings.

License 许可
MIT
最近更新
2026-06-15
Stars
★ 2
Forks
1

01 前言 Front Matter

name
ln-613-code-comments-auditor
model
claude-sonnet-4-6
license
MIT
description
Checks inline code documentation quality: WHY-not-WHAT, density, forbidden content, docstrings quality, actuality, legacy cleanup. Use when auditing comments and docstrings.
allowed-tools
Read, Grep, Glob, Bash, mcp__hex-line__outline, mcp__hex-line__read_file

02 资源文件 6

03 SKILL.md 正文

Paths: File paths (references/, ../ln-*) are relative to this skill directory.

Inline Code Documentation Auditor (L3 Worker)

Type: L3 Worker

Specialized worker auditing inline code documentation quality: comments, docstrings, and language-specific documentation blocks.

Purpose & Scope

  • Audit inline code documentation for quality and compliance across 6 categories
  • Universal for any tech stack (auto-detect comment syntax)
  • Return structured findings to coordinator with severity, location, recommendations
  • Calculate compliance score (X/10) for Inline Code Documentation category
  • Scope is limited to comments/docstrings/JSDoc/XML docs
  • Out of scope: code design quality, naming quality, test quality, architecture quality, or feature correctness except where comments contradict code

Inputs

MANDATORY READ: Load references/audit_worker_core_contract.md and references/mcp_tool_preferences.md.

Receives contextStore with: tech_stack, project_root, output_dir.

Workflow

  1. Parse Context: Extract tech stack, project root, output_dir from contextStore
  2. Scan: Find all source files (use tech_stack for detection) Hex-line primary path: Use outline(file_path) and discovery-first read_file() for code files before analyzing comments. Use edit_ready=true, verbosity="full" only if the audit turns into a follow-up edit. Do not use hex-graph here - comment quality is a code-reading problem, not a semantic graph problem.
  3. Extract: Parse inline comments + docstrings/JSDoc
  4. Audit: Run 6 category checks (see Audit Categories below)
  5. Collect Findings: Record each violation with severity, location (file:line), effort estimate (S/M/L), recommendation
  6. Calculate Score: Count violations by severity, calculate compliance score (X/10)
  7. Write Report: Build full markdown report per references/templates/audit_worker_report_template.md, write to {output_dir}/ln-613--global.md in single Write call
  8. Return Summary: Return minimal summary to coordinator (see Output Format)

Audit Categories

# Category What to Check
1 WHY not WHAT Comments explain rationale, not obvious code behavior; no restating code
2 Density (15-20%) Comment-to-code ratio within range; not over/under-commented
3 No Forbidden Content No dates/authors; no historical notes; no code examples in comments
4 Docstrings Quality Match function signatures; parameters documented; return types accurate
5 Actuality Comments match code behavior; no stale references; examples runnable
6 Legacy Cleanup No TODO without context; no commented-out code; no unsupported notes

Scoring Algorithm

MANDATORY READ: Load references/audit_scoring.md.

Output Format

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-613--global.md with category: "Inline Code Documentation" and checks: why_not_what, density, forbidden_content, docstrings_quality, actuality, legacy_cleanup.

Return summary per references/audit_summary_contract.md.

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-613--global.md
Score: X.X/10 | Issues: N (C:N H:N M:N L:N)

Severity mapping:

Issue Type Severity
Author names, dates in comments CRITICAL
Commented-out code blocks HIGH
Stale/outdated comments HIGH
Obvious WHAT comments MEDIUM
Density deviation >5% MEDIUM
Minor density deviation LOW

Critical Rules

Apply the already-loaded references/audit_worker_core_contract.md.

  • Do not auto-fix: Report violations only; coordinator aggregates for user
  • Fix code, not rules: NEVER modify rules files (*_rules.md, *_standards.md) to make violations pass
  • Code is truth: When comment contradicts code, flag the documentation for update; do not turn this into a general code-quality review
  • WHY > WHAT: Comments explaining obvious behavior should be removed
  • Universal: Works with any language; detect comment syntax automatically
  • Location precision: Always include file:line for programmatic navigation

Definition of Done

Apply the already-loaded references/audit_worker_core_contract.md.

  • [ ] contextStore parsed successfully (including output_dir)
  • [ ] All source files scanned (tech stack from contextStore)
  • [ ] All 6 categories audited
  • [ ] Findings collected with severity, location, effort, recommendation
  • [ ] Score calculated using penalty algorithm
  • [ ] Report written to {output_dir}/ln-613--global.md (atomic single Write call)
  • [ ] Summary written per contract

Reference Files


Version: 4.0.0 Last Updated: 2026-03-01

04 同仓库更多 Skills

vitalikpestov
vitalikpestov/Skills-Catalog

solana-dev

Use when user asks to "build a Solana dapp", "write an Anchor program", "create a token", "debug Solana errors", "set up wallet connection", "test my Solana program", "deploy to devnet", or "explain Solana concepts" (rent, accounts, PDAs, CPIs, etc.). End-to-end Solana development playbook covering wallet connection, Anchor/Pinocchio programs, Codama client generation, LiteSVM/Mollusk/Surfpool testing, and security checklists. Integrates with the Solana MCP server for live documentation search. Prefers framework-kit (@solana/client + @solana/react-hooks) for UI, wallet-standard-first connection (incl. ConnectorKit), @solana/kit for client/RPC code, and @solana/web3-compat for legacy boundaries.

★ 2
vitalikpestov
vitalikpestov/Skills-Catalog

generating-trading-signals

Generate trading signals using technical indicators (RSI, MACD, Bollinger Bands, etc.). Combines multiple indicators into composite signals with confidence scores. Use when analyzing assets for trading opportunities or checking technical indicators. Trigger with phrases like "get trading signals", "check indicators", "analyze for entry", "scan for opportunities", "generate buy/sell signals", or "technical analysis".

★ 2
vitalikpestov
vitalikpestov/Skills-Catalog

prediction-monitor

Prediction Monitor - Auto-activating skill for ML Deployment. Triggers on: prediction monitor, prediction monitor Part of the ML Deployment skill category.

★ 2
vitalikpestov
vitalikpestov/Skills-Catalog

strategy-advisor

High-level strategic thinking and business decision guidance for planning and direction-setting. Use when: making strategic decisions, evaluating business options, setting direction, analyzing trade-offs, or when user mentions strategy, business planning, competitive analysis, or long-term planning.

★ 2
vitalikpestov
vitalikpestov/Skills-Catalog

app-paywall-pilot

Design, audit, debug, and implement App Store-compliant mobile paywalls, subscription flows, pricing screens, trials, offers, feature gates, and subscription lifecycle UX. Use when the user asks to audit my paywall, fix App Store 3.1.2 rejection, improve trial-to-paid, choose plans/prices/trials, review RevenueCat/Adapty/Apphud/Superwall setup, calculate LTV/ROAS, or build paywall implementation.

★ 2
vitalikpestov
vitalikpestov/Skills-Catalog

figma

Use the Figma MCP server to fetch design context, screenshots, variables, and assets from Figma, and to translate Figma nodes into production code. Trigger when a task involves Figma URLs, node IDs, design-to-code implementation, or Figma MCP setup and troubleshooting.

★ 2